mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[IMP]pms: checkin partner residence state
This commit is contained in:
@@ -49,5 +49,5 @@ class PmsCheckinParnert(models.Model):
|
||||
]
|
||||
)
|
||||
if depends or (country and country.code == CODE_SPAIN):
|
||||
mandatory_fields.append("state_id")
|
||||
mandatory_fields.append("residence_state_id")
|
||||
return mandatory_fields
|
||||
|
||||
@@ -16,7 +16,7 @@ class ResPartner(models.Model):
|
||||
store=True,
|
||||
)
|
||||
|
||||
@api.depends("nationality_id", "state_id")
|
||||
@api.depends("nationality_id", "residence_state_id")
|
||||
def _compute_ine_code(self):
|
||||
for record in self:
|
||||
if not record.nationality_id:
|
||||
@@ -24,9 +24,9 @@ class ResPartner(models.Model):
|
||||
elif record.nationality_id.code != CODE_SPAIN:
|
||||
record.ine_code = record.nationality_id.code_alpha3
|
||||
else:
|
||||
if not record.state_id:
|
||||
if not record.residence_state_id:
|
||||
record.ine_code = False
|
||||
record.ine_code = record.state_id.ine_code
|
||||
record.ine_code = record.residence_state_id.ine_code
|
||||
|
||||
def _check_enought_invoice_data(self):
|
||||
self.ensure_one()
|
||||
|
||||
@@ -255,10 +255,10 @@ class WizardIne(models.TransientModel):
|
||||
spanish_guests_with_no_state,
|
||||
)
|
||||
)
|
||||
state_id = self.env["res.country.state"].browse(
|
||||
residence_state_id = self.env["res.country.state"].browse(
|
||||
entry_from_spain["residence_state_id"][0]
|
||||
) # .ine_code
|
||||
ine_code = state_id.ine_code
|
||||
ine_code = residence_state_id.ine_code
|
||||
|
||||
# get count of each result
|
||||
num_spain = entry_from_spain["__count"]
|
||||
|
||||
Reference in New Issue
Block a user