-
-
Notifications
You must be signed in to change notification settings - Fork 535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[18.0][ADD] account_payment_base_oca: New base module for OCA/bank-payment #1401
Draft
alexis-via
wants to merge
4
commits into
OCA:18.0
Choose a base branch
from
akretion:18-add-account_payment_base_oca
base: 18.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
9da52f0
[ADD] account_payment_base_oca: New base module for OCA/bank-payment
alexis-via fd0aa9f
[IMP] account_payment_base_oca: add selectable boolean field
alexis-via 9c56f6b
[UDP] account_payment_base_oca: Replace alternative_journal_ids by va…
alexis-via b2312bb
[DON'T MERGE] add test-requirements.txt
alexis-via File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
======================== | ||
Account Payment Base OCA | ||
======================== | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:398fe25e1ed0988a7a0504f68878755aa77b7b87532718ca8dfaa344c31b88e1 | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
|
||
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png | ||
:target: https://odoo-community.org/page/development-status | ||
:alt: Beta | ||
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png | ||
: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/18.0/account_payment_base_oca | ||
: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-18-0/bank-payment-18-0-account_payment_base_oca | ||
: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=18.0 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
This is the new base module for the OCA **bank-payment** project. This | ||
module has been developped for Odoo 18 to adapt the OCA bank-payment | ||
stack to the new native payment mode object of Odoo. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
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_base_oca%0Aversion:%2018.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 | ||
------- | ||
|
||
* Akretion | ||
|
||
Contributors | ||
------------ | ||
|
||
- Alexis de Lattre <[email protected]> | ||
- Eric Lembregts <[email protected]> | ||
- Andrea Stirpe <[email protected]> | ||
- Marçal Isern <[email protected]> | ||
- Miquel Alzanillas <[email protected]> | ||
- Raphaël Valyi | ||
- Stefan Rijnhart (Therp) | ||
- Alexandre Fayolle | ||
- Stéphane Bidoul <[email protected]> | ||
- Danimar Ribeiro | ||
- Angel Moya <[email protected]> | ||
- `Tecnativa <https://www.tecnativa.com>`__: | ||
|
||
- Pedro M. Baeza | ||
- Carlos Dauden | ||
- Víctor Martínez | ||
|
||
- `DynApps <https://www.dynapps.be>`__: | ||
|
||
- Raf Ven <[email protected]> | ||
|
||
Maintainers | ||
----------- | ||
|
||
This module is maintained by the OCA. | ||
|
||
.. image:: https://odoo-community.org/logo.png | ||
:alt: Odoo Community Association | ||
:target: https://odoo-community.org | ||
|
||
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. | ||
|
||
.. |maintainer-alexis-via| image:: https://github.com/alexis-via.png?size=40px | ||
:target: https://github.com/alexis-via | ||
:alt: alexis-via | ||
|
||
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__: | ||
|
||
|maintainer-alexis-via| | ||
|
||
This module is part of the `OCA/bank-payment <https://github.com/OCA/bank-payment/tree/18.0/account_payment_base_oca>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from . import models | ||
from . import reports |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Copyright 2024-2025 Akretion France (http://www.akretion.com/) | ||
# @author: Alexis de Lattre <[email protected]> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
"name": "Account Payment Base OCA", | ||
"version": "18.0.1.0.0", | ||
"category": "Accounting", | ||
"license": "AGPL-3", | ||
"summary": "OCA extensions to native payment objects of Odoo", | ||
"author": "Akretion,Odoo Community Association (OCA)", | ||
"maintainers": ["alexis-via"], | ||
"development_status": "Beta", | ||
"website": "https://github.com/OCA/bank-payment", | ||
"depends": ["account"], | ||
"data": [ | ||
"security/ir.model.access.csv", | ||
"views/account_payment_method.xml", | ||
"views/account_payment_method_line.xml", | ||
"views/account_move.xml", | ||
"reports/account_invoice_report_view.xml", | ||
"security/ir_rule.xml", | ||
], | ||
"demo": ["demo/demo.xml"], | ||
"installable": True, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo noupdate="1"> | ||
<record id="bank_qonto" model="res.bank"> | ||
<field name="name">Qonto</field> | ||
<field name="bic">QNTOFRP1XXX</field> | ||
<field name="street">20 bis rue La Fayette</field> | ||
<field name="zip">75009</field> | ||
<field name="city">Paris</field> | ||
<field name="country" ref="base.fr" /> | ||
</record> | ||
<record id="bank_la_banque_postale" model="res.bank"> | ||
<field name="name">La Banque Postale</field> | ||
<field name="bic">PSSTFRPPXXX</field> | ||
<field name="street">115 rue de Sèvres</field> | ||
<field name="zip">75007</field> | ||
<field name="city">Paris</field> | ||
<field name="country" ref="base.fr" /> | ||
</record> | ||
<record id="bank_societe_generale" model="res.bank"> | ||
<field name="name">Société Générale</field> | ||
<field name="bic">SOGEFRPPXXX</field> | ||
<field name="street">1 avenue du Roi Fabien 1er</field> | ||
<field name="zip">75008</field> | ||
<field name="city">Paris</field> | ||
<field name="country" ref="base.fr" /> | ||
</record> | ||
<record id="bank_fortis" model="res.bank"> | ||
<field name="name">BNP Paribas Fortis Charleroi</field> | ||
<field name="bic">GEBABEBB03A</field> | ||
<field name="city">Charleroi</field> | ||
<field name="country" ref="base.be" /> | ||
</record> | ||
<record id="main_company_iban" model="res.partner.bank"> | ||
<field name="acc_number">FR76 4242 4242 4242 4242 4242 424</field> | ||
<field name="bank_id" ref="bank_la_banque_postale" /> | ||
<field name="partner_id" ref="base.main_partner" /> | ||
</record> | ||
<record id="main_company_iban2" model="res.partner.bank"> | ||
<field name="acc_number">FR20 1242 1242 1242 1242 1242 124</field> | ||
<field name="bank_id" ref="bank_societe_generale" /> | ||
<field name="partner_id" ref="base.main_partner" /> | ||
</record> | ||
<record id="res_partner_12_iban" model="res.partner.bank"> | ||
<field name="acc_number">FR66 1212 1212 1212 1212 1212 121</field> | ||
<field name="bank_id" ref="bank_qonto" /> | ||
<field name="partner_id" ref="base.res_partner_12" /> | ||
</record> | ||
<record id="res_partner_2_iban" model="res.partner.bank"> | ||
<field name="acc_number">BE96 9988 7766 5544</field> | ||
<field name="bank_id" ref="bank_fortis" /> | ||
<field name="partner_id" ref="base.res_partner_2" /> | ||
</record> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from . import account_payment_method | ||
from . import account_payment_method_line | ||
from . import account_move | ||
from . import res_partner | ||
from . import res_partner_bank | ||
from . import res_bank |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright 2024-2025 Akretion France (https://www.akretion.com/) | ||
# @author: Alexis de Lattre <[email protected]> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import fields, models | ||
|
||
|
||
class AccountMove(models.Model): | ||
_inherit = "account.move" | ||
|
||
bank_account_required = fields.Boolean( | ||
related="preferred_payment_method_line_id.payment_method_id.bank_account_required", | ||
) | ||
payment_method_code = fields.Char( | ||
related="preferred_payment_method_line_id.payment_method_id.code", store=True | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Copyright 2016-2025 Akretion France (https://www.akretion.com/) | ||
# @author: Alexis de Lattre <[email protected]> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo import api, fields, models | ||
|
||
|
||
class AccountPaymentMethod(models.Model): | ||
_inherit = "account.payment.method" | ||
|
||
# native field, we just inherit string and help | ||
code = fields.Char( | ||
string="Code (do not modify)", | ||
help="This code is used in the source code of the Odoo module that handles " | ||
"this payment method. Therefore, if you change it, " | ||
"the generation of the payment file may fail.", | ||
) | ||
active = fields.Boolean(default=True) | ||
bank_account_required = fields.Boolean( | ||
help="Activate this option if this payment method requires you to " | ||
"know the bank account number of your customer or supplier." | ||
) | ||
# add the one2many field which is not native | ||
line_ids = fields.One2many( | ||
comodel_name="account.payment.method.line", | ||
inverse_name="payment_method_id", | ||
string="Payment Methods", | ||
) | ||
|
||
@api.depends("code", "name", "payment_type") | ||
def _compute_display_name(self): | ||
for method in self: | ||
name = f"[{method.code}] {method.name} ({method.payment_type})" | ||
method.display_name = name |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would need a computation script as the table account.move can be heavy on some projects