Skip to content

Commit

Permalink
Merge PR #1001 into 14.0
Browse files Browse the repository at this point in the history
Signed-off-by simahawk
  • Loading branch information
OCA-git-bot committed Dec 5, 2024
2 parents 1b34f3b + fe5ca17 commit e1df7cf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions product_import/tests/test_product_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"price": 12.55,
"product_code": "MNTR011",
"uom": {"unece_code": False},
"sale_delay": 3,
},
{
# Archived product
Expand All @@ -45,6 +46,7 @@
"product_code": "MNTR012",
"uom": {"unece_code": "C62"},
"active": False,
"sale_delay": 1,
},
],
"ref": "1387",
Expand Down Expand Up @@ -136,6 +138,9 @@ def test_product_import(self):
self.assertEqual(p_values, expected)
self.assertEqual(pt_values, expected)
self.assertEqual(product.seller_ids, product_tmpl.seller_ids)
self.assertEqual(
product.seller_ids.mapped("delay")[0], parsed.get("sale_delay", 0)
),

def test_import_button(self):
form = self.wiz_form
Expand Down
2 changes: 2 additions & 0 deletions product_import/wizard/product_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ def _prepare_supplierinfo(self, seller_info, product):
and s_info.price == seller_info["price"]
and s_info.currency_id.id == seller_info["currency_id"]
and s_info.company_id.id == seller_info["company_id"]
and s_info.delay == seller_info["delay"]
):
seller_id = s_info.id
else:
Expand Down Expand Up @@ -187,6 +188,7 @@ def _prepare_product(self, parsed_product, chatter_msg, seller=None):
"currency_id": currency.id,
"min_qty": parsed_product["min_qty"],
"company_id": product_company_id,
"delay": parsed_product.get("sale_delay", 0),
}
product_vals["seller_ids"] = self._prepare_supplierinfo(seller_info, product)
if product:
Expand Down
3 changes: 3 additions & 0 deletions product_import_ubl/wizard/product_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ def parse_ubl_catalogue_line(self, line, ns):
"price": float(ele_price.text or 0),
"currency": {"iso": currency} if currency else False,
"min_qty": min_qty,
"sale_delay": xline.text(
"cac:RequiredItemLocationQuantity/cbc:LeadTimeMeasure"
),
}
)
return product_vals
Expand Down

0 comments on commit e1df7cf

Please sign in to comment.