-
-
Notifications
You must be signed in to change notification settings - Fork 730
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
11.0 Migration partner_location_auto_create #443
Conversation
…he parent location of the company as default location
Another improvement: |
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.
Small changes !!
'license': 'AGPL-3', | ||
'complexity': 'normal', | ||
'images': [], | ||
'website': 'http://www.savoirfairelinux.com', |
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.
Website should be https://github.com/OCA/stock-logistics-warehouse
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.
👍
'test': [], | ||
'auto_install': False, | ||
'installable': True, | ||
} |
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.
Remove empty key and flags.
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.
👍
# © 2018 brain-tec AG (Kumar Aberer <kumar.aberer@braintec-group.com>) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo import api, SUPERUSER_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.
Not sure if this is needed anymore. We have a sudo now.
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's needed to create a new Environment for the installation hook. Sudo does not help here
@@ -0,0 +1,26 @@ | |||
<?xml version="1.0"?> | |||
<openerp> | |||
|
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.
No description provided.
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.
👍
<button name="%(stock.action_location_form)d" | ||
position="after"> | ||
<group> | ||
|
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.
You can remove this extra space.
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.
👍
<openerp> | ||
<data> | ||
|
||
<record id="view_partner_form" model="ir.ui.view" > |
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.
replace for all openerp tag reference
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.
👍
|
||
|
||
|
||
</data> |
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.
Remove unnecessary space from xml files.
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.
Code review
############################################################################## | ||
# © 2015 Savoir-faire Linux | ||
# © 2018 brain-tec AG (Kumar Aberer <kumar.aberer@braintec-group.com>) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from openerp import models, fields, api |
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.
openerp => odoo
_inherit = 'res.config.settings' | ||
|
||
default_customer_location = fields.Many2one( | ||
related='company_id.default_customer_location') |
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.
readonly=True
default_customer_location = fields.Many2one( | ||
related='company_id.default_customer_location') | ||
default_supplier_location = fields.Many2one( | ||
related='company_id.default_supplier_location') |
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 as above
############################################################################## | ||
# © 2015 Savoir-faire Linux | ||
# © 2018 brain-tec AG (Kumar Aberer <kumar.aberer@braintec-group.com>) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
from openerp import models, fields, api, _ |
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.
openerp => odoo
location.unlink() | ||
for partner in self: | ||
for location in partner.location_ids: | ||
moves = move_obj.search([ |
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.
If you have locations with huge moves, this could be a bottleneck.
I would have used search_count() instead or search with a limit of 1 before the loop and create a dict with result grouping by location id and then iterating.
@@ -0,0 +1,26 @@ | |||
<?xml version="1.0"?> | |||
<openerp> |
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.
odoo
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.
Code review
@MeetKD Can you update your 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.
code review: lgtm
please squash your commits. I'll approve then
@ghost due to inactivity, this will be closed soon. |
Closing this due to inactivity and user has been deleted. |
Migration of partner_location_auto_create
two improvement have been made:
https://github.com/BT-kaberer/stock-logistics-warehouse/blob/11.0-mig-partner_location_auto_create/partner_location_auto_create/hooks.py#L9
#343