mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[RFC]pms: Refactor origin sale channel
This commit is contained in:
@@ -1507,18 +1507,6 @@ class PmsFolio(models.Model):
|
||||
("sale_line_ids.invoice_lines.move_id", operator, value),
|
||||
]
|
||||
|
||||
# @api.constrains("agency_id", "channel_type_id")
|
||||
# def _check_only_one_channel(self):
|
||||
# for record in self:
|
||||
# if (
|
||||
# record.agency_id
|
||||
# and record.channel_type_id.channel_type
|
||||
# != record.agency_id.sale_channel_id.channel_type
|
||||
# ):
|
||||
# raise models.ValidationError(
|
||||
# _("The Sale Channel does not correspond to the agency's")
|
||||
# )
|
||||
|
||||
@api.constrains("name")
|
||||
def _check_required_partner_name(self):
|
||||
for record in self:
|
||||
|
||||
@@ -844,13 +844,6 @@
|
||||
enable_counters="1"
|
||||
select="multi"
|
||||
/>
|
||||
<!-- <field-->
|
||||
<!-- name="channel_type_id"-->
|
||||
<!-- string="Channel"-->
|
||||
<!-- enable_counters="1"-->
|
||||
<!-- icon="fa-sitemap"-->
|
||||
<!-- expand="1"-->
|
||||
<!-- />-->
|
||||
</searchpanel>
|
||||
</search>
|
||||
</field>
|
||||
|
||||
@@ -1089,13 +1089,6 @@
|
||||
icon="fa-bookmark"
|
||||
color="#875A7B"
|
||||
/>
|
||||
<!-- <field-->
|
||||
<!-- name="channel_type_id"-->
|
||||
<!-- string="Channel"-->
|
||||
<!-- enable_counters="1"-->
|
||||
<!-- icon="fa-sitemap"-->
|
||||
<!-- expand="1"-->
|
||||
<!-- />-->
|
||||
</searchpanel>
|
||||
</search>
|
||||
</field>
|
||||
|
||||
@@ -145,7 +145,9 @@ class BookingDuplicate(models.TransientModel):
|
||||
def _compute_channel_type_id(self):
|
||||
for record in self.filtered("reference_folio_id"):
|
||||
if record.reference_folio_id.agency_id == record.agency_id:
|
||||
record.channel_type_id = record.reference_folio_id.channel_type_id
|
||||
record.channel_type_id = (
|
||||
record.reference_folio_id.sale_channel_origin_id
|
||||
)
|
||||
elif record.agency_id:
|
||||
record.channel_type_id = record.agency_id.sale_channel_id.id
|
||||
|
||||
@@ -301,7 +303,7 @@ class BookingDuplicate(models.TransientModel):
|
||||
"partner_name": self.partner_name,
|
||||
"pms_property_id": self.pms_property_id.id,
|
||||
"agency_id": self.agency_id.id,
|
||||
"channel_type_id": self.channel_type_id.id,
|
||||
"sale_channel_origin_id": self.channel_type_id.id,
|
||||
"segmentation_ids": [(6, 0, self.segmentation_ids.ids)],
|
||||
"internal_comment": self.internal_comment,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user