From f57c95496a15f6d4dcb301075bc89ff38bd1ac2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E5=B0=A7?= Date: Wed, 27 Nov 2024 11:06:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jikimo_sale_multiple_supply_methods/__init__.py | 4 ---- sf_manufacturing/__manifest__.py | 2 +- sf_manufacturing/migrations/1.1/post-migrate.py | 12 ++++++++++++ 3 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 sf_manufacturing/migrations/1.1/post-migrate.py diff --git a/jikimo_sale_multiple_supply_methods/__init__.py b/jikimo_sale_multiple_supply_methods/__init__.py index 74eea1d2..b02eeb6f 100644 --- a/jikimo_sale_multiple_supply_methods/__init__.py +++ b/jikimo_sale_multiple_supply_methods/__init__.py @@ -12,10 +12,6 @@ def _data_install(cr, registry): env.ref('jikimo_sale_multiple_supply_methods.product_template_default').product_variant_id.write({'active': False, 'is_bfm': True}) env.ref('jikimo_sale_multiple_supply_methods.product_template_embryo_customer_provided').product_variant_id.write({'active': False}) env.ref('jikimo_sale_multiple_supply_methods.product_template_outsourcing').product_variant_id.write({'active': False, 'is_bfm': True}) - env.ref('sf_dlm.product_embryo_sf_self_machining').product_tmpl_id.write({'categ_type': '坯料'}) - env.ref('sf_dlm.product_template_sf').product_tmpl_id.write({'categ_type': '成品'}) - env.ref('sf_dlm.product_embryo_sf_outsource').product_tmpl_id.write({'categ_type': '坯料'}) - env.ref('sf_dlm.product_embryo_sf_purchase').product_tmpl_id.write({'categ_type': '坯料'}) # 为三步制造增加规则 warehouse = env['stock.warehouse'].search([('company_id', '=', env.company.id)], limit=1) diff --git a/sf_manufacturing/__manifest__.py b/sf_manufacturing/__manifest__.py index 2bde02d9..35620913 100644 --- a/sf_manufacturing/__manifest__.py +++ b/sf_manufacturing/__manifest__.py @@ -2,7 +2,7 @@ # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': '机企猫智能工厂 制造管理', - 'version': '1.0', + 'version': '1.1', 'summary': '智能工厂制造模块', 'sequence': 1, 'description': """ diff --git a/sf_manufacturing/migrations/1.1/post-migrate.py b/sf_manufacturing/migrations/1.1/post-migrate.py new file mode 100644 index 00000000..0606049e --- /dev/null +++ b/sf_manufacturing/migrations/1.1/post-migrate.py @@ -0,0 +1,12 @@ +# migrations/1.1.0/post-migrate.py +from odoo import api, SUPERUSER_ID + +def migrate(cr, version): + # 获取环境 + env = api.Environment(cr, SUPERUSER_ID, {}) + + # 示例:添加新字段 + env.ref('sf_dlm.product_embryo_sf_self_machining').product_tmpl_id.write({'categ_type': '坯料'}) + env.ref('sf_dlm.product_template_sf').product_tmpl_id.write({'categ_type': '成品'}) + env.ref('sf_dlm.product_embryo_sf_outsource').product_tmpl_id.write({'categ_type': '坯料'}) + env.ref('sf_dlm.product_embryo_sf_purchase').product_tmpl_id.write({'categ_type': '坯料'}) \ No newline at end of file