Skip to content

Commit

Permalink
[IMP] account_payment_order: pre-commit auto fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ramiadavid committed Jan 13, 2024
1 parent 1fd87cf commit 6c5fd79
Show file tree
Hide file tree
Showing 18 changed files with 126 additions and 115 deletions.
92 changes: 49 additions & 43 deletions account_payment_order/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ Account Payment Order
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fbank--payment-lightgray.png?logo=github
:target: https://github.com/OCA/bank-payment/tree/16.0/account_payment_order
:target: https://github.com/OCA/bank-payment/tree/17.0/account_payment_order
:alt: OCA/bank-payment
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/bank-payment-16-0/bank-payment-16-0-account_payment_order
:target: https://translation.odoo-community.org/projects/bank-payment-17-0/bank-payment-17-0-account_payment_order
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/bank-payment&target_branch=16.0
:target: https://runboat.odoo-community.org/builds?repo=OCA/bank-payment&target_branch=17.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand All @@ -40,88 +40,94 @@ Installation

This module depends on:

* account_payment_partner
* base_iban
* document
- account_payment_partner
- base_iban
- document

This modules is part of the OCA/bank-payment suite.

Configuration
=============

This module adds several options on Payment Modes, cf Invoicing/Accounting >
Configuration > Management > Payment Modes.
This module adds several options on Payment Modes, cf
Invoicing/Accounting > Configuration > Management > Payment Modes.

Usage
=====

You can create a Payment order via the menu Invoicing/Accounting > Vendors > Payment Orders and then select the move lines to pay.
You can create a Payment order via the menu Invoicing/Accounting >
Vendors > Payment Orders and then select the move lines to pay.

You can create a Debit order via the menu Invoicing/Accounting > Customers > Debit Orders and then select the move lines to debit.
You can create a Debit order via the menu Invoicing/Accounting >
Customers > Debit Orders and then select the move lines to debit.

This module also adds an action *Add to Payment Order* on supplier invoices and *Add to Debit Order* on customer invoices.
This module also adds an action *Add to Payment Order* on supplier
invoices and *Add to Debit Order* on customer invoices.

You can print a Payment order via the menu Invoicing/Accounting > Vendors > Payment Orders and then select the payment oder to print.
You can print a Payment order via the menu Invoicing/Accounting >
Vendors > Payment Orders and then select the payment oder to print.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/bank-payment/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/bank-payment/issues/new?body=module:%20account_payment_order%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/bank-payment/issues/new?body=module:%20account_payment_order%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~
-------

* ACSONE SA/NV
* Therp BV
* Tecnativa
* Akretion

Contributors
~~~~~~~~~~~~
------------

* Stéphane Bidoul <[email protected]>
* Alexis de Lattre <[email protected]>
* Adrien Peiffer <[email protected]>
* Stefan Rijnhart
* Laurent Mignon <[email protected]>
* Alexandre Fayolle
* Danimar Ribeiro
* Erwin van der Ploeg
* Raphaël Valyi
* Sandy Carter
* Angel Moya <[email protected]>
* Jose María Alzaga <[email protected]>
* Meyomesse Gilles <[email protected]>
* Denis Roussel <[email protected]>
- Stéphane Bidoul <[email protected]>
- Alexis de Lattre <[email protected]>
- Adrien Peiffer <[email protected]>
- Stefan Rijnhart
- Laurent Mignon <[email protected]>
- Alexandre Fayolle
- Danimar Ribeiro
- Erwin van der Ploeg
- Raphaël Valyi
- Sandy Carter
- Angel Moya <[email protected]>
- Jose María Alzaga <[email protected]>
- Meyomesse Gilles <[email protected]>
- Denis Roussel <[email protected]>
- `DynApps <https://www.dynapps.be>`__:

* `DynApps <https://www.dynapps.be>`_:
- Raf Ven <raf.ven@dynapps.be>

* Raf Ven <[email protected]>
* Andrea Stirpe <[email protected]>
* `Jarsa <https://www.jarsa.com.mx>`_:
- Andrea Stirpe <[email protected]>
- `Jarsa <https://www.jarsa.com.mx>`__:

* Alan Ramos <[email protected]>
* `Tecnativa <https://www.tecnativa.com>`_:
- Alan Ramos <[email protected]>

* Pedro M. Baeza
* Carlos Dauden
* Carlos Roca
- `Tecnativa <https://www.tecnativa.com>`__:

* `Open Source Integrators <https://www.opensourceintegrators.com>`_:
- Pedro M. Baeza
- Carlos Dauden
- Carlos Roca

* Ammar Officewala <[email protected]>
* Marçal Isern <[email protected]>
- `Open Source Integrators <https://www.opensourceintegrators.com>`__:

- Ammar Officewala <[email protected]>

- Marçal Isern <[email protected]>

Maintainers
~~~~~~~~~~~
-----------

This module is maintained by the OCA.

