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