mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
[IMP] account_payment_order: Add hook method for finding previous payment orders + Pass single move in a get_account_payment_domain mehtod to find move in a method.
This commit is contained in:
committed by
Pedro M. Baeza
parent
d49f95cb95
commit
a597822f2c
@@ -110,6 +110,10 @@ Contributors
|
||||
* Carlos Dauden
|
||||
* Carlos Roca
|
||||
|
||||
* `Open Source Integrators <https://www.opensourceintegrators.com>`_:
|
||||
|
||||
* Ammar Officewala <aofficewala@opensourceintegrators.com>
|
||||
|
||||
Maintainers
|
||||
~~~~~~~~~~~
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
{
|
||||
"name": "Account Payment Order",
|
||||
"version": "14.0.1.2.1",
|
||||
"version": "14.0.1.2.3",
|
||||
"license": "AGPL-3",
|
||||
"author": "ACSONE SA/NV, "
|
||||
"Therp BV, "
|
||||
|
||||
@@ -49,6 +49,9 @@ class AccountMove(models.Model):
|
||||
# in account_payment_order.py
|
||||
return vals
|
||||
|
||||
def get_account_payment_domain(self, payment_mode):
|
||||
return [("payment_mode_id", "=", payment_mode.id), ("state", "=", "draft")]
|
||||
|
||||
def create_account_payment_line(self):
|
||||
apoo = self.env["account.payment.order"]
|
||||
result_payorder_ids = []
|
||||
@@ -81,11 +84,7 @@ class AccountMove(models.Model):
|
||||
raise UserError(_("No Payment Mode on invoice %s") % move.name)
|
||||
for payment_mode in payment_modes:
|
||||
payorder = apoo.search(
|
||||
[
|
||||
("payment_mode_id", "=", payment_mode.id),
|
||||
("state", "=", "draft"),
|
||||
],
|
||||
limit=1,
|
||||
move.get_account_payment_domain(payment_mode), limit=1
|
||||
)
|
||||
new_payorder = False
|
||||
if not payorder:
|
||||
|
||||
@@ -23,3 +23,7 @@
|
||||
* Pedro M. Baeza
|
||||
* Carlos Dauden
|
||||
* Carlos Roca
|
||||
|
||||
* `Open Source Integrators <https://www.opensourceintegrators.com>`_:
|
||||
|
||||
* Ammar Officewala <aofficewala@opensourceintegrators.com>
|
||||
|
||||
@@ -456,6 +456,10 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
|
||||
<li>Carlos Roca</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a class="reference external" href="https://www.opensourceintegrators.com">Open Source Integrators</a>:<ul>
|
||||
<li>Ammar Officewala <<a class="reference external" href="mailto:aofficewala@opensourceintegrators.com">aofficewala@opensourceintegrators.com</a>></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="maintainers">
|
||||
|
||||
Reference in New Issue
Block a user