class Template:
    __name__ = 'product.template'

    packagings = fields.One2Many('product.uom-packaging.type', 
'template','Packaging')


class TemplatePackageType(ModelSQL, ModelView,):
    'Prouct Packaging Type'
    __name__ = 'product.uom-packaging.type'

    template = fields.Many2One('product.template', 'Template', 
required=True,
        select=True, ondelete='CASCADE')
    barcode = fields.Char('Label/Barcode', help="Barcode label or indicator 
of the pack")
    pack_uom = fields.Many2One('product.uom', 'Pack Uom', 
                               domain=[
                                       ('category', '=', 
Eval('default_uom_category')),
                                       ])
    default_uom_category = fields.Function(
        fields.Many2One('product.uom.category', 'Default UOM Category'),
        'on_change_with_default_uom_category',
        searcher='search_default_uom_category')

-----------------------------------------------------------------------------------------------------------------------
When I am going to create "product.uom-packaging.type". 
May I know how the "pack_uom" able to do the domain of the 
"default_uom_category" from the "product.template"?


Best regard,
Markus bala

Reply via email to