Fix
This commit is contained in:
parent
5323251654
commit
bdc6b59de0
20
booking.py
20
booking.py
|
@ -1325,6 +1325,7 @@ class UpdateHolderStart(ModelView):
|
|||
('female', 'Female'),
|
||||
], 'Sex', required=True)
|
||||
phone = fields.Char('Phone', required=True)
|
||||
mobile = fields.Char('Mobile', required=True)
|
||||
email = fields.Char('Email')
|
||||
birthday = fields.Date('Birthday')
|
||||
|
||||
|
@ -1342,6 +1343,7 @@ class UpdateHolderStart(ModelView):
|
|||
visa_date = fields.Date('Visa Date')
|
||||
notes = fields.Text('Notes')
|
||||
|
||||
customer = fields.Many2One('party.party', 'Party')
|
||||
customer_id_number = fields.Char('Customer Id Number')
|
||||
customer_name = fields.Char('Customer Name')
|
||||
customer_country = fields.Many2One('party.country_code', 'Customer Country')
|
||||
|
@ -1379,6 +1381,7 @@ class UpdateHolder(Wizard):
|
|||
'id_number': party.id_number,
|
||||
'type_document': party.type_document,
|
||||
'sex': party.sex,
|
||||
'mobile': party.mobile,
|
||||
'phone': party.phone,
|
||||
'email': party.email,
|
||||
'visa_number': party.visa_number,
|
||||
|
@ -1391,12 +1394,14 @@ class UpdateHolder(Wizard):
|
|||
res['city'] = address.city_code.id if address.city_code else None
|
||||
return res
|
||||
|
||||
def _set_cms(self, action, rec, phone, email):
|
||||
def _set_cms(self, action, rec, email, mobile=None, phone=None):
|
||||
cms = [] # contact_mechanisms
|
||||
if phone:
|
||||
cms.append({'type': 'phone', 'value': phone})
|
||||
if mobile:
|
||||
cms.append({'type': 'mobile', 'value': mobile})
|
||||
if email:
|
||||
cms.append({'type': 'email', 'value': email})
|
||||
if phone:
|
||||
cms.append({'type': 'phone', 'value': phone})
|
||||
if cms:
|
||||
rec['contact_mechanisms'] = [(action, cms)]
|
||||
return
|
||||
|
@ -1439,7 +1444,7 @@ class UpdateHolder(Wizard):
|
|||
if parties:
|
||||
raise UserError('Este cliente ya existe!')
|
||||
|
||||
self._set_cms('create', rec, _party.phone, _party.email)
|
||||
self._set_cms('create', rec, _party.email, _party.mobile, _party.phone)
|
||||
rec['addresses'] = [('create', [address])]
|
||||
else:
|
||||
if booking.party.addresses:
|
||||
|
@ -1448,6 +1453,8 @@ class UpdateHolder(Wizard):
|
|||
Address.create([address])
|
||||
if booking.party.contact_mechanisms:
|
||||
for cm in booking.party.contact_mechanisms:
|
||||
if cm.type == 'mobile':
|
||||
cm.value = _party.mobile
|
||||
if cm.type == 'phone':
|
||||
cm.value = _party.phone
|
||||
if cm.type == 'email':
|
||||
|
@ -1482,7 +1489,10 @@ class UpdateHolder(Wizard):
|
|||
|
||||
rec_['addresses'] = [('create', [address_cust])]
|
||||
self._set_cms(
|
||||
'create', rec_, _party.customer_phone, _party.customer_email
|
||||
'create',
|
||||
rec_,
|
||||
_party.customer_email,
|
||||
phone=_party.customer_phone,
|
||||
)
|
||||
party, = Party.create([rec_])
|
||||
# rec['party_obligation_tax'] = [('add', [116])]
|
||||
|
|
6
folio.py
6
folio.py
|
@ -233,12 +233,12 @@ class Folio(ModelSQL, ModelView):
|
|||
|
||||
@classmethod
|
||||
def update_room(cls, room, state):
|
||||
Housekeeping = pool.get('hotel.housekeeping')
|
||||
Housekeeping = Pool.get('hotel.housekeeping')
|
||||
hkrooms = Housekeeping.search([
|
||||
('room', '=', room.id),
|
||||
])
|
||||
method = getattr(cls, state)
|
||||
method([hkrooms])
|
||||
# method = getattr(Housekeeping, state)
|
||||
# method([hkrooms])
|
||||
|
||||
def get_invoice_state(self, name=None):
|
||||
if self.invoice_line:
|
||||
|
|
|
@ -13,10 +13,12 @@ this repository contains the full copyright notices and license terms. -->
|
|||
<field name="id_number"/>
|
||||
<label name="sex"/>
|
||||
<field name="sex"/>
|
||||
<label name="phone"/>
|
||||
<field name="phone"/>
|
||||
<label name="email"/>
|
||||
<field name="email"/>
|
||||
<label name="mobile"/>
|
||||
<field name="mobile"/>
|
||||
<label name="phone"/>
|
||||
<field name="phone"/>
|
||||
<label name="birthday"/>
|
||||
<field name="birthday"/>
|
||||
</group>
|
||||
|
|
Loading…
Reference in New Issue