Ecocentral/ecocentral#152: include in_refund invoices. rappel_pending readonly. vendor ref in invoice lines

This commit is contained in:
Luis 2026-06-23 12:16:47 +02:00
parent 4c07dd042d
commit 29ef56b800
5 changed files with 140 additions and 18 deletions

View file

@ -16,13 +16,16 @@ class AccountMove(models.Model):
def create(self, vals_list):
moves = super().create(vals_list)
for move in moves:
if move.move_type == "in_invoice" and move.partner_id.rappel_commission:
if (
move.move_type in ("in_invoice", "in_refund")
and move.partner_id.rappel_commission
):
move.rappel_pending = True
return moves
@api.onchange("partner_id")
def _onchange_partner_id_rappel(self):
if self.move_type == "in_invoice":
if self.move_type in ("in_invoice", "in_refund"):
self.rappel_pending = bool(
self.partner_id and self.partner_id.rappel_commission
)