Create 'Equipment' in 'sale.subscription

This commit is contained in:
sinergia 2022-06-19 22:36:16 -05:00
parent 56b3d0db32
commit e197ecf527
6 changed files with 21 additions and 5 deletions

View File

@ -1,5 +1,5 @@
from trytond.pool import Pool from trytond.pool import Pool
from . import party, product, purchase, sale, equipment from . import party, product, purchase, sale, equipment, subscription
def register(): def register():
Pool.register( Pool.register(
@ -10,4 +10,6 @@ def register():
purchase.Line, purchase.Line,
sale.SaleLine, sale.SaleLine,
equipment.OpticalEquipment, equipment.OpticalEquipment,
subscription.Subscription,
subscription.SubscriptionEquipment,
module='optical_equipment', type_='model') module='optical_equipment', type_='model')

View File

@ -8,6 +8,7 @@ class OpticalEquipment(ModelSQL, ModelView):
company = fields.Many2One('company.company', "Company") company = fields.Many2One('company.company', "Company")
location = fields.Many2One('stock.location', "Location") location = fields.Many2One('stock.location', "Location")
party = fields.Many2One('party.party', "Party") party = fields.Many2One('party.party', "Party")
#equipment_party = fields.Many2Many('optical.equipment-party.party', 'party', 'equipment', "Equipments")
party_address = fields.Many2One('party.address', "Party Address") party_address = fields.Many2One('party.address', "Party Address")
#origin = fields.reference("Origin", selection='get_origin', select=True) #origin = fields.reference("Origin", selection='get_origin', select=True)
product = fields.Many2One('product.product', "Product") product = fields.Many2One('product.product', "Product")
@ -31,3 +32,12 @@ class OpticalEquipment(ModelSQL, ModelView):
@staticmethod @staticmethod
def get_origin(): def get_origin():
return None return None
"""
class OpticalEquipmentParty(ModelSQL):
'Optical Equipment - Party'
__name__ = 'optical.equipment-party.party'
_table = 'optical_equipment_party_party'
party = fields.Many2One('party.party', 'Party', select=True)
equipment = fields.Many2One('optical.equipment', 'Equipment', select=True)
"""

View File

@ -2,6 +2,3 @@ from trytond.pool import PoolMeta
class Measurements(metaclass=PoolMeta): class Measurements(metaclass=PoolMeta):
__name__ = 'product.measurements' __name__ = 'product.measurements'

View File

@ -1,5 +1,6 @@
from trytond.pool import PoolMeta from trytond.pool import PoolMeta
from trytond.model import ModelSQL, ModelView, fields from trytond.model import ModelSQL, ModelView, fields
from . import equipment
_CLIENT_TYPE = [('ips', 'IPS'), _CLIENT_TYPE = [('ips', 'IPS'),
('optica', 'Optica')] ('optica', 'Optica')]

View File

@ -9,6 +9,7 @@ depends:
sale sale
stock stock
country country
sale_subscription
xml: xml:
party.xml party.xml
product.xml product.xml
@ -16,3 +17,4 @@ xml:
sale.xml sale.xml
purchase.xml purchase.xml
uom.xml uom.xml
subscription.xml

View File

@ -6,4 +6,8 @@ this repository contains the full copyright notices and license terms. -->
<label name="client_type"/> <label name="client_type"/>
<field name="client_type"/> <field name="client_type"/>
</xpath> </xpath>
<xpath expr="/form/notebook/page[@id='general']" position="after">
<page string="Equipments Party" id="equipments_party">
</page>
</xpath>
</data> </data>