Skip to content

Commit

Permalink
Merge PR #571 into 15.0
Browse files Browse the repository at this point in the history
Signed-off-by AaronHForgeFlow
  • Loading branch information
OCA-git-bot committed Oct 10, 2023
2 parents 4ef6053 + ff160dc commit 6cb20dc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions product_analytic/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def _onchange_product_id(self):
res = super()._onchange_product_id()
for line in self:
inv_type = line.move_id.move_type
if line.product_id and inv_type:
if line.product_id and inv_type and inv_type in INV_TYPE_MAP.keys():
ana_accounts = (
line.product_id.product_tmpl_id._get_product_analytic_accounts()
)
Expand All @@ -35,7 +35,8 @@ def create(self, vals_list):
inv_type = self.env["account.move"].browse([vals.get("move_id")]).move_type
if (
vals.get("product_id")
and inv_type != "entry"
and inv_type
and inv_type in INV_TYPE_MAP.keys()
and not vals.get("analytic_account_id")
):
product = self.env["product.product"].browse(vals.get("product_id"))
Expand Down

0 comments on commit 6cb20dc

Please sign in to comment.