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

[10.0][ADD] sale_mrp_link module #661

Merged
merged 2 commits into from
Sep 21, 2018
Merged

Conversation

tafaRU
Copy link
Member

@tafaRU tafaRU commented Jun 18, 2018

@tafaRU tafaRU changed the title [ADD] sale_mrp_link module [10.0][ADD] sale_mrp_link module Jun 19, 2018
@tafaRU tafaRU force-pushed the 10.0-mig-sale_mrp_link branch 5 times, most recently from a0e9d64 to 2d7ecba Compare June 19, 2018 16:20
@@ -0,0 +1,3 @@
from . import mrp_production
from . import sale_order
from . import procurement_order

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

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, _

Choose a reason for hiding this comment

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

import order.

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)

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.

Copy link

@hieulucky111 hieulucky111 left a 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.

Copy link
Contributor

@florian-dacosta florian-dacosta left a 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!

'category': 'Sales Management',
'website': 'https://github.com/OCA/sale-workflow',
'author': 'Agile Business Group, Akretion, '
'Odoo Community Association (OCA)',
Copy link
Contributor

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.

Copy link
Member Author

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 <alex.comba@agilebg.com>
* Florian da Costa <florian.dacosta@akretion.com>
Copy link
Contributor

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

@@ -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).
Copy link
Contributor

Choose a reason for hiding this comment

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

ncompatible => incompatible

tafaRU added a commit to tafaRU/sale-workflow that referenced this pull request Jun 22, 2018
@tafaRU
Copy link
Member Author

tafaRU commented Jun 22, 2018

@hieulucky111, @florian-dacosta, thanks a lot for your review! I should have addreessed all your comments, please check it.

Copy link
Contributor

@florian-dacosta florian-dacosta left a comment

Choose a reason for hiding this comment

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

Thanks

Copy link
Member

@SimoRubi SimoRubi left a 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.

@tafaRU
Copy link
Member Author

tafaRU commented Jun 27, 2018

@SimoRubi, done at 55e441c

Copy link
Member

@SimoRubi SimoRubi left a comment

Choose a reason for hiding this comment

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

Ok then

@tafaRU tafaRU requested a review from eLBati June 27, 2018 09:18
@eLBati
Copy link
Member

eLBati commented Jul 3, 2018

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 production_id field of procurement.order
In this way, you can also avoid to modify .travis.yml

@eLBati
Copy link
Member

eLBati commented Jul 3, 2018

Even better, instead of searching for procurements by procurement group, searching using sale_line_id field of procurement.order

@florian-dacosta
Copy link
Contributor

@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...

@eLBati
Copy link
Member

eLBati commented Jul 6, 2018

ok then 👍

@tafaRU
Copy link
Member Author

tafaRU commented Jul 6, 2018

Thanks @florian-dacosta for the comment!
If that's okay with you, @eLBati, then you could merge it. Thanks.

.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
Copy link
Member

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
Copy link
Contributor

Choose a reason for hiding this comment

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

Why excluding those modules?

Copy link
Member Author

@tafaRU tafaRU Aug 30, 2018

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

Copy link
Member Author

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!

sale_mrp_link/__manifest__.py Outdated Show resolved Hide resolved
tafaRU added a commit to tafaRU/sale-workflow that referenced this pull request Sep 10, 2018
tafaRU added a commit to tafaRU/sale-workflow that referenced this pull request Sep 11, 2018
@tafaRU
Copy link
Member Author

tafaRU commented Sep 11, 2018

@OCA/crm-sales-marketing-maintainers I think this PR is finally ready to be merged. Could you please check? Thanks

@tafaRU
Copy link
Member Author

tafaRU commented Sep 14, 2018

ping @OCA/crm-sales-marketing-maintainers !

@eLBati eLBati merged commit b3a14ea into OCA:10.0 Sep 21, 2018
@tafaRU tafaRU deleted the 10.0-mig-sale_mrp_link branch September 21, 2018 07:39
sylvainvh pushed a commit to camptocamp/sale-workflow that referenced this pull request Feb 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants