minor fix
This commit is contained in:
parent
738ba34c83
commit
bba4a05706
18
booking.py
18
booking.py
|
@ -227,8 +227,6 @@ class Booking(Workflow, ModelSQL, ModelView):
|
|||
taxes_exception = fields.Boolean('Taxes Exception', states=STATES)
|
||||
total_advance = fields.Function(fields.Numeric( 'Total Advance'), 'get_total_advance')
|
||||
|
||||
|
||||
|
||||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(Booking, cls).__setup__()
|
||||
|
@ -634,7 +632,6 @@ class Booking(Workflow, ModelSQL, ModelView):
|
|||
'operation': line.operation.id
|
||||
}])
|
||||
|
||||
|
||||
def get_total_advance(self, name):
|
||||
Advance = Pool().get('hotel.booking-account.voucher')
|
||||
res = 0
|
||||
|
@ -752,6 +749,10 @@ class BookingLine(ModelSQL, ModelView):
|
|||
@classmethod
|
||||
def __setup__(cls):
|
||||
super(BookingLine, cls).__setup__()
|
||||
cls._check_modify_exclude = [
|
||||
'nationality', 'origin_country', 'target_country',
|
||||
'registration_state'
|
||||
],
|
||||
cls._error_messages.update({
|
||||
'invalid_number_guests': ('Invalid number of guests for '
|
||||
'the room %s.'),
|
||||
|
@ -799,6 +800,15 @@ class BookingLine(ModelSQL, ModelView):
|
|||
values.update({'end_date': vals['departure_date']})
|
||||
if values:
|
||||
Operation.write([line.operation], values)
|
||||
|
||||
actions = iter(args)
|
||||
if len(args) > 2:
|
||||
actions = iter(args[2:])
|
||||
for lines, vals in zip(actions, actions):
|
||||
if set(vals) - set(cls._check_modify_exclude[0]):
|
||||
for line in lines:
|
||||
line.check_method()
|
||||
pass
|
||||
super(BookingLine, cls).write(*args)
|
||||
|
||||
@classmethod
|
||||
|
@ -862,7 +872,7 @@ class BookingLine(ModelSQL, ModelView):
|
|||
def validate(cls, lines):
|
||||
super(BookingLine, cls).validate(lines)
|
||||
for line in lines:
|
||||
line.check_method()
|
||||
# line.check_method()
|
||||
pass
|
||||
|
||||
@classmethod
|
||||
|
|
|
@ -1052,7 +1052,7 @@ class Migration(Report):
|
|||
end = data['end_date']
|
||||
report_context['records'] = Line.search([
|
||||
('arrival_date', '>=', start),
|
||||
('departure_date', '<=', end),
|
||||
('arrival_date', '<=', end),
|
||||
])
|
||||
return report_context
|
||||
|
||||
|
|
2
party.py
2
party.py
|
@ -148,7 +148,7 @@ class CreateGuest(Wizard):
|
|||
self.get_message(('El usuario %s ya existe')%(self.start.name))
|
||||
else:
|
||||
party, = Party.create([{
|
||||
'name': self.start.name,
|
||||
'name': self.start.full_name,
|
||||
'id_number': self.start.id_number,
|
||||
'type_document': self.start.type_document,
|
||||
'birthday': self.start.birthday,
|
||||
|
|
|
@ -11,11 +11,12 @@ this repository contains the full copyright notices and license terms. -->
|
|||
<field name="nationality"/>
|
||||
<field name="birthday"/>
|
||||
<field name="origin_country"/>
|
||||
<field name="target_country"/>
|
||||
<field name="target_country"/>
|
||||
<field name="sex"/>
|
||||
<field name="type_guest"/>
|
||||
<field name="first_name"/>
|
||||
<field name="second_name"/>
|
||||
<field name="first_family_name"/>
|
||||
<field name="second_family_name"/>
|
||||
<field name="type_person"/>
|
||||
</tree>
|
||||
|
|
Loading…
Reference in New Issue