Expand All @@ -133,6 +139,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/bank-payment <https://github.com/OCA/bank-payment/tree/16.0/account_payment_order>`_ project on GitHub.
This module is part of the `OCA/bank-payment <https://github.com/OCA/bank-payment/tree/17.0/account_payment_order>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
12 changes: 7 additions & 5 deletions account_payment_order/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,11 @@ def _get_payment_order_communication_full(self):
invoice_partials,
exchange_diff_moves,
) = self._get_reconciled_invoices_partials()
for (_x, _y, payment_move_line,) in (
invoice_partials + exchange_diff_moves
):
for (
_x,
_y,
payment_move_line,
) in invoice_partials + exchange_diff_moves:
payment_move = payment_move_line.move_id
if payment_move not in reference_moves:
references.append(
Expand Down Expand Up @@ -140,7 +142,7 @@ def create_account_payment_line(self):
% move.name
)
payment_lines = applicable_lines.payment_line_ids.filtered(
lambda l: l.state in ("draft", "open", "generated")
lambda x: x.state in ("draft", "open", "generated")
)
if payment_lines:
raise UserError(
Expand All @@ -167,7 +169,7 @@ def create_account_payment_line(self):
action_payment_type = payorder.payment_type
count = 0
for line in applicable_lines.filtered(
lambda x: x.payment_mode_id == payment_mode
lambda x, mode=payment_mode: x.payment_mode_id == mode
):
line.create_payment_line_from_move_line(payorder)
count += 1
Expand Down
2 changes: 1 addition & 1 deletion account_payment_order/models/account_payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def _compute_payment_method_line_fields(self):
if to_exclude:
pay.available_payment_method_line_ids = (
pay.available_payment_method_line_ids.filtered(
lambda x: x.code not in to_exclude
lambda x, y=to_exclude: x.code not in y
)
)
return res
6 changes: 3 additions & 3 deletions account_payment_order/models/account_payment_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def unlink(self):
"cancel it in order to do so."
)
)
return super(AccountPaymentOrder, self).unlink()
return super().unlink()

@api.constrains("payment_type", "payment_mode_id")
def payment_order_constraints(self):
Expand Down Expand Up @@ -238,7 +238,7 @@ def create(self, vals_list):
vals["journal_id"] = payment_mode.fixed_journal_id.id
if not vals.get("date_prefered") and payment_mode.default_date_prefered:
vals["date_prefered"] = payment_mode.default_date_prefered
return super(AccountPaymentOrder, self).create(vals_list)
return super().create(vals_list)

@api.onchange("payment_mode_id")
def payment_mode_id_change(self):
Expand Down Expand Up @@ -429,7 +429,7 @@ def generated2uploaded(self):
(
payment.payment_line_ids.move_line_id
+ payment.move_id.line_ids.filtered(
lambda x: x.account_id == payment.destination_account_id
lambda x, p=payment: x.account_id == p.destination_account_id
)
).reconcile()
self.write(
Expand Down
3 changes: 3 additions & 0 deletions account_payment_order/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
2 changes: 2 additions & 0 deletions account_payment_order/readme/CONFIGURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module adds several options on Payment Modes, cf
Invoicing/Accounting \> Configuration \> Management \> Payment Modes.
2 changes: 0 additions & 2 deletions account_payment_order/readme/CONFIGURE.rst

This file was deleted.

26 changes: 26 additions & 0 deletions account_payment_order/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
- Stéphane Bidoul \<<[email protected]>\>
- Alexis de Lattre \<<[email protected]>\>
- Adrien Peiffer \<<[email protected]>\>
- Stefan Rijnhart
- Laurent Mignon \<<[email protected]>\>
- Alexandre Fayolle
- Danimar Ribeiro
- Erwin van der Ploeg
- Raphaël Valyi
- Sandy Carter
- Angel Moya \<<[email protected]>\>
- Jose María Alzaga \<<[email protected]>\>
- Meyomesse Gilles \<<[email protected]>\>
- Denis Roussel \<<[email protected]>\>
- [DynApps](https://www.dynapps.be):
- Raf Ven \<<[email protected]>\>
- Andrea Stirpe \<<[email protected]>\>
- [Jarsa](https://www.jarsa.com.mx):
- Alan Ramos \<<[email protected]>\>
- [Tecnativa](https://www.tecnativa.com):
- Pedro M. Baeza
- Carlos Dauden
- Carlos Roca
- [Open Source Integrators](https://www.opensourceintegrators.com):
- Ammar Officewala \<<[email protected]>\>
- Marçal Isern \<<[email protected]>\>
32 changes: 0 additions & 32 deletions account_payment_order/readme/CONTRIBUTORS.rst

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
This module adds support for payment orders and debit orders.
This module adds support for payment orders and debit orders.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
This module depends on:

* account_payment_partner
* base_iban
* document

This modules is part of the OCA/bank-payment suite.
This module depends on:

- account_payment_partner
- base_iban
- document

This modules is part of the OCA/bank-payment suite.
11 changes: 11 additions & 0 deletions account_payment_order/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
You can create a Payment order via the menu Invoicing/Accounting \>
Vendors \> Payment Orders and then select the move lines to pay.

You can create a Debit order via the menu Invoicing/Accounting \>
Customers \> Debit Orders and then select the move lines to debit.

This module also adds an action *Add to Payment Order* on supplier
invoices and *Add to Debit Order* on customer invoices.

You can print a Payment order via the menu Invoicing/Accounting \>
Vendors \> Payment Orders and then select the payment oder to print.
7 changes: 0 additions & 7 deletions account_payment_order/readme/USAGE.rst

This file was deleted.

4 changes: 2 additions & 2 deletions account_payment_order/report/account_payment_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ def get_bank_account_name(self, partner_bank):
if partner_bank.bank_name:
name = "%s: " % partner_bank.bank_id.name
if partner_bank.acc_number:
name = "{} {}".format(name, partner_bank.acc_number)
name = f"{name} {partner_bank.acc_number}"
if partner_bank.bank_bic:
name = "%s - " % (name)
if partner_bank.bank_bic:
name = "{} BIC {}".format(name, partner_bank.bank_bic)
name = f"{name} BIC {partner_bank.bank_bic}"
return name
else:
return False
Loading

0 comments on commit 6c5fd79

Please sign in to comment.