Skip to content

Commit

Permalink
[MIG] shopinvader_customer_price: Migration to 14.0
Browse files Browse the repository at this point in the history
  • Loading branch information
chafique-delli authored and Pierrick Brun committed Jul 16, 2021
1 parent a7fbb76 commit 774a719
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
2 changes: 1 addition & 1 deletion shopinvader_customer_price/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"name": "Shopinvader Customer Price",
"summary": """Expose customer's specific prices.""",
"version": "13.0.1.0.1",
"version": "14.0.1.0.0",
"license": "AGPL-3",
"author": "Camptocamp,Odoo Community Association (OCA)",
"website": "https://github.com/shopinvader/odoo-shopinvader",
Expand Down
19 changes: 4 additions & 15 deletions shopinvader_customer_price/models/shopinvader_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,10 @@ def _get_partner_pricelist(self, partner):
pricelist = partner.property_product_pricelist
return pricelist

@tools.ormcache("partner.id", "self.company_id.id")
def _get_fiscal_position_id(self, partner):
fp_model = self.env["account.fiscal.position"].with_context(
force_company=self.company_id.id
)
fpos_id = fp_model.get_fiscal_position(
def _get_fiscal_position(self, partner):
fp_model = self.env["account.fiscal.position"].with_company(self.company_id.id)
fpos = fp_model.get_fiscal_position(
partner.id,
delivery_id=partner.id,
)
return fpos_id

def _get_fiscal_position(self, partner):
fpos_id = self._get_fiscal_position_id(partner)
return (
self.env["account.fiscal.position"].browse(fpos_id)
if fpos_id
else self.env["account.fiscal.position"].browse()
)
return fpos

0 comments on commit 774a719

Please sign in to comment.