Move product_template_attribute module to extra_depends. (#1)
Task #060498
This commit is contained in:
parent
46fd5a344d
commit
9852334153
|
@ -9,8 +9,6 @@ from . import product
|
|||
|
||||
def register():
|
||||
Pool.register(
|
||||
configuration.Configuration,
|
||||
configuration.ConfigurationProductESale,
|
||||
attachment.Attachment,
|
||||
menu.CatalogMenu,
|
||||
product.Template,
|
||||
|
@ -20,3 +18,8 @@ def register():
|
|||
product.ProductUpSell,
|
||||
product.ProductCrossSell,
|
||||
module='product_esale', type_='model')
|
||||
Pool.register(
|
||||
configuration.Configuration,
|
||||
configuration.ConfigurationProductESale,
|
||||
module='product_esale', type_='model',
|
||||
depends=['product_template_attribute'])
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<!-- This file is part product_esale module for Tryton.
|
||||
The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms. -->
|
||||
<tryton>
|
||||
<data>
|
||||
<data depends="product_template_attribute">
|
||||
<record model="ir.ui.view" id="product_configuration_view_form">
|
||||
<field name="model">product.configuration</field>
|
||||
<field name="inherit" ref="product.product_configuration_view_form"/>
|
||||
|
|
|
@ -99,7 +99,7 @@ class Template(metaclass=PoolMeta):
|
|||
'''Product Template Attribute'''
|
||||
Config = Pool().get('product.configuration')
|
||||
pconfig = Config(1)
|
||||
if pconfig.attribute_set:
|
||||
if hasattr(pconfig, 'attribute_set') and pconfig.attribute_set:
|
||||
return pconfig.attribute_set.id
|
||||
|
||||
@staticmethod
|
||||
|
@ -107,7 +107,7 @@ class Template(metaclass=PoolMeta):
|
|||
'''Default UOM'''
|
||||
Config = Pool().get('product.configuration')
|
||||
config = Config(1)
|
||||
if config.default_uom:
|
||||
if hasattr(config, 'default_uom') and config.default_uom:
|
||||
return config.default_uom.id
|
||||
|
||||
@fields.depends('name', 'esale_slug')
|
||||
|
@ -361,7 +361,8 @@ class Product(metaclass=PoolMeta):
|
|||
'''Product Attribute Options'''
|
||||
Config = Pool().get('product.configuration')
|
||||
pconfig = Config(1)
|
||||
if pconfig.attribute_set_options:
|
||||
if (hasattr(pconfig, 'attribute_set_options') and
|
||||
pconfig.attribute_set_options):
|
||||
return attribute2dict(pconfig.attribute_set_options)
|
||||
|
||||
@classmethod
|
||||
|
|
|
@ -166,4 +166,11 @@ The COPYRIGHT file at the top level of this repository contains the full copyrig
|
|||
<field name="name">esale_template_purchase_form</field>
|
||||
</record>
|
||||
</data>
|
||||
<data depends="product_template_attribute">
|
||||
<record model="ir.ui.view" id="esale_template_template_attributes">
|
||||
<field name="model">product.template</field>
|
||||
<field name="inherit" ref="esale_template_view_form"/>
|
||||
<field name="name">esale_template_template_attributes_form</field>
|
||||
</record>
|
||||
</data>
|
||||
</tryton>
|
||||
|
|
|
@ -4,13 +4,13 @@ depends:
|
|||
ir
|
||||
product_attachments
|
||||
product
|
||||
product_template_attribute
|
||||
product_variant_unique
|
||||
esale
|
||||
sale
|
||||
extras_depend:
|
||||
product_manufacturer
|
||||
product_review
|
||||
product_template_attribute
|
||||
xml:
|
||||
configuration.xml
|
||||
attachment.xml
|
||||
|
|
|
@ -78,8 +78,6 @@ The COPYRIGHT file at the top level of this repository contains the full copyrig
|
|||
<page string="Attributes" id="attributes">
|
||||
<label name="attribute_set"/>
|
||||
<field name="attribute_set"/>
|
||||
<newline/>
|
||||
<field name="template_attributes" colspan="6"/>
|
||||
</page>
|
||||
<page string="General" id="general">
|
||||
<label name="type"/>
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- This file is part product_esale module for Tryton.
|
||||
The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms. -->
|
||||
<data>
|
||||
<xpath expr="/form/notebook/page[@id='attributes']/field[@name='attribute_set']" position="before">
|
||||
<newline/>
|
||||
<field name="template_attributes" colspan="6"/>
|
||||
</xpath>
|
||||
</data>
|
Loading…
Reference in New Issue