Browse Source

[IMP] override the domain when refund is from release_capital_request

pull/1/head
houssine 6 years ago
parent
commit
7c725518de
  1. 1
      easy_my_coop/wizard/__init__.py
  2. 20
      easy_my_coop/wizard/account_invoice_refund.py

1
easy_my_coop/wizard/__init__.py

@ -3,3 +3,4 @@ from . import create_subscription_from_partner
from . import update_partner_info from . import update_partner_info
from . import validate_subscription_request from . import validate_subscription_request
from . import update_share_line from . import update_share_line
from . import account_invoice_refund

20
easy_my_coop/wizard/account_invoice_refund.py

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
from openerp import api, models
class AccountInvoiceRefund(models.TransientModel):
_inherit = "account.invoice.refund"
@api.multi
def compute_refund(self, mode='refund'):
result = super(AccountInvoiceRefund, self).compute_refund(mode)
context = dict(self._context or {})
inv = self.env['account.invoice'].browse(context.get('active_ids'))
if inv.release_capital_request:
domain = result['domain']
t = ('release_capital_request', '=', True)
out = [t if e[0] == t[0] else e for e in domain]
result['domain'] = out
return result
Loading…
Cancel
Save