0

在将 Odoo V12 升级到 V13 时出现此错误,我该如何修复它以及为什么会出现此错误。?我已从所有自定义模块中删除 @api_multi 并运行它。当我累了运行它。它给了我 Odoo 服务器错误回溯(最近一次通话最后):

这是我的xml代码:

 <?xml version="1.0" encoding="utf-8"?>
    <odoo>
        <data>
            <record id="sh_res_config_setting_form_view" model="ir.ui.view">
                <field name="name">sh.res.config.setting.form.view</field>
                <field name="model">res.config.settings</field>
                <field name="inherit_id" ref="base_setup.res_config_settings_view_form"/>
                <field name="arch" type="xml">
                    <xpath expr="//div[@data-key='general_settings']//div[@id='business_documents']" position="before">
                            <div>
                                <h2>Product Internal Reference Generator Feature</h2>
                                <div class="row mt16 o_settings_container">
                                    <div class="col-12 col-lg-6 o_setting_box">
                                        <div class="o_setting_right_pane">
                                            <div class="content-group">
                                                <div class="mt16 row">
                                                    <label for="sh_product_int_ref_generator" string="Product Internal Reference Generator Feature" class="col-3 col-lg-3 o_light_label"/>
                                                    <field name="sh_product_int_ref_generator"/>
                                                </div>
                                                <div class="mt16 row" attrs="{'invisible':[('sh_product_int_ref_generator','=',False)]}">
                                                    <label for="sh_new_product_int_ref_generator" string="Auto Generate Internal Reference For New Products" class="col-3 col-lg-3 o_light_label"/>
                                                    <field name="sh_new_product_int_ref_generator"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-12 col-lg-6 o_setting_box">
                                       <div class="o_setting_right_pane">
                                           <div class="content-group">
                                               <div class="mt16 row">
                                                   <button name="action_generate_int_ref" string="Generate Internal Reference for All Product" type="object" class="oe_highlight" attrs="{'invisible':[('sh_product_int_ref_generator','=',False)]}"/>
                                               </div>
                                               <div class="mt16 row" attrs="{'invisible':[('sh_product_int_ref_generator','=',False)]}">
                                                    <label for="sh_product_sequence_separate" string="Product Sequence Separate" class="col-3 col-lg-3 o_light_label"/>
                                                    <field name="sh_product_sequence_separate"/>
                                                </div>
                                           </div>
                                       </div>
                                   </div>
                                </div>
                            </div>
                            <div>
                                <div class="row mt16 o_settings_container">
                                    <div class="col-12 col-lg-6 o_setting_box">
                                        <div class="o_setting_right_pane">
                                            <span class="o_form_label" attrs="{'invisible':[('sh_product_int_ref_generator','=',False)]}">Product Name Config</span>
                                            <div class="content-group">
                                                <div class="mt16 row" attrs="{'invisible':[('sh_product_int_ref_generator','=',False)]}">
                                                    <label for="sh_product_name_config" string="Product Name Config" class="col-3 col-lg-3 o_light_label"/>
                                                    <field name="sh_product_name_config"/>
                                                </div>
                                                <div class="mt16 row" attrs="{'invisible':['|',('sh_product_name_config','=',False),('sh_product_int_ref_generator','=',False)]}">
                                                    <label for="sh_product_name_digit" string="Product Name Digit" class="col-3 col-lg-3 o_light_label"/>
                                                    <field name="sh_product_name_digit"/>
                                                </div>
                                                <div class="mt16 row" attrs="{'invisible':['|',('sh_product_name_config','=',False),('sh_product_int_ref_generator','=',False)]}">
                                                    <label for="sh_product_name_separate" string="Product Name Separate" class="col-3 col-lg-3 o_light_label"/>
                                                    <field name="sh_product_name_separate"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-12 col-lg-6 o_setting_box">
                                        <div class="o_setting_right_pane">
                                            <span class="o_form_label" attrs="{'invisible':[('sh_product_int_ref_generator','=',False)]}">Product Attribute Config</span>
                                            <div class="content-group">
                                                <div class="mt16 row" attrs="{'invisible':[('sh_product_int_ref_generator','=',False)]}">
                                                    <label for="sh_product_attribute_config" string="Product Attribute Config" class="col-3 col-lg-3 o_light_label"/>
                                                    <field name="sh_product_attribute_config"/>
                                                </div>
                                                <div class="mt16 row" attrs="{'invisible':['|',('sh_product_attribute_config','=',False),('sh_product_int_ref_generator','=',False)]}">
                                                    <label for="sh_product_attribute_name_digit" string="Product Attribute Name Digit" class="col-3 col-lg-3 o_light_label"/>
                                                    <field name="sh_product_attribute_name_digit"/>
                                                </div>
                                                <div class="mt16 row" attrs="{'invisible':['|',('sh_product_attribute_config','=',False),('sh_product_int_ref_generator','=',False)]}">
                                                    <label for="sh_product_attribute_name_separate" string="Product Attribute Name Separate" class="col-3 col-lg-3 o_light_label"/>
                                                    <field name="sh_product_attribute_name_separate"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div>
                                <div class="row mt16 o_settings_container">
                                    <div class="col-12 col-lg-6 o_setting_box">
                                        <div class="o_setting_right_pane">
                                            <span class="o_form_label" attrs="{'invisible':[('sh_product_int_ref_generator','=',False)]}">Product Category Config</span>
                                            <div class="content-group">
                                                <div class="mt16 row" attrs="{'invisible':[('sh_product_int_ref_generator','=',False)]}">
                                                    <label for="sh_product_cataegory_config" string="Product Category Config" class="col-3 col-lg-3 o_light_label"/>
                                                    <field name="sh_product_cataegory_config"/>
                                                </div>
                                                <div class="mt16 row" attrs="{'invisible':['|',('sh_product_cataegory_config','=',False),('sh_product_int_ref_generator','=',False)]}">
                                                    <label for="sh_product_category_digit" string="Product Category Digit" class="col-3 col-lg-3 o_light_label"/>
                                                    <field name="sh_product_category_digit"/>
                                                </div>
                                                <div class="mt16 row" attrs="{'invisible':['|',('sh_product_cataegory_config','=',False),('sh_product_int_ref_generator','=',False)]}">
                                                    <label for="sh_product_catagory_separate" string="Product Category Separate" class="col-3 col-lg-3 o_light_label"/>
                                                    <field name="sh_product_catagory_separate"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-12 col-lg-6 o_setting_box">
                                        <div class="o_setting_right_pane">
                                            <span class="o_form_label" attrs="{'invisible':[('sh_product_int_ref_generator','=',False)]}">Product Sequence Config</span>
                                            <div class="content-group">
                                                <div class="mt16 row" attrs="{'invisible':[('sh_product_int_ref_generator','=',False)]}">
                                                    <label for="sh_product_sequence_config" string="Product Sequence Config" class="col-3 col-lg-3 o_light_label"/>
                                                    <field name="sh_product_sequence_config"/>
                                                </div>
                                                <div class="mt16 row" attrs="{'invisible':['|',('sh_product_sequence_config','=',False),('sh_product_int_ref_generator','=',False)]}">
                                                    <label for="sh_product_sequence" string="Product Sequence" class="col-3 col-lg-3 o_light_label"/>
                                                    <field name="sh_product_sequence"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                    </xpath>
                </field>
            </record>
        </data>
    </odoo>

这是我的 .py 文件代码:

from odoo import models, fields, api, _


 class ShResCompany(models.Model):
        _inherit = 'res.company'

        sh_product_int_ref_generator = fields.Boolean(string="Product Internal Reference Generator Feature")
        sh_product_name_config = fields.Boolean(string="Product Name Config")
        sh_product_name_digit = fields.Char(string="Product Name Digit", default="1")
        sh_product_name_separate = fields.Char(string="Product Name Separate")
        sh_product_attribute_config = fields.Boolean(string="Product Attribute Config")
        sh_product_attribute_name_digit = fields.Char(string="Product Attribute Name Digit", default="1")
        sh_product_attribute_name_separate = fields.Char(string="Product Attribute Name Separate")
        sh_product_cataegory_config = fields.Boolean(string="Product Category Config")
        sh_product_category_digit = fields.Char(string="Product Category Digit", default="1")
        sh_product_catagory_separate = fields.Char(string="Product Category Separate")
        sh_product_sequence_config = fields.Boolean(string="Product Sequence Config")
        sh_product_sequence = fields.Many2one('ir.sequence', string="Product Sequence")
        sh_product_sequence_separate = fields.Char(string="Product Sequence Separate")
        sh_new_product_int_ref_generator = fields.Boolean(string="Auto Generate Internal Reference For New Products")


class ShResConfigSettings(models.TransientModel):
            _inherit = 'res.config.settings'

            sh_product_int_ref_generator = fields.Boolean(string="Product Internal Reference Generator Feature", related="company_id.sh_product_int_ref_generator", readonly=False)
            sh_product_name_config = fields.Boolean(string="Product Name Config", related="company_id.sh_product_name_config", readonly=False)
            sh_product_name_digit = fields.Char(string="Product Name Digit", default="1", related="company_id.sh_product_name_digit", readonly=False)
            sh_product_name_separate = fields.Char(string="Product Name Separate", related="company_id.sh_product_name_separate", readonly=False)
            sh_product_attribute_config = fields.Boolean(string="Product Attribute Config", related="company_id.sh_product_attribute_config", readonly=False)
            sh_product_attribute_name_digit = fields.Char(string="Product Attribute Name Digit", default="1", related="company_id.sh_product_attribute_name_digit", readonly=False)
            sh_product_attribute_name_separate = fields.Char(string="Product Attribute Name Separate", related="company_id.sh_product_attribute_name_separate", readonly=False)
            sh_product_cataegory_config = fields.Boolean(string="Product Category Config", related="company_id.sh_product_cataegory_config", readonly=False)
            sh_product_category_digit = fields.Char(string="Product Category Digit", default="1", related="company_id.sh_product_category_digit", readonly=False)
            sh_product_catagory_separate = fields.Char(string="Product Category Separate", related="company_id.sh_product_catagory_separate", readonly=False)
            sh_product_sequence_config = fields.Boolean(string="Product Sequence Config", related="company_id.sh_product_sequence_config", readonly=False)
            sh_product_sequence = fields.Many2one('ir.sequence', string="Product Sequence", related="company_id.sh_product_sequence", readonly=False)
            sh_product_sequence_separate = fields.Char(string="Product Sequence Separate", related="company_id.sh_product_sequence_separate", readonly=False)
            sh_new_product_int_ref_generator = fields.Boolean(string="Auto Generate Internal Reference For New Products", related="company_id.sh_new_product_int_ref_generator", readonly=False)

            def action_generate_int_ref(self):
                return {
                    'name':'Generate Internal Reference',
                    'type':'ir.actions.act_window',
                    'binding_view_types':'form',
                    'view_mode':'form',
                    'res_model':'internal.reference.wizard',
                    'target':'new',
                    }
4

0 回答 0