Ecocentral/ecocentral#152: include in_refund invoices. rappel_pending readonly. vendor ref in invoice lines
This commit is contained in:
parent
4c07dd042d
commit
29ef56b800
5 changed files with 140 additions and 18 deletions
|
|
@ -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
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue