Create 'Equipment' in 'sale.subscription
This commit is contained in:
parent
e197ecf527
commit
012985815c
14
subscription.py
Normal file
14
subscription.py
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
from trytond.pool import PoolMeta
|
||||||
|
from trytond.model import ModelSQL, ModelView, fields
|
||||||
|
|
||||||
|
class Subscription(metaclass=PoolMeta):
|
||||||
|
__name__ = 'sale.subscription'
|
||||||
|
|
||||||
|
equipments = fields.Many2Many('sale.subscription-optical.equipment', 'subscription', 'equipment', "Equipments")
|
||||||
|
|
||||||
|
class SubscriptionEquipment(ModelSQL):
|
||||||
|
'Optical Equipment - Subscription'
|
||||||
|
__name__ = 'sale.subscription-optical.equipment'
|
||||||
|
|
||||||
|
subscription = fields.Many2One('sale.subscription.line', 'Subscription Line', select=True)
|
||||||
|
equipment = fields.Many2One('optical.equipment', 'Equipment', select=True)
|
9
subscription.xml
Normal file
9
subscription.xml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<!--This file file is part of Tryton. The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms. -->
|
||||||
|
<tryton>
|
||||||
|
<record model="ir.ui.view" id="subscription_view_form">
|
||||||
|
<field name="model">sale.subscription</field>
|
||||||
|
<field name="inherit" ref="sale_subscription.subscription_view_form"/>
|
||||||
|
<field name="name">subscription_form</field>
|
||||||
|
</record>
|
||||||
|
</tryton>
|
10
view/subscription_form.xml
Normal file
10
view/subscription_form.xml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<!--This file 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/notebook/page[@id='subscription']" position="after">
|
||||||
|
<page string="Equipments" id="equipments_subscription">
|
||||||
|
<field name="equipments" colspan="4"/>
|
||||||
|
</page>
|
||||||
|
</xpath>
|
||||||
|
</data>
|
Loading…
Reference in New Issue
Block a user