[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:
AmmarOfficewalaSerpentCS
2021-07-06 14:22:50 +05:30
committed by Pedro M. Baeza
parent d49f95cb95
commit a597822f2c
5 changed files with 17 additions and 6 deletions

View File

@@ -110,6 +110,10 @@ Contributors
* Carlos Dauden
* Carlos Roca
* `Open Source Integrators <https://www.opensourceintegrators.com>`_:
* Ammar Officewala <aofficewala@opensourceintegrators.com>
Maintainers
~~~~~~~~~~~

View File

@@ -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, "

View File

@@ -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:

View File

@@ -23,3 +23,7 @@
* Pedro M. Baeza
* Carlos Dauden
* Carlos Roca
* `Open Source Integrators <https://www.opensourceintegrators.com>`_:
* Ammar Officewala <aofficewala@opensourceintegrators.com>

View File

@@ -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 &lt;<a class="reference external" href="mailto:aofficewala&#64;opensourceintegrators.com">aofficewala&#64;opensourceintegrators.com</a>&gt;</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">