Skip to content

Commit

Permalink
[IMP] integrate transfer journal option into account_payment_order
Browse files Browse the repository at this point in the history
  • Loading branch information
luc-demeyer committed Dec 9, 2023
1 parent b0de785 commit 4b53d35
Show file tree
Hide file tree
Showing 34 changed files with 52 additions and 615 deletions.
9 changes: 6 additions & 3 deletions account_banking_pain_base/views/res_config_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
-->
<odoo>
<record id="view_account_config_settings" model="ir.ui.view">
<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="name">pain.group.on.account.config.settings</field>
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="account.res_config_settings_view_form" />
<field
name="inherit_id"
ref="account_payment_order.res_config_settings_view_form"
/>
<field name="arch" type="xml">
<xpath expr="//div[@id='analytic']" position="after">
<xpath expr="//div[@id='transfer_journal']" position="after">
<h2>SEPA/PAIN</h2>
<div class="row mt16 o_settings_container" id="pain">
<div class="col-xs-12 col-md-6 o_setting_box">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="view_account_config_settings" model="ir.ui.view">
<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="name">sepa_direct_debit.account_config_settings.form
</field>
<field name="model">res.config.settings</field>
<field
name="inherit_id"
ref="account_banking_pain_base.view_account_config_settings"
ref="account_banking_pain_base.res_config_settings_view_form"
/>
<field name="arch" type="xml">
<xpath expr="//div[@id='pain']/div/div/div" position="inside">
Expand Down
9 changes: 7 additions & 2 deletions account_payment_order/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Account Payment Order
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:0399e2f98f07d9c21c128885229a0263686b56ece85f6c3fdf4f2a61445b62fe
!! source digest: sha256:e63957550e8783d01276210fe7a10bd1a9d70efdd9d245bcd998f61c89322919
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Mature-brightgreen.png
Expand Down Expand Up @@ -61,7 +61,11 @@ You can create a Debit order via the menu Invoicing/Accounting > Customers > Deb

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 order to print.

You can set a transfer journal via Accounting Settings or on the Payment Mode.
If there is no transfer journal, the bank journal itself will be used for the journal entry
created when confirming a payment order.

Bug Tracker
===========
Expand Down Expand Up @@ -119,6 +123,7 @@ Contributors

* Ammar Officewala <[email protected]>
* Marçal Isern <[email protected]>
* Luc De Meyer <[email protected]> (https://noviat.com)

Maintainers
~~~~~~~~~~~
Expand Down
1 change: 1 addition & 0 deletions account_payment_order/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"data/payment_seq.xml",
"report/print_account_payment_order.xml",
"report/account_payment_order.xml",
"wizard/res_config_settings.xml",
],
"demo": ["demo/payment_demo.xml"],
"installable": True,
Expand Down
1 change: 1 addition & 0 deletions account_payment_order/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
from . import account_payment_method
from . import account_journal
from . import account_payment
from . import res_company
4 changes: 3 additions & 1 deletion account_payment_order/models/account_payment.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ def _compute_payment_method_line_fields(self):
for pay in self:
if pay.payment_order_id:
pay.available_payment_method_line_ids = (
pay.journal_id._get_available_payment_method_lines(pay.payment_type)
pay.payment_order_id.journal_id._get_available_payment_method_lines(
pay.payment_type
)
)
else:
pay.available_payment_method_line_ids = (
Expand Down
7 changes: 7 additions & 0 deletions account_payment_order/models/account_payment_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,4 +237,11 @@ def _prepare_account_payment_vals(self):
vals[
"destination_account_id"
] = self.partner_id.property_account_payable_id.id

transfer_journal = (
self.order_id.payment_mode_id.transfer_journal_id
or self.company_id.transfer_journal_id
)
if transfer_journal:
vals["journal_id"] = transfer_journal.id
return vals
6 changes: 6 additions & 0 deletions account_payment_order/models/account_payment_mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ class AccountPaymentMode(models.Model):
"(other modules can set additional fields to restrict the "
"grouping.)",
)
transfer_journal_id = fields.Many2one(
comodel_name="account.journal",
string="Transfer journal on payment/debit orders",
domain="[('type', '=', 'general')]",
help="Journal to write payment entries when confirming payment/debit orders",
)

@api.onchange("payment_method_id")
def payment_method_id_change(self):
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions account_payment_order/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@

