You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
628 B

  1. from odoo import api, models
  2. class AccountInvoiceRefund(models.TransientModel):
  3. _inherit = "account.invoice.refund"
  4. @api.multi
  5. def compute_refund(self, mode="refund"):
  6. result = super(AccountInvoiceRefund, self).compute_refund(mode)
  7. context = dict(self._context or {})
  8. inv = self.env["account.invoice"].browse(context.get("active_ids"))
  9. if inv.release_capital_request:
  10. domain = result["domain"]
  11. t = ("release_capital_request", "=", True)
  12. out = [t if e[0] == t[0] else e for e in domain]
  13. result["domain"] = out
  14. return result