mirror of
https://github.com/NaN-tic/trytond-product_purchase_sequence.git
synced 2023-12-14 04:02:54 +01:00
Product configuration simple class
This commit is contained in:
parent
b308bfa7c5
commit
b968e460f3
3 changed files with 10 additions and 25 deletions
|
@ -1,14 +1,13 @@
|
|||
#This file is part product_purchase_sequence module for Tryton.
|
||||
#The COPYRIGHT file at the top level of this repository contains
|
||||
#the full copyright notices and license terms.
|
||||
|
||||
from trytond.pool import Pool
|
||||
from .product import *
|
||||
from .configuration import *
|
||||
|
||||
|
||||
def register():
|
||||
Pool.register(
|
||||
ProductConfiguration,
|
||||
ProductConfigurationCompany,
|
||||
Configuration,
|
||||
Product,
|
||||
module='product_purchase_sequence', type_='model')
|
||||
|
|
|
@ -4,26 +4,14 @@
|
|||
from trytond.model import fields
|
||||
from trytond.pool import PoolMeta
|
||||
|
||||
__all__ = [
|
||||
'ProductConfiguration',
|
||||
'ProductConfigurationCompany',
|
||||
]
|
||||
__all__ = ['Configuration']
|
||||
__metaclass__ = PoolMeta
|
||||
|
||||
|
||||
class ProductConfiguration:
|
||||
'Product Configuration'
|
||||
class Configuration:
|
||||
__name__ = 'product.configuration'
|
||||
purchasable_sequence = fields.Function(fields.Many2One('ir.sequence', 'Purchasable Sequence',
|
||||
domain=[
|
||||
('code', '=', 'product.product'),
|
||||
], required=True),'get_fields', setter='set_fields')
|
||||
purchasable_sequence = fields.Property(fields.Many2One('ir.sequence',
|
||||
'Purchasable Sequence', domain=[
|
||||
('code', '=', 'product.product'),
|
||||
], required=True))
|
||||
|
||||
|
||||
class ProductConfigurationCompany:
|
||||
'Product Configuration Company'
|
||||
__name__ = 'product.configuration.company'
|
||||
purchasable_sequence = fields.Many2One('ir.sequence', 'Purchasable sequence',
|
||||
domain=[
|
||||
('code', '=', 'product.product'),
|
||||
], required=True)
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
<?xml version="1.0"?>
|
||||
<!-- This file is part product_configuration module for Tryton.
|
||||
<!-- This file is part product_purchase_sequence 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/field[@name='salable_sequence']"
|
||||
position="after">
|
||||
<xpath expr="/form" position="inside">
|
||||
<label name="purchasable_sequence"/>
|
||||
<field name="purchasable_sequence"/>
|
||||
</xpath>
|
||||
|
|
Loading…
Reference in a new issue