This commit is contained in:
oscar alvarez 2023-07-26 22:31:30 -05:00
parent 5fcf0d5ea1
commit 84273979c8
3 changed files with 12 additions and 3 deletions

View File

@ -77,6 +77,10 @@ class Booking(Workflow, ModelSQL, ModelView):
states={
'readonly': Bool(Eval('lines')),
}, depends=['state', 'company', 'lines'])
rate_plan = fields.Many2One('hotel.rate_plan', 'Rate Plan',
states={
'readonly': Bool(Eval('lines')),
}, depends=['state', 'company', 'lines'])
company = fields.Many2One('company.company', 'Company', required=True,
states=STATES, domain=[('id', If(In('company',
Eval('context', {})), '=', '!='), Get(Eval('context', {}),

View File

@ -9,7 +9,7 @@ from trytond.model import ModelView, ModelSQL, fields, Workflow
class RatePlan(Workflow, ModelSQL, ModelView):
'Hotel Rate Plan'
__name__ = 'hotel.rate_plan'
_rec_name = "price_list"
# _rec_name = "price_list"
price_list = fields.Many2One('product.price_list', 'Price List',
required=True)
start_date = fields.Date('Start Date', required=True)
@ -101,6 +101,9 @@ class RatePlan(Workflow, ModelSQL, ModelView):
if self.end_date and self.start_date:
return (self.end_date - self.start_date).days
def get_rec_name(self, name):
return self.price_list.name
class RatePlanRule(ModelSQL, ModelView):
'Hotel Rate Plan'

View File

@ -20,8 +20,8 @@ this repository contains the full copyright notices and license terms. -->
<field name="media"/>
<label name="plan"/>
<field name="plan"/>
<label name="price_list"/>
<field name="price_list" widget="selection"/>
<label name="rate_plan"/>
<field name="rate_plan" widget="selection"/>
<label name="payment_term"/>
<field name="payment_term" widget="selection"/>
<label name="space"/>
@ -63,6 +63,8 @@ this repository contains the full copyright notices and license terms. -->
<field name="company"/>
<label name="currency"/>
<field name="currency"/>
<label name="price_list"/>
<field name="price_list" widget="selection"/>
<label name="credit_card"/>
<field name="credit_card"/>
<label name="guarantee"/>