Skip to content

Commit

Permalink
Merge PR #1890 into 12.0
Browse files Browse the repository at this point in the history
Signed-off-by marcelsavegnago
  • Loading branch information
OCA-git-bot committed Apr 29, 2022
2 parents b32ee54 + 7e3876a commit cc2f6ae
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ env:


install:
- git clone --depth=1 https://github.com/OCA/maintainer-quality-tools.git
- git clone --depth=1 https://github.com/akretion/maintainer-quality-tools.git -b master-no-QUnitSuite
${HOME}/maintainer-quality-tools
- export PATH=${HOME}/maintainer-quality-tools/travis:${PATH}
- export WKHTMLTOPDF_VERSION=0.12.5
Expand Down
17 changes: 8 additions & 9 deletions l10n_br_fiscal/migrations/12.0.24.0.0/pre-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,21 @@ def migrate(env, version):

companies = env["res.company"].search([])
for company in companies:
products = env["product.template"].search(
[
"|",
("company_id", "=", company.id),
("company_id", "=", False),
("icms_origin", "!=", False),
]
env.cr.execute(
"SELECT id, icms_origin FROM product_template "
"WHERE icms_origin is not NULL "
"AND (company_id=%s OR company_id IS NULL)",
(company.id,),
)
products = env.cr.fetchall()
for product in products:
env["ir.property"].create(
{
"name": "icms_origin",
"fields_id": field_property.id,
"company_id": company.id,
"type": "selection",
"res_id": "{},{}".format(product._name, product.id),
"value_text": product.icms_origin,
"res_id": "product.template,{}".format(product[0]),
"value_text": product[1],
}
)
17 changes: 8 additions & 9 deletions l10n_br_fiscal/migrations/12.0.25.0.0/pre-migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,21 @@ def migrate(env, version):

companies = env["res.company"].search([])
for company in companies:
products = env["product.template"].search(
[
"|",
("company_id", "=", company.id),
("company_id", "=", False),
("fiscal_type", "!=", False),
]
env.cr.execute(
"SELECT id, fiscal_type FROM product_template "
"WHERE fiscal_type is not NULL "
"AND (company_id=%s OR company_id IS NULL)",
(company.id,),
)
products = env.cr.fetchall()
for product in products:
env["ir.property"].create(
{
"name": "fiscal_type",
"fields_id": field_property.id,
"company_id": company.id,
"type": "selection",
"res_id": "{},{}".format(product._name, product.id),
"value_text": product.fiscal_type,
"res_id": "product.template,{}".format(product[0]),
"value_text": product[1],
}
)

0 comments on commit cc2f6ae

Please sign in to comment.