-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[17.0][MIG] sale_automatic_workflow: Migration to 17.0 #3105
Conversation
@trisdoan thank you. Can you rename your PR |
# pylint: disable=W8110 | ||
@api.onchange("workflow_process_id") | ||
def _onchange_workflow_process_id(self): | ||
"""Override to add stock related workflow.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to use a simple comment to not replace the docstring of the original method
# Override to add stock related workflow
"""Extend to add stock related workflow.""" | ||
|
||
def create_sale_order(self, workflow, override=None, product_type="product"): | ||
"""Override to create stock operations for each product.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same, use comment instead of docstring
return order | ||
|
||
def create_full_automatic(self, override=None): | ||
"""Override to include default stock related values.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here too
7e5b798
to
f34c352
Compare
Hello @sebalix, I updated as you suggest 🙏 |
/ocabot migration sale_automatic_workflow |
The migration issue (#2766) has not been updated to reference the current pull request because a previous pull request (#2826) is not closed. |
@@ -44,8 +55,6 @@ def _onchange_workflow_process_id(self): | |||
if not self.workflow_process_id: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @rousseldenis @sebalix, I updated as you suggest
I added this commit.
I adapt field picking_policy
in sale.order to writable computed field. Unfortunately, there is a module: sale_order_type
, which does the same thing but depends on field 'type_id' instead.
-> So one solution is to mark sale_order_type as rebel module. What do you guys think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure it's a good idea 🤔
What you could do is to extract the @api.depends
values in a method and make use of hasattr
like it's done in the compute method:
# in sale_order_type
def _depends_picking_policy(self):
depends = []
if hasattr(super(), "_depends_picking_policy"):
depends = super()._depends_picking_policy()
depends.append("type_id")
return depends
@api.depends(lambda self: self._depends_picking_policy())
def _compute_picking_policy():
[...]
# in sale_automatic_workflow_stock
def _depends_picking_policy(self):
depends = []
if hasattr(super(), "_depends_picking_policy"):
depends = super()._depends_picking_policy()
depends.append("workflow_process_id")
return depends
@api.depends(lambda self: self._depends_picking_policy())
def _compute_picking_policy():
[...]
This way we are dynamically compatible with both modules installed (and probably still with an undefined behavior, but that's better than something else I guess).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@trisdoan any news about this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commit is coming today. Will ping you when it's done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @sebalix, updated as you suggest + tests are green 🙏
DRAFT: working on failed tests |
d61452d
to
028edd7
Compare
Currently translated at 21.4% (12 of 56 strings) Translation: sale-workflow-16.0/sale-workflow-16.0-sale_automatic_workflow Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_automatic_workflow/it/
Currently translated at 50.0% (28 of 56 strings) Translation: sale-workflow-16.0/sale-workflow-16.0-sale_automatic_workflow Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_automatic_workflow/sl/
Currently translated at 21.4% (12 of 56 strings) Translation: sale-workflow-16.0/sale-workflow-16.0-sale_automatic_workflow Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_automatic_workflow/it/
Currently translated at 28.5% (16 of 56 strings) Translation: sale-workflow-16.0/sale-workflow-16.0-sale_automatic_workflow Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_automatic_workflow/it/
Currently translated at 100.0% (56 of 56 strings) Translation: sale-workflow-16.0/sale-workflow-16.0-sale_automatic_workflow Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_automatic_workflow/es/
Currently translated at 62.5% (35 of 56 strings) Translation: sale-workflow-16.0/sale-workflow-16.0-sale_automatic_workflow Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_automatic_workflow/de/
Currently translated at 98.2% (55 of 56 strings) Translation: sale-workflow-16.0/sale-workflow-16.0-sale_automatic_workflow Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_automatic_workflow/pt_BR/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: sale-workflow-16.0/sale-workflow-16.0-sale_automatic_workflow Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_automatic_workflow/
Currently translated at 75.0% (42 of 56 strings) Translation: sale-workflow-16.0/sale-workflow-16.0-sale_automatic_workflow Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_automatic_workflow/de/
Currently translated at 100.0% (56 of 56 strings) Translation: sale-workflow-16.0/sale-workflow-16.0-sale_automatic_workflow Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_automatic_workflow/es/
Currently translated at 100.0% (56 of 56 strings) Translation: sale-workflow-16.0/sale-workflow-16.0-sale_automatic_workflow Translate-URL: https://translation.odoo-community.org/projects/sale-workflow-16-0/sale-workflow-16-0-sale_automatic_workflow/es/
There is an issue for service companies that do not need the stock module to be installed when using `sale_automatic_workflow`. Module depended on `stock`, therefore it was auto installed. Now, stock related part is moved to a separate module - `sale_automatic_workflow_stock` and can be installed separately.
d255560
to
1d0e79e
Compare
This PR has the |
/ocabot merge nobump |
This PR looks fantastic, let's merge it! |
Congratulations, your PR was merged at 834b836. Thanks a lot for contributing to OCA. ❤️ |
This change