Skip to content

[MIG][9.0] product_multi_image to v9#199

Merged
pedrobaeza merged 10 commits intoOCA:9.0from
LasLabs:release/9.0/SMD-216-product_multi_image
Dec 1, 2016
Merged

[MIG][9.0] product_multi_image to v9#199
pedrobaeza merged 10 commits intoOCA:9.0from
LasLabs:release/9.0/SMD-216-product_multi_image

Conversation

@lasley
Copy link
Copy Markdown

@lasley lasley commented Nov 4, 2016

[MIG] product_multi_image: Upgrade to v9 …

  • Upgrade product_multi_image to v9

This should supersede #161 due to inactivity.

This is dependent on merge of:

{
"name": "Multiple Images in Products",
"version": "8.0.2.0.0",
"author": "Serv. Tecnol. Avanzados - Pedro M. Baeza, "
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pedrobaeza - I took the liberty of removing your old company and changing the URI to Tecnativa. Let me know if I was incorrect with these changes

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course, thanks

@lasley lasley force-pushed the release/9.0/SMD-216-product_multi_image branch from 0608bf2 to 7280e62 Compare November 4, 2016 20:16
@lasley
Copy link
Copy Markdown
Author

lasley commented Nov 4, 2016

I'll get the Travis resolved sometime today

@lasley lasley force-pushed the release/9.0/SMD-216-product_multi_image branch 3 times, most recently from 2f0ef5e to 5e5f2bf Compare November 4, 2016 23:41
@lasley
Copy link
Copy Markdown
Author

lasley commented Nov 5, 2016

Bah well this error is a real scumbag, and is most definitely legit (good job with your tests @pedrobaeza).

>>> template = self.env['product.template'].create({
        'name': 'Test 2',
        'image_ids': [(0, 0, {
            'storage': 'db',
            'name': 'Image 1',
            'file_db_store': self.transparent_image,
            'owner_model': 'product.template',
        })],
    })
>>> len(template.image_ids)
1
>>> template.write({
        'attribute_line_ids': [
            (0, 0, {
                'attribute_id': self.attribute.id,
                'value_ids': [(6, 0, (self.value_1 + self.value_2).ids)],
            })],
    })
>>> len(template.image_ids)
0

I'm playing around with it in pdb at the moment, just wanted to provide an update because I said this would be done yesterday 😆

@simahawk
Copy link
Copy Markdown
Contributor

simahawk commented Nov 8, 2016

@lasley yep, I debugged it a couple of days ago and I was stuck here, when you delete the product the override of unlink deletes ALL the images.
I've not that much background on the whole module so after a while a gave up, willing to come back at some point :)
Let me know if I can help w/ further testing.

@pedrobaeza
Copy link
Copy Markdown
Member

I can take a look also, but not before the end of this week.

@lasley
Copy link
Copy Markdown
Author

lasley commented Nov 8, 2016

Yeah it seems that the variants aren't getting appended into the base_multi_image.image.product_variant_ids upon initial creation, so I'm thinking the issue is actually in _compute_image_ids.

(Pdb) template.image_ids
base_multi_image.image(517,)
(Pdb) template.image_ids.product_variant_ids
product.product()

I think it may have something to do with the fact that product.template now defines the image fields using new API, but the product.product still uses old. Maybe something with the API wire crossing similar to what is described in odoo/odoo#10799

@lasley
Copy link
Copy Markdown
Author

lasley commented Nov 10, 2016

We can scratch API wire crossing off the list of possible issues, #201 😦

@lasley
Copy link
Copy Markdown
Author

lasley commented Nov 30, 2016

This is solved in OCA/server-tools#628 & should be ready for review after merge

@pedrobaeza
Copy link
Copy Markdown
Member

Rebase your branch

@pedrobaeza
Copy link
Copy Markdown
Member

Actually only a rebuild is needed (I have launched it)

Copy link
Copy Markdown
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to complete tests testing product_variant_count computed field and uninstallation hook

@lasley lasley force-pushed the release/9.0/SMD-216-product_multi_image branch from db82f7b to 58357d2 Compare November 30, 2016 19:33
@lasley
Copy link
Copy Markdown
Author

lasley commented Nov 30, 2016

@pedrobaeza - I added one for the pre_init as well, Coverage was a free/false green there because it's a guaranteed run. We'll see if they pass, I didn't actually run in local TBH 😉

@pedrobaeza
Copy link
Copy Markdown
Member

I'm afraid there's no luck.

@lasley
Copy link
Copy Markdown
Author

lasley commented Nov 30, 2016

Even more disconcerting is the fact that Runbot is 🍏

@pedrobaeza
Copy link
Copy Markdown
Member

👏 👏 👏

Copy link
Copy Markdown
Contributor

@sebalix sebalix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonderful

@pedrobaeza
Copy link
Copy Markdown
Member

@lasley Please squash your commits and I'll merge.

* Upgrade product_multi_image to v9
* Add server-tools to oca_dependencies
* Update hooks
* Add template fields override
* Remove old inheritance from product template
* Add tests
* Alphabetize imports
@lasley lasley force-pushed the release/9.0/SMD-216-product_multi_image branch from 2cd976e to 7128205 Compare December 1, 2016 16:00
@lasley
Copy link
Copy Markdown
Author

lasley commented Dec 1, 2016

Squashed up! I'll knock out the v10 in the next few days

@pedrobaeza pedrobaeza merged commit 7850d04 into OCA:9.0 Dec 1, 2016
@pedrobaeza pedrobaeza mentioned this pull request Dec 1, 2016
37 tasks
@simahawk
Copy link
Copy Markdown
Contributor

simahawk commented Dec 2, 2016

yay! thanks @lasley !

@lasley lasley deleted the release/9.0/SMD-216-product_multi_image branch December 2, 2016 15:46
ernestotejeda pushed a commit to Tecnativa/product-attribute that referenced this pull request Aug 22, 2019
In some cases the values were prefetched and it was throwing bad prices.
we add prefetch_fields to the context of the packs and that solve it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants