Skip to content

Commit 55b0fe4

Browse files
migration-bot-adhocmatiasperalta1
authored andcommitted
[MIG] product_price_taxes_included: Migration to 19.0
1 parent b41ae02 commit 55b0fe4

File tree

5 files changed

+8
-9
lines changed

5 files changed

+8
-9
lines changed

product_price_taxes_included/__manifest__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
##############################################################################
2020
{
2121
"name": "Product Price Taxes Included or Not",
22-
"version": "18.0.1.0.0",
22+
"version": "19.0.1.0.0",
2323
"category": "Product",
2424
"sequence": 14,
2525
"summary": "",
@@ -35,7 +35,7 @@
3535
"wizards/res_config_settings_views.xml",
3636
],
3737
"demo": [],
38-
"installable": False,
38+
"installable": True,
3939
"auto_install": False,
4040
"application": False,
4141
}

product_price_taxes_included/models/product_pricelist.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ def _get_products_price(self, products, quantity, date=False, uom_id=False, **kw
1616
* pricelist could be based on fixed prices so product price is not used
1717
"""
1818
res = super()._get_products_price(products, quantity, date=date, uom_id=uom_id, **kwargs)
19-
if self._context.get("taxes_included"):
20-
company_id = self._context.get("company_id") or self.env.company.id
19+
if self.env.context.get("taxes_included"):
20+
company_id = self.env.context.get("company_id") or self.env.company.id
2121
for product in products:
2222
# for compatibility with product_pack
2323
if "pack_ok" in product._fields and self.check_for_product_pack_parent(product):
@@ -47,8 +47,8 @@ def check_for_product_pack_parent(self, product):
4747

4848
def _get_product_price(self, product, *args, **kwargs):
4949
res = super(ProductPricelist, self.with_context(is_recursive=True))._get_product_price(product, *args, **kwargs)
50-
if self._context.get("taxes_included") and not self._context.get("is_recursive"):
51-
company_id = self._context.get("company_id") or self.env.company.id
50+
if self.env.context.get("taxes_included") and not self.env.context.get("is_recursive"):
51+
company_id = self.env.context.get("company_id") or self.env.company.id
5252
res = product.taxes_id.filtered(lambda x: x.company_id.id == company_id).compute_all(res, product=product)[
5353
"total_included"
5454
]

product_price_taxes_included/models/product_product.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class ProductProduct(models.Model):
1818
@api.depends_context("company", "company_id")
1919
def _compute_taxed_lst_price(self):
2020
"""if taxes_included lst_price already has taxes included"""
21-
company_id = self._context.get("company_id", self.env.company.id)
21+
company_id = self.env.context.get("company_id", self.env.company.id)
2222
for product in self:
2323
product.taxed_lst_price = (
2424
product.taxes_id.filtered(lambda x: x.company_id.id == company_id)

product_price_taxes_included/models/product_template.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def _compute_taxed_lst_price(self):
2424
"""compute it from list_price and not for lst_price for performance
2525
(avoid using dummy related field)
2626
"""
27-
company_id = self._context.get("company_id", self.env.company.id)
27+
company_id = self.env.context.get("company_id", self.env.company.id)
2828
for product in self:
2929
product.taxed_lst_price = product.taxes_id.filtered(lambda x: x.company_id.id == company_id).compute_all(
3030
product.list_price, self.env.company.currency_id, product=product

product_price_taxes_included/security/product_price_taxes_included_security.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<odoo noupdate="1">
33

44
<record model="res.groups" id="group_prices_with_tax">
5-
<field name="category_id" ref="base.module_category_hidden"/>
65
<field name="name">Products: see the price with tax</field>
76
</record>
87

0 commit comments

Comments
 (0)