* Ammar Officewala <[email protected]>
* Marçal Isern <[email protected]>
* Luc De Meyer <[email protected]> (https://noviat.com)
6 changes: 5 additions & 1 deletion account_payment_order/readme/USAGE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ You can create a Debit order via the menu Invoicing/Accounting > Customers > Deb

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 order to print.

You can set a transfer journal via Accounting Settings or on the Payment Mode.
If there is no transfer journal, the bank journal itself will be used for the journal entry
created when confirming a payment order.
8 changes: 6 additions & 2 deletions account_payment_order/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Account Payment Order</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:0399e2f98f07d9c21c128885229a0263686b56ece85f6c3fdf4f2a61445b62fe
!! source digest: sha256:e63957550e8783d01276210fe7a10bd1a9d70efdd9d245bcd998f61c89322919
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Mature" src="https://img.shields.io/badge/maturity-Mature-brightgreen.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/bank-payment/tree/16.0/account_payment_order"><img alt="OCA/bank-payment" src="https://img.shields.io/badge/github-OCA%2Fbank--payment-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/bank-payment-16-0/bank-payment-16-0-account_payment_order"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/bank-payment&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module adds support for payment orders and debit orders.</p>
Expand Down Expand Up @@ -406,7 +406,10 @@ <h1><a class="toc-backref" href="#toc-entry-3">Usage</a></h1>
<p>You can create a Payment order via the menu Invoicing/Accounting &gt; Vendors &gt; Payment Orders and then select the move lines to pay.</p>
<p>You can create a Debit order via the menu Invoicing/Accounting &gt; Customers &gt; Debit Orders and then select the move lines to debit.</p>
<p>This module also adds an action <em>Add to Payment Order</em> on supplier invoices and <em>Add to Debit Order</em> on customer invoices.</p>
<p>You can print a Payment order via the menu Invoicing/Accounting &gt; Vendors &gt; Payment Orders and then select the payment oder to print.</p>
<p>You can print a Payment order via the menu Invoicing/Accounting &gt; Vendors &gt; Payment Orders and then select the payment order to print.</p>
<p>You can set a transfer journal via Accounting Settings or on the Payment Mode.
If there is no transfer journal, the bank journal itself will be used for the journal entry
created when confirming a payment order.</p>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-4">Bug Tracker</a></h1>
Expand Down Expand Up @@ -464,6 +467,7 @@ <h2><a class="toc-backref" href="#toc-entry-7">Contributors</a></h2>
</ul>
</li>
<li>Marçal Isern &lt;<a class="reference external" href="mailto:marsal.isern&#64;qubiq.es">marsal.isern&#64;qubiq.es</a>&gt;</li>
<li>Luc De Meyer &lt;<a class="reference external" href="mailto:luc.demeyer&#64;noviat.com">luc.demeyer&#64;noviat.com</a>&gt; (<a class="reference external" href="https://noviat.com">https://noviat.com</a>)</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand Down
1 change: 1 addition & 0 deletions account_payment_order/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
from . import test_payment_order_inbound
from . import test_payment_order_outbound
from . import test_account_payment
from . import test_payment_order_transfer_journal
3 changes: 3 additions & 0 deletions account_payment_order/views/account_payment_mode.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
<field name="payment_type" position="after">
<field name="payment_order_ok" />
</field>
<field name="variable_journal_ids" position="after">
<field name="transfer_journal_id" />
</field>
<group name="main" position="after">
<group
name="payment_order_options"
Expand Down
1 change: 1 addition & 0 deletions account_payment_order/wizard/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
from . import account_payment_line_create
from . import account_invoice_payment_line_multi
from . import res_config_settings
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
<field name="arch" type="xml">
<xpath expr="//div[@id='analytic']" position="after">
<h2>Payment Orders</h2>
<div class="row mt16 o_settings_container" id="pain">
<div class="row mt16 o_settings_container" id="transfer_journal">
<div class="col-xs-12 col-md-6 o_setting_box">
<div class="o_setting_right_pane">
<div class="content-group">
<div class="row mt16">
<label
for="transfer_journal_id"
class="col-md-3 o_light_label"
class="col-md-6 o_light_label"
/>
<field name="transfer_journal_id" />
</div>
Expand Down
84 changes: 0 additions & 84 deletions account_payment_order_transfer_journal/README.rst

This file was deleted.

2 changes: 0 additions & 2 deletions account_payment_order_transfer_journal/__init__.py

This file was deleted.

19 changes: 0 additions & 19 deletions account_payment_order_transfer_journal/__manifest__.py

This file was deleted.

3 changes: 0 additions & 3 deletions account_payment_order_transfer_journal/models/__init__.py

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions account_payment_order_transfer_journal/readme/USAGE.rst

This file was deleted.

Binary file not shown.
Loading

0 comments on commit 4b53d35

Please sign in to comment.