Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 100 additions & 0 deletions account_payment_mode_brand/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

==========================
Account Payment Mode Brand
==========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:00cb33c0ef501c88b031a81d90cc9e2b0e63a4ea2f50266638774714bc1483dd
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/license-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%2Fbrand-lightgray.png?logo=github
:target: https://github.com/OCA/brand/tree/19.0/account_payment_mode_brand
:alt: OCA/brand
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/brand-19-0/brand-19-0-account_payment_mode_brand
: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/brand&target_branch=19.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This addon define allowed payment mode per brand.

**Table of contents**

.. contents::
:local:

Usage
=====

To use this module, you need to:

1. Define the brand use level (see brand module documentation)

2. Go to Settings > Users & Companies > Brands

3. Select a brand

4. Define allowed payment modes

5. Create a new invoice

1. Select the brand
2. Select a payment mode

The payment mode list is filtered with the brand allowed payment modes.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/brand/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/brand/issues/new?body=module:%20account_payment_mode_brand%0Aversion:%2019.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

Contributors
------------

- Souheil Bejaoui <[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.

This module is part of the `OCA/brand <https://github.com/OCA/brand/tree/19.0/account_payment_mode_brand>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions account_payment_mode_brand/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
22 changes: 22 additions & 0 deletions account_payment_mode_brand/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2020 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Account Payment Mode Brand",
"summary": """
This addon define allowed payment mode per brand""",
"version": "19.0.1.0.0",
"license": "AGPL-3",
"author": "ACSONE SA/NV,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/brand",
"depends": [
"brand",
"account_brand",
"account_payment_mode",
"base_view_inheritance_extension",
],
"data": [
"views/res_brand.xml",
"views/account_move.xml",
],
}
37 changes: 37 additions & 0 deletions account_payment_mode_brand/i18n/account_payment_mode_brand.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_payment_mode_brand
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: account_payment_mode_brand
#: model:ir.model.fields,field_description:account_payment_mode_brand.field_account_bank_statement_line__allowed_payment_mode_ids
#: model:ir.model.fields,field_description:account_payment_mode_brand.field_account_move__allowed_payment_mode_ids
#: model:ir.model.fields,field_description:account_payment_mode_brand.field_contract_contract__allowed_payment_mode_ids
#: model:ir.model.fields,field_description:account_payment_mode_brand.field_res_brand_mixin__allowed_payment_mode_ids
msgid "Allowed Payment Mode"
msgstr ""

#. module: account_payment_mode_brand
#: model:ir.model.fields,field_description:account_payment_mode_brand.field_res_brand__allowed_payment_mode_ids
msgid "Allowed payment modes"
msgstr ""

#. module: account_payment_mode_brand
#: model:ir.model,name:account_payment_mode_brand.model_res_brand
msgid "Brand"
msgstr ""

#. module: account_payment_mode_brand
#: model:ir.model,name:account_payment_mode_brand.model_res_brand_mixin
msgid "Brand Mixin"
msgstr ""
40 changes: 40 additions & 0 deletions account_payment_mode_brand/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_payment_mode_brand
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2025-07-30 14:25+0000\n"
"Last-Translator: mymage <[email protected]>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.10.4\n"

#. module: account_payment_mode_brand
#: model:ir.model.fields,field_description:account_payment_mode_brand.field_account_bank_statement_line__allowed_payment_mode_ids
#: model:ir.model.fields,field_description:account_payment_mode_brand.field_account_move__allowed_payment_mode_ids
#: model:ir.model.fields,field_description:account_payment_mode_brand.field_contract_contract__allowed_payment_mode_ids
#: model:ir.model.fields,field_description:account_payment_mode_brand.field_res_brand_mixin__allowed_payment_mode_ids
msgid "Allowed Payment Mode"
msgstr "Metodo di pagamento consentito"

#. module: account_payment_mode_brand
#: model:ir.model.fields,field_description:account_payment_mode_brand.field_res_brand__allowed_payment_mode_ids
msgid "Allowed payment modes"
msgstr "Metodi di pagamento consentiti"

#. module: account_payment_mode_brand
#: model:ir.model,name:account_payment_mode_brand.model_res_brand
msgid "Brand"
msgstr "Marca"

#. module: account_payment_mode_brand
#: model:ir.model,name:account_payment_mode_brand.model_res_brand_mixin
msgid "Brand Mixin"
msgstr "Mixin marca"
2 changes: 2 additions & 0 deletions account_payment_mode_brand/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import res_brand
from . import res_brand_mixin
12 changes: 12 additions & 0 deletions account_payment_mode_brand/models/res_brand.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copyright 2020 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models


class ResBrand(models.Model):
_inherit = "res.brand"

allowed_payment_mode_ids = fields.Many2many(
comodel_name="account.payment.mode", string="Allowed payment modes"
)
24 changes: 24 additions & 0 deletions account_payment_mode_brand/models/res_brand_mixin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2020 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import api, fields, models


class ResBrandMixin(models.AbstractModel):
_inherit = "res.brand.mixin"

allowed_payment_mode_ids = fields.Many2many(
comodel_name="account.payment.mode",
compute="_compute_allowed_payment_mode_ids",
)

@api.depends("brand_id")
def _compute_allowed_payment_mode_ids(self):
all_payment_mode = self.env["account.payment.mode"].search(
[("active", "=", True)]
)
for rec in self:
if rec.brand_id and rec.brand_id.allowed_payment_mode_ids:
rec.allowed_payment_mode_ids = rec.brand_id.allowed_payment_mode_ids
else:
rec.allowed_payment_mode_ids = all_payment_mode
3 changes: 3 additions & 0 deletions account_payment_mode_brand/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
1 change: 1 addition & 0 deletions account_payment_mode_brand/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Souheil Bejaoui \<[email protected]\>
1 change: 1 addition & 0 deletions account_payment_mode_brand/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This addon define allowed payment mode per brand.
15 changes: 15 additions & 0 deletions account_payment_mode_brand/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
To use this module, you need to:

1. Define the brand use level (see brand module documentation)

2. Go to Settings \> Users & Companies \> Brands

3. Select a brand

4. Define allowed payment modes

5. Create a new invoice
1. Select the brand
2. Select a payment mode

The payment mode list is filtered with the brand allowed payment modes.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading