Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[13.0][MIG] product_assortment #517

Merged
merged 10 commits into from Jan 6, 2020

Conversation

Laurent-Corron
Copy link

No description provided.

@Laurent-Corron Laurent-Corron mentioned this pull request Oct 21, 2019
24 tasks
@Laurent-Corron Laurent-Corron force-pushed the 13.0-MIG-product_assortment branch 2 times, most recently from cbbc45a to af2a26f Compare October 21, 2019 12:18
Copy link
Sponsor Contributor

@lmignon lmignon left a comment

Choose a reason for hiding this comment

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

Code review + functional tests

Copy link
Sponsor Contributor

@rousseldenis rousseldenis left a comment

Choose a reason for hiding this comment

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

Code review

Copy link
Contributor

@legalsylvain legalsylvain left a comment

Choose a reason for hiding this comment

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

Hi.

Thanks for porting this module. Some minor remarks inline. The rest LGTM for me. Code review / no test.

BTW, I'm just discovering this module. i think it is great, but should be more generic. This feature is interesting for product, but could be also implemented for partners, or any other model.

A more abstract module, in server-ux could be interesting.

not a blocking point, just sharing my pov.

kind regards.

from odoo.osv import expression


class ProductAssortment(models.Model):
Copy link
Contributor

Choose a reason for hiding this comment

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

class IrFilters(models.Model):

is_assortment = fields.Boolean(default=lambda x: x._get_default_is_assortment())

def _get_eval_domain(self):
res = super(ProductAssortment, self)._get_eval_domain()
Copy link
Contributor

Choose a reason for hiding this comment

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

     res = super()._get_eval_domain()

def _get_action_domain(self, action_id=None):
# tricky way to act on get_filter method to prevent returning
# assortment in search view filters
domain = super(ProductAssortment, self)._get_action_domain(action_id=action_id)
Copy link
Contributor

Choose a reason for hiding this comment

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

     domain = super()._get_action_domain(action_id=action_id)

if self.env.context.get("product_assortment", False):
model = self.env.ref("product.model_product_product")
return model.model
return ""
Copy link
Contributor

Choose a reason for hiding this comment

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

     return False

@lmignon
Copy link
Sponsor Contributor

lmignon commented Nov 4, 2019

@OCA/product-maintainers This one is ready to merge. Thank you!

1 similar comment
@lmignon
Copy link
Sponsor Contributor

lmignon commented Nov 13, 2019

@OCA/product-maintainers This one is ready to merge. Thank you!

@lmignon
Copy link
Sponsor Contributor

lmignon commented Nov 13, 2019

@legalsylvain This one is ready to merge...

@pedrobaeza pedrobaeza added this to the 13.0 milestone Nov 26, 2019
@rousseldenis
Copy link
Sponsor Contributor

@legalsylvain

@legalsylvain
Copy link
Contributor

/ocabot merge

@OCA-git-bot
Copy link
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 13.0-ocabot-merge-pr-517-by-legalsylvain-bump-no, awaiting test results.

OCA-git-bot added a commit that referenced this pull request Jan 6, 2020
Signed-off-by legalsylvain
@OCA-git-bot OCA-git-bot merged commit d9a06dc into OCA:13.0 Jan 6, 2020
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 4b5c22b. Thanks a lot for contributing to OCA. ❤️

@lmignon lmignon deleted the 13.0-MIG-product_assortment branch January 6, 2020 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants