Skip to content

Commit 105686d

Browse files
jcadhocmav-adhoc
authored andcommitted
[ADD]purchase_ux: Add product template excel file and model changes
closes #322 Signed-off-by: Matias Velazquez <mav@adhoc.com.ar>
1 parent 4109f5f commit 105686d

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

purchase_ux/models/product_template.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# For copyright and license notices, see __manifest__.py file in module root
33
# directory
44
##############################################################################
5-
from odoo import fields, models
5+
from odoo import _, api, fields, models
66

77

88
class ProductTemplate(models.Model):
@@ -14,3 +14,15 @@ class ProductTemplate(models.Model):
1414
related="seller_ids.partner_id",
1515
store=True,
1616
)
17+
18+
@api.model
19+
def get_import_templates(self):
20+
res = super().get_import_templates()
21+
if self.env.context.get("purchase_product_template"):
22+
return [
23+
{
24+
"label": _("Import Template for Products"),
25+
"template": "/purchase_ux/static/xls/product_template.xlsx",
26+
}
27+
]
28+
return res
13.8 KB
Binary file not shown.

0 commit comments

Comments
 (0)