create view 'sale.create.subscription'
This commit is contained in:
parent
f14684b403
commit
d453653bfc
@ -11,12 +11,12 @@ def register():
|
||||
purchase.Purchase,
|
||||
purchase.Line,
|
||||
sale.SaleLine,
|
||||
sale.CreateSubscriptionStart,
|
||||
equipment.OpticalEquipment,
|
||||
configuration_equipment.Configuration,
|
||||
subscription.Subscription,
|
||||
subscription.SubscriptionEquipment,
|
||||
module='optical_equipment', type_='model')
|
||||
Pool.register(
|
||||
sale.CreateSubscriptionStart,
|
||||
sale.CreateSubscription,
|
||||
module='sale', type_='wizard')
|
||||
module='optical_equipment', type_='wizard')
|
||||
|
17
sale.py
17
sale.py
@ -2,13 +2,14 @@ from trytond.pool import Pool, PoolMeta
|
||||
from trytond.model import ModelView, ModelSQL, fields
|
||||
from trytond.pyson import Eval, Bool, If
|
||||
from trytond.transaction import Transaction
|
||||
|
||||
|
||||
from trytond.wizard import (
|
||||
Button, StateAction, StateTransition, StateView, Wizard)
|
||||
|
||||
|
||||
class CreateSubscriptionStart(ModelView):
|
||||
'Create Subscription Start'
|
||||
__name__ = 'sale.sale.subscription.start'
|
||||
__name__ = 'sale.create.subscription.start'
|
||||
|
||||
start_date = fields.Date("Start Date", required=True)
|
||||
end_date = fields.Date("End Date", required=True)
|
||||
@ -19,16 +20,14 @@ class CreateSubscriptionStart(ModelView):
|
||||
|
||||
class CreateSubscription(Wizard):
|
||||
'Create Subscription'
|
||||
__name__ = 'sale.sale.subscription'
|
||||
__name__ = 'sale.create.subscription'
|
||||
|
||||
start = StateView('sale.sale.subscription.start',
|
||||
'sale.create_subscription_view_form',[
|
||||
Button('Cancel', 'cancel', 'tryton-cancel'),
|
||||
start = StateView('sale.create.subscription.start',
|
||||
'optical_equipment.create_subscription_view_form',[
|
||||
Button('Cancel', 'end', 'tryton-cancel'),
|
||||
Button('Create', 'create', 'tryton-ok', default=True),
|
||||
])
|
||||
|
||||
|
||||
|
||||
class SaleLine(metaclass=PoolMeta):
|
||||
'SaleLine'
|
||||
__name__ = 'sale.line'
|
||||
@ -110,5 +109,3 @@ class SaleLine(metaclass=PoolMeta):
|
||||
('//page[@id="equipment"]', 'states', {
|
||||
'invisible': ~Eval('product_equipment', True),
|
||||
})]
|
||||
|
||||
|
||||
|
4
sale.xml
4
sale.xml
@ -7,13 +7,13 @@
|
||||
<field name="name">sale_line_form</field>
|
||||
</record>
|
||||
<record model="ir.ui.view" id="create_subscription_view_form">
|
||||
<field name="model">sale.sale.subscription.start</field>
|
||||
<field name="model">sale.create.subscription.start</field>
|
||||
<field name="type">form</field>
|
||||
<field name="name">create_subscription_form</field>
|
||||
</record>
|
||||
<record model="ir.action.wizard" id="create_subscription">
|
||||
<field name="name">Subscription</field>
|
||||
<field name="wiz_name">sale.sale.subscription</field>
|
||||
<field name="wiz_name">sale.create.subscription</field>
|
||||
<field name="model">sale.sale</field>
|
||||
</record>
|
||||
<record model="ir.action.keyword" id="create_subscription_keyword">
|
||||
|
@ -4,6 +4,7 @@ from trytond.model import (
|
||||
from trytond.modules.company.model import set_employee
|
||||
from trytond.exceptions import UserError
|
||||
|
||||
|
||||
class Subscription(metaclass=PoolMeta):
|
||||
__name__ = 'sale.subscription'
|
||||
|
||||
@ -28,7 +29,7 @@ class SubscriptionEquipment(ModelSQL):
|
||||
subscription = fields.Many2One('sale.subscription', 'Subscription', select=True)
|
||||
equipment = fields.Many2One('optical_equipment.equipment', 'Equipment', select=True)
|
||||
|
||||
|
||||
|
||||
class Line(metaclass=PoolMeta):
|
||||
__name__ = 'sale.subscriptioin.line'
|
||||
|
||||
|
@ -9,6 +9,8 @@ this repository contains the full copyright notices and license terms. -->
|
||||
id="create_subscription" colspan="2"
|
||||
yalign="0.0" xalign="0.0" xexpand="1"/>
|
||||
<label name="start_date"/>
|
||||
<field name="start_date"/>
|
||||
<label name="end_date"/>
|
||||
<field name="end_date"/>
|
||||
<label name="invoice_recurrence"/>
|
||||
<field name="invoice_recurrence"/>
|
||||
|
Loading…
Reference in New Issue
Block a user