-
-
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
[10.0][ADD] sale_mrp_link module #661
Conversation
a0e9d64
to
2d7ecba
Compare
sale_mrp_link/models/__init__.py
Outdated
@@ -0,0 +1,3 @@ | |||
from . import mrp_production | |||
from . import sale_order | |||
from . import procurement_order |
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.
Import order.
# Copyright 2016-2018 Akretion | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo import models, fields |
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.
import order.
# Copyright 2016-2018 Akretion | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo import models, api, exceptions, _ |
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.
import order.
sale_mrp_link/models/sale_order.py
Outdated
mrp_production_model = self.env['mrp.production'] | ||
for sale in self: | ||
domain = [('sale_order_id', '=', sale.id)] | ||
self.production_count = mrp_production_model.search_count(domain) |
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.
it should be sale
instead self
.
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.
Please check my review.
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.
Seems good overall, some minor remarks
Thanks for the migration!
sale_mrp_link/__manifest__.py
Outdated
'category': 'Sales Management', | ||
'website': 'https://github.com/OCA/sale-workflow', | ||
'author': 'Agile Business Group, Akretion, ' | ||
'Odoo Community Association (OCA)', |
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.
I think authorship is normally in order of importance.
Also I do not think you should add an author for a standard migration. Adding it in contributor yes, but author?
Anyway, other opinions are welcome on the subject.
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.
@florian-dacosta, no problem to change the order of authorship. Please note this is not just a standard migration: I added a new code and modified the original one. This is the reason I chose to add my company to author.
@@ -0,0 +1,2 @@ | |||
* Alex Comba <[email protected]> | |||
* Florian da Costa <[email protected]> |
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.
Wrong order, it should be the contrary
sale_mrp_link/readme/ROADMAP.rst
Outdated
@@ -0,0 +1 @@ | |||
The module is ncompatible with `sale_sourced_by_line <https://github.com/OCA/sale-workflow/tree/10.0/sale_sourced_by_line>`_ and `sale_quotation_sourcing <https://github.com/OCA/sale-workflow/blob/10.0/sale_quotation_sourcing>`_ (please note this latter is not migrated yet). |
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.
ncompatible => incompatible
@hieulucky111, @florian-dacosta, thanks a lot for your review! I should have addreessed all your comments, please check it. |
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.
Thanks
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.
Check runbot, I think it is saying you have to generate the README.
The rest of the code is great.
Tried in runbot, it is ok.
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.
Ok then
I would avoid to create and write additional fields, as production order can be retrieved with a computed field , in sale.order, that search for linked procurements by procurement group , and thus production order by |
Even better, instead of searching for procurements by procurement group, searching using |
@eLBati I think you would have to search by procurement group anyway, because the sale_line_id is not propagated on all procurements, juste the first one created which usually is used to create the delivery order. Having a new field of the Manufacture order is useful. It is not only used by the sale order button to show the manufacture order (which could be done with a computed field, like you say) but also on the side of the manufacturing order, A direct link to between Sale Order and the Manufacture Order allow you to apply filter, help for BI, see easily which SO is concernd in MO form view... |
ok then 👍 |
Thanks @florian-dacosta for the comment! |
.travis.yml
Outdated
- TESTS="1" ODOO_REPO="odoo/odoo" LINT_CHECK="0" EXCLUDE=sale_sourced_by_line,sale_procurement_group_by_line | ||
- TESTS="1" ODOO_REPO="OCA/OCB" LINT_CHECK="0" EXCLUDE=sale_sourced_by_line,sale_procurement_group_by_line | ||
- TESTS="1" ODOO_REPO="odoo/odoo" LINT_CHECK="0" INCLUDE=sale_sourced_by_line | ||
- TESTS="1" ODOO_REPO="OCA/OCB" LINT_CHECK="0" INCLUDE=sale_sourced_by_line |
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.
@tafaRU in this way, sale_procurement_group_by_line
is never tested, right?
.travis.yml
Outdated
- TESTS="1" ODOO_REPO="odoo/odoo" LINT_CHECK="0" | ||
- TESTS="1" ODOO_REPO="OCA/OCB" LINT_CHECK="0" | ||
- TESTS="1" ODOO_REPO="odoo/odoo" LINT_CHECK="0" EXCLUDE=sale_sourced_by_line,sale_procurement_group_by_line | ||
- TESTS="1" ODOO_REPO="OCA/OCB" LINT_CHECK="0" EXCLUDE=sale_sourced_by_line,sale_procurement_group_by_line |
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.
Why excluding those modules?
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.
Hi @mreficent,
as I wrote here, this module is incompatible with those modules. The reason for this is that sale.order
and mrp.production
are linked by the field sale_order_id
and when the module sale_procurement_group_by_line
is installed, the field procurement_group_id
is only filled at sale.order.line
[1] level not at sale.order
level, as a standard way [2], and, consequently, here no sale.order
is found.
After #573 the sale_procurement_group_by_line
module is installed anyway, even though I excluded it. So that, I'd also to EXCLUDE
the module sale_stock_picking_blocking_proc_group_by_line
.
Would that be fine by you?
[1] https://github.com/OCA/sale-workflow/blob/10.0/sale_procurement_group_by_line/model/sale.py#L83
[2] https://github.com/odoo/odoo/blob/10.0/addons/sale/models/sale.py#L669
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.
just seen #690 it also should work in my case!
db936c7
to
97160bc
Compare
fa74fbe
to
0ef3145
Compare
…e with sale_mrp_link See OCA#661 (comment) for further info
…patible with sale_mrp_link See OCA#661 (comment) for further info
325b2db
to
a2c21a4
Compare
@OCA/crm-sales-marketing-maintainers I think this PR is finally ready to be merged. Could you please check? Thanks |
ping @OCA/crm-sales-marketing-maintainers ! |
…patible with sale_mrp_link See OCA#661 (comment) for further info
Migrated https://github.com/akretion/sale-workflow/blob/9-sale_mrp_link/sale_mrp_link/ to 10.0 cc @florian-dacosta