summaryrefslogtreecommitdiff
path: root/addons/product/models
diff options
context:
space:
mode:
authorJigar Patel <jat@openerp.com>2018-07-17 18:49:05 +0530
committerxmo-odoo <xmo@odoo.com>2018-07-17 15:19:05 +0200
commitb60de0db41bbe4af3c2f6e2369eda5d483702d76 (patch)
tree5b41a3654948efb6f758d63f7676f3a040d2d7d2 /addons/product/models
parent57676dc7d10b50bee44d122d48863586b18e4593 (diff)
[IMP] import/export UIs
Task 40692 Various changes to import/export (mainly) UIs: * default to excel & "full" (non-import-compatible) export * auto-detect encoding of CSV using chardet * remember column -> field mapping after having imported a file (useful for repeated imports where auto-matching failed) * better handle localised booleans & column names * automatically select source list view's fields when exporting * better integrate import templates feature and add a number of templates
Diffstat (limited to 'addons/product/models')
-rw-r--r--addons/product/models/product.py7
-rw-r--r--addons/product/models/product_pricelist.py8
-rw-r--r--addons/product/models/product_template.py7
3 files changed, 21 insertions, 1 deletions
diff --git a/addons/product/models/product.py b/addons/product/models/product.py
index 51b450cba2b..17d6f29c9b1 100644
--- a/addons/product/models/product.py
+++ b/addons/product/models/product.py
@@ -630,3 +630,10 @@ class SupplierInfo(models.Model):
delay = fields.Integer(
'Delivery Lead Time', default=1, required=True,
help="Lead time in days between the confirmation of the purchase order and the receipt of the products in your warehouse. Used by the scheduler for automatic computation of the purchase order planning.")
+
+ @api.model
+ def get_import_templates(self):
+ return [{
+ 'label': _('Import Template for Vendor Pricelists'),
+ 'template': '/product/static/xls/product_supplierinfo.xls'
+ }]
diff --git a/addons/product/models/product_pricelist.py b/addons/product/models/product_pricelist.py
index 4f14d6394bb..42ceee46dfb 100644
--- a/addons/product/models/product_pricelist.py
+++ b/addons/product/models/product_pricelist.py
@@ -333,6 +333,13 @@ class Pricelist(models.Model):
return pl
+ @api.model
+ def get_import_templates(self):
+ return [{
+ 'label': _('Import Template for Pricelists'),
+ 'template': '/product/static/xls/product_pricelist.xls'
+ }]
+
class ResCountryGroup(models.Model):
_inherit = 'res.country.group'
@@ -470,4 +477,3 @@ class PricelistItem(models.Model):
'price_min_margin': 0.0,
'price_max_margin': 0.0,
})
-
diff --git a/addons/product/models/product_template.py b/addons/product/models/product_template.py
index 9629a1f111e..9d13d1ba228 100644
--- a/addons/product/models/product_template.py
+++ b/addons/product/models/product_template.py
@@ -483,3 +483,10 @@ class ProductTemplate(models.Model):
empty_list_help_document_name=_("product"),
)
return super(ProductTemplate, self).get_empty_list_help(help)
+
+ @api.model
+ def get_import_templates(self):
+ return [{
+ 'label': _('Import Template for Products'),
+ 'template': '/product/static/xls/product_template.xls'
+ }]