Add Function fields on Product from Template
issue5087 review23611002
This commit is contained in:
@@ -50,10 +50,3 @@ class Product:
|
||||
& ~Eval('_parent_template', {}).get('attribute_set')),
|
||||
},
|
||||
depends=['attribute_set'])
|
||||
attribute_set = fields.Function(fields.Many2One('product.attribute.set',
|
||||
'Set'), 'on_change_with_attribute_set')
|
||||
|
||||
@fields.depends('template')
|
||||
def on_change_with_attribute_set(self, name=None):
|
||||
if self.template and getattr(self.template, 'attribute_set', None):
|
||||
return self.template.attribute_set.id
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
this repository contains the full copyright notices and license terms. -->
|
||||
<data>
|
||||
<xpath
|
||||
expr="/form/separator[@name='description']"
|
||||
position="before">
|
||||
<field name="attributes" colspan="6"/>
|
||||
<xpath expr="/form/notebook" position="inside">
|
||||
<page name="attributes">
|
||||
<field name="attributes" colspan="4"/>
|
||||
</page>
|
||||
</xpath>
|
||||
</data>
|
||||
|
||||
Reference in New Issue
Block a user