-
Notifications
You must be signed in to change notification settings - Fork 247
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
[IMP] product_packaging_through_attributes: updated code to OCA standard #1273
Open
oihane
wants to merge
1
commit into
odoomrp:8.0
Choose a base branch
from
oihane:8.0-packaging_info
base: 8.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
==================================== | ||
Product Packaging through Attributes | ||
==================================== | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,15 +18,15 @@ | |
|
||
{ | ||
"name": "Product Packaging through Attributes", | ||
"version": "1.0", | ||
"version": "8.0.1.1.0", | ||
"depends": [ | ||
"base", | ||
"product", | ||
"product_packaging_views", | ||
"product_attribute_types", | ||
], | ||
"author": "OdooMRP team," | ||
"AvanzOSC," | ||
"author": "OdooMRP team, " | ||
"AvanzOSC, " | ||
"Serv. Tecnol. Avanzados - Pedro M. Baeza", | ||
"website": "http://www.odoomrp.com", | ||
"contributors": [ | ||
|
@@ -35,7 +35,6 @@ | |
"Ana Juaristi <[email protected]>" | ||
], | ||
"category": "Custom Module", | ||
"summary": "", | ||
"data": [ | ||
"views/product_view.xml", | ||
"views/res_partner_view.xml", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
product_packaging_through_attributes/migrations/8.0.1.1.0/pre-migration.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2016 Oihane Crucelaegui - AvanzOSC | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html | ||
|
||
|
||
def update_columns(cr): | ||
cr.execute( | ||
""" | ||
ALTER TABLE product_attribute_value | ||
RENAME COLUMN package_product TO package_product_id | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Por qué no usar oldname? |
||
""") | ||
cr.execute( | ||
""" | ||
ALTER TABLE product_packaging | ||
RENAME COLUMN product TO product_id | ||
""") | ||
cr.execute( | ||
""" | ||
ALTER TABLE res_partner | ||
RENAME COLUMN partner_product_ul TO partner_product_ul_id | ||
""") | ||
|
||
|
||
def migrate(cr, version): | ||
if not version: | ||
return | ||
update_columns(cr) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
purchase_packaging_info/migrations/8.0.1.1.0/pre-migration.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2016 Oihane Crucelaegui - AvanzOSC | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html | ||
|
||
|
||
def update_columns(cr): | ||
cr.execute( | ||
""" | ||
ALTER TABLE purchase_order | ||
RENAME COLUMN product_ul TO product_ul_id | ||
""") | ||
cr.execute( | ||
""" | ||
ALTER TABLE purchase_order_line | ||
RENAME COLUMN sec_pack TO sec_pack_id | ||
""") | ||
|
||
|
||
def migrate(cr, version): | ||
if not version: | ||
return | ||
update_columns(cr) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2016 Oihane Crucelaegui - AvanzOSC | ||
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html | ||
|
||
|
||
def update_columns(cr): | ||
cr.execute( | ||
""" | ||
ALTER TABLE sale_order | ||
RENAME COLUMN product_ul TO product_ul_id | ||
""") | ||
cr.execute( | ||
""" | ||
ALTER TABLE sale_order_line | ||
RENAME COLUMN sec_pack TO sec_pack_id | ||
""") | ||
|
||
|
||
def migrate(cr, version): | ||
if not version: | ||
return | ||
update_columns(cr) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Puedes cambiar ya a Tecnativa