mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[ADD]pms_payment_acquirer_multiproperty Payment acquirer multi property logic
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import portal
|
||||
23
payment_acquirer_multi_pms_properties/controllers/portal.py
Normal file
23
payment_acquirer_multi_pms_properties/controllers/portal.py
Normal file
@@ -0,0 +1,23 @@
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo.addons.account.controllers.portal import PortalAccount
|
||||
|
||||
|
||||
class PortalAccount(PortalAccount):
|
||||
def _invoice_get_page_view_values(self, invoice, access_token, **kwargs):
|
||||
"""
|
||||
Override to add the pms property filter
|
||||
"""
|
||||
values = super(PortalAccount, self)._invoice_get_page_view_values(
|
||||
invoice, access_token, **kwargs
|
||||
)
|
||||
for acquirer in values["acquirers"]:
|
||||
if (
|
||||
acquirer.pms_property_ids
|
||||
and invoice.pms_property_id.id not in acquirer.pms_property_ids.ids
|
||||
):
|
||||
values["acquirers"] -= acquirer
|
||||
for pms in values["pms"]:
|
||||
if pms.acquirer_id not in values["acquirers"].ids:
|
||||
values["pms"] -= pms
|
||||
return values
|
||||
Reference in New Issue
Block a user