Skip to content

Commit

Permalink
[IMP]pms: Avoid recompute documents fields by other partner documents
Browse files Browse the repository at this point in the history
  • Loading branch information
DarioLodeiros committed Mar 2, 2024
1 parent 63a7981 commit 7f811ca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 6 additions & 3 deletions pms/models/res_partner_id_number.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ def _compute_name(self):
for record in self:
if record.partner_id.pms_checkin_partner_ids:
last_update_name = record.partner_id.pms_checkin_partner_ids.filtered(
lambda x: x.write_date
lambda x: x.document_id == record
and x.write_date
== max(
record.partner_id.pms_checkin_partner_ids.mapped("write_date")
)
Expand All @@ -57,7 +58,8 @@ def _compute_valid_from(self):
if record.partner_id.pms_checkin_partner_ids:
last_update_valid_from = (
record.partner_id.pms_checkin_partner_ids.filtered(
lambda x: x.write_date
lambda x: x.document_id == record
and x.write_date
== max(
record.partner_id.pms_checkin_partner_ids.mapped(
"write_date"
Expand All @@ -81,7 +83,8 @@ def _compute_category_id(self):
if record.partner_id.pms_checkin_partner_ids:
last_update_category_id = (
record.partner_id.pms_checkin_partner_ids.filtered(
lambda x: x.write_date
lambda x: x.document_id == record
and x.write_date
== max(
record.partner_id.pms_checkin_partner_ids.mapped(
"write_date"
Expand Down
3 changes: 2 additions & 1 deletion pms_l10n_es/models/res_partner_id_number.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ def _compute_support_number(self):
if record.partner_id.pms_checkin_partner_ids:
last_update_support_number = (
record.partner_id.pms_checkin_partner_ids.filtered(
lambda x: x.write_date
lambda x: x.document_id == record
and x.write_date
== max(
record.partner_id.pms_checkin_partner_ids.mapped(
"write_date"
Expand Down

0 comments on commit 7f811ca

Please sign in to comment.