From c91c1029e55411d1b66a6fff55a38c99d734dea3 Mon Sep 17 00:00:00 2001 From: ivan deng Date: Sun, 5 Nov 2017 20:50:38 +0800 Subject: [PATCH] add product sequence --- .../models/app_theme_config_settings.py | 36 +++++ .../static/description/index.html | 8 +- .../views/app_theme_config_settings_view.xml | 6 + app_product_sequence/__init__.py | 18 +++ app_product_sequence/__openerp__.py | 60 ++++++++ app_product_sequence/controllers/__init__.py | 1 + app_product_sequence/controllers/main.py | 1 + .../data/product_sequence.xml | 59 ++++++++ app_product_sequence/hooks.py | 34 +++++ app_product_sequence/i18n/en_GB.po | 20 +++ app_product_sequence/i18n/zh_CN.po | 131 ++++++++++++++++++ app_product_sequence/models/__init__.py | 4 + .../models/product_internal_type.py | 36 +++++ .../models/product_product.py | 83 +++++++++++ .../models/product_template.py | 60 ++++++++ .../static/description/icon.png | Bin 0 -> 90598 bytes .../static/description/index.html | 98 +++++++++++++ .../static/description/set1.jpg | Bin 0 -> 155038 bytes .../static/description/set2.jpg | Bin 0 -> 158311 bytes app_product_sequence/tests/__init__.py | 15 ++ .../tests/test_product_sequence.py | 59 ++++++++ .../views/product_internal_type_view.xml | 30 ++++ .../views/product_product_view.xml | 16 +++ .../views/product_template_view.xml | 27 ++++ 24 files changed, 801 insertions(+), 1 deletion(-) create mode 100644 app_product_sequence/__init__.py create mode 100644 app_product_sequence/__openerp__.py create mode 100644 app_product_sequence/controllers/__init__.py create mode 100644 app_product_sequence/controllers/main.py create mode 100644 app_product_sequence/data/product_sequence.xml create mode 100644 app_product_sequence/hooks.py create mode 100644 app_product_sequence/i18n/en_GB.po create mode 100644 app_product_sequence/i18n/zh_CN.po create mode 100644 app_product_sequence/models/__init__.py create mode 100644 app_product_sequence/models/product_internal_type.py create mode 100644 app_product_sequence/models/product_product.py create mode 100644 app_product_sequence/models/product_template.py create mode 100644 app_product_sequence/static/description/icon.png create mode 100644 app_product_sequence/static/description/index.html create mode 100644 app_product_sequence/static/description/set1.jpg create mode 100644 app_product_sequence/static/description/set2.jpg create mode 100644 app_product_sequence/tests/__init__.py create mode 100644 app_product_sequence/tests/test_product_sequence.py create mode 100644 app_product_sequence/views/product_internal_type_view.xml create mode 100644 app_product_sequence/views/product_product_view.xml create mode 100644 app_product_sequence/views/product_template_view.xml diff --git a/app_odoo_customize/models/app_theme_config_settings.py b/app_odoo_customize/models/app_theme_config_settings.py index 2af01395..403ea727 100644 --- a/app_odoo_customize/models/app_theme_config_settings.py +++ b/app_odoo_customize/models/app_theme_config_settings.py @@ -114,6 +114,40 @@ class AppThemeConfigSettings(models.TransientModel): raise Warning(e) return True + def remove_product(self): + to_removes = [ + # 清除产品数据 + ['product.product', ], + ['product.template', ], + ] + try: + for line in to_removes : + obj_name = line[0] + obj = self.pool.get(obj_name) + if obj and obj._table_exist: + sql = "delete from %s" % obj._table + self._cr.execute( sql) + except Exception, e: + raise Warning(e) + return True + + def remove_product_attribute(self): + to_removes = [ + # 清除产品属性 + ['product.attribute.value', ], + ['product.attribute', ], + ] + try: + for line in to_removes : + obj_name = line[0] + obj = self.pool.get(obj_name) + if obj and obj._table_exist: + sql = "delete from %s" % obj._table + self._cr.execute( sql) + except Exception, e: + raise Warning(e) + return True + @api.multi def remove_pos(self): to_removes = [ @@ -154,6 +188,8 @@ class AppThemeConfigSettings(models.TransientModel): def remove_mrp(self): to_removes = [ # 清除生产单据 + ['mrp.workcenter.productivity', ], + ['mrp.workorder', ], ['mrp.production.workcenter.line', ], ['mrp.production', ], ['mrp.production.product.line', ], diff --git a/app_odoo_customize/static/description/index.html b/app_odoo_customize/static/description/index.html index 91ecda62..2ed27b35 100644 --- a/app_odoo_customize/static/description/index.html +++ b/app_odoo_customize/static/description/index.html @@ -103,12 +103,18 @@ class="btn btn-warning btn-lg" rel="nofollow" href="mailto:guohuadeng@hotmail.com"> guohuadeng@hotmail.com +

+ Via QQ: 300883

+ + 300883@qq.com

Visit our website for more support.

http://www.sunpop.cn
diff --git a/app_odoo_customize/views/app_theme_config_settings_view.xml b/app_odoo_customize/views/app_theme_config_settings_view.xml index 0ea22abc..70eb5511 100644 --- a/app_odoo_customize/views/app_theme_config_settings_view.xml +++ b/app_odoo_customize/views/app_theme_config_settings_view.xml @@ -89,6 +89,12 @@