Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
54e681b
[12.0][ADD] - Add contract_brand module
sbejaoui Sep 9, 2019
4a34bcb
[12.0][FIX] - Fix pylint
sbejaoui Nov 5, 2019
266b5f7
[UPD] Update contract_brand.pot
oca-travis Nov 16, 2019
fc135c8
[UPD] README.rst
OCA-git-bot Nov 16, 2019
404062a
[ADD] icon.png
OCA-git-bot Nov 16, 2019
1625660
[FIX] Correctly set Brand on Invoices created from Contracts
dreispt Feb 9, 2020
0e5fdcf
contract_brand 12.0.1.0.1
OCA-git-bot Feb 9, 2020
d7caf48
[12.0][IMP] - contract_brand search view: group by brand
sbejaoui Mar 6, 2020
1d08aa5
[UPD] Update contract_brand.pot
oca-travis Mar 9, 2020
b4f9c0a
contract_brand 12.0.1.0.2
OCA-git-bot Mar 9, 2020
cb001d3
[IMP] - set contract line analytic account at brand change
sbejaoui Dec 30, 2019
896869f
[IMP] - Add unit tests
sbejaoui Dec 30, 2019
6ce7cd8
contract_brand 12.0.1.0.3
OCA-git-bot Oct 23, 2020
26e1f6a
[FIX] Invoice account_id
qgroulard Jun 16, 2020
fd6070e
contract_brand 12.0.1.1.0
OCA-git-bot Oct 23, 2020
94a7736
[13.0][MIG] - migration contract_brand
sbejaoui Oct 24, 2020
1e4057e
[UPD] Update contract_brand.pot
oca-travis Oct 26, 2020
e1ffd51
[UPD] README.rst
OCA-git-bot Oct 26, 2020
2a39ed5
[MIG] - contract_brand migration 14.0
sbejaoui Mar 21, 2022
651fdb5
[MIG] - contract_brand migration 15.0
sbejaoui Mar 21, 2022
8635622
[UPD] Update contract_brand.pot
Mar 21, 2022
013168f
[UPD] README.rst
OCA-git-bot Mar 21, 2022
34bb678
[FIX] - remove usless test import
sbejaoui Dec 12, 2022
c04e714
[UPD] README.rst
OCA-git-bot Sep 4, 2023
ae20ede
Added translation using Weblate (Spanish)
Ivorra78 Feb 28, 2024
5c67d57
Translated using Weblate (Spanish)
Ivorra78 Feb 28, 2024
37a09f2
[IMP] contract_brand: pre-commit auto fixes
pcastelovigo Dec 9, 2025
7148026
[MIG] contract_brand: Migration to 16.0
pcastelovigo Dec 9, 2025
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
86 changes: 86 additions & 0 deletions contract_brand/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
==============
Contract Brand
==============

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

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

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

This module allows you to manage branded contracts. It adds a brand
field on the contract and propagate the value on the invoices.

**Table of contents**

.. contents::
:local:

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:%20contract_brand%0Aversion:%2016.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 souheil.bejaoui@acsone.eu
- Marie Lejeune marie.lejeune@acsone.eu

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-sbejaoui| image:: https://github.com/sbejaoui.png?size=40px
:target: https://github.com/sbejaoui
:alt: sbejaoui

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-sbejaoui|

This module is part of the `OCA/brand <https://github.com/OCA/brand/tree/16.0/contract_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 contract_brand/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
17 changes: 17 additions & 0 deletions contract_brand/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2019 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Contract Brand",
"summary": """
This module allows you to manage branded contracts.
It adds a brand field on the contract and propagate the value on the
invoices.""",
"version": "16.0.1.0.0",
"license": "AGPL-3",
"author": "ACSONE SA/NV," "Odoo Community Association (OCA)",
"website": "https://github.com/OCA/brand",
"depends": ["contract", "account_brand", "analytic_brand"],
"data": ["views/contract.xml"],
"maintainers": ["sbejaoui"],
}
50 changes: 50 additions & 0 deletions contract_brand/i18n/contract_brand.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * contract_brand
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.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: contract_brand
#: model:ir.model.fields,field_description:contract_brand.field_contract_contract__brand_id
#: model_terms:ir.ui.view,arch_db:contract_brand.contract_contract_search_view
msgid "Brand"
msgstr ""

#. module: contract_brand
#: model:ir.model.fields,field_description:contract_brand.field_contract_contract__brand_use_level
msgid "Brand Use Level"
msgstr ""

#. module: contract_brand
#: model:ir.model.fields,help:contract_brand.field_contract_contract__brand_id
msgid "Brand to use for this sale"
msgstr ""

#. module: contract_brand
#: model:ir.model.fields,field_description:contract_brand.field_contract_contract__company_id
msgid "Company"
msgstr ""

#. module: contract_brand
#: model:ir.model,name:contract_brand.model_contract_contract
msgid "Contract"
msgstr ""

#. module: contract_brand
#: model:ir.model,name:contract_brand.model_contract_line
msgid "Contract Line"
msgstr ""

#. module: contract_brand
#: model:ir.model.fields,field_description:contract_brand.field_contract_contract__is_brand_required
msgid "Is Brand Required"
msgstr ""
53 changes: 53 additions & 0 deletions contract_brand/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * contract_brand
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-02-29 00:13+0000\n"
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\n"
"Language-Team: none\n"
"Language: es\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 4.17\n"

#. module: contract_brand
#: model:ir.model.fields,field_description:contract_brand.field_contract_contract__brand_id
#: model_terms:ir.ui.view,arch_db:contract_brand.contract_contract_search_view
msgid "Brand"
msgstr "Marca"

#. module: contract_brand
#: model:ir.model.fields,field_description:contract_brand.field_contract_contract__brand_use_level
msgid "Brand Use Level"
msgstr "Nivel de Uso de la Marca"

#. module: contract_brand
#: model:ir.model.fields,help:contract_brand.field_contract_contract__brand_id
msgid "Brand to use for this sale"
msgstr "Marca a utilizar para esta venta"

#. module: contract_brand
#: model:ir.model.fields,field_description:contract_brand.field_contract_contract__company_id
msgid "Company"
msgstr "Compañía"

#. module: contract_brand
#: model:ir.model,name:contract_brand.model_contract_contract
msgid "Contract"
msgstr "Contrato"

#. module: contract_brand
#: model:ir.model,name:contract_brand.model_contract_line
msgid "Contract Line"
msgstr "Línea de contrato"

#. module: contract_brand
#: model:ir.model.fields,field_description:contract_brand.field_contract_contract__is_brand_required
msgid "Is Brand Required"
msgstr "La marca es obligatoria"
2 changes: 2 additions & 0 deletions contract_brand/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import contract
from . import contract_line
16 changes: 16 additions & 0 deletions contract_brand/models/contract.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2019 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import models


class ContractContract(models.Model):

_name = "contract.contract"
_inherit = ["contract.contract", "res.brand.mixin"]

def _prepare_invoice(self, date_invoice, journal=None):
self.ensure_one()
values = super()._prepare_invoice(date_invoice, journal)
values["brand_id"] = self.brand_id.id
return values
22 changes: 22 additions & 0 deletions contract_brand/models/contract_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2025 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import api, models


class ContractLine(models.Model):
_inherit = "contract.line"

@api.depends("contract_id.brand_id")
def _compute_analytic_distribution(self):
res = super()._compute_analytic_distribution()
for rec in self.filtered(lambda line: line.contract_id.brand_id):
brand_analytic_distribution = (
rec.contract_id.brand_id.analytic_distribution or {}
)
if brand_analytic_distribution:
line_analytic_distribution = rec.analytic_distribution or {}
rec.analytic_distribution = (
line_analytic_distribution | brand_analytic_distribution
)
return res
3 changes: 3 additions & 0 deletions contract_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"
2 changes: 2 additions & 0 deletions contract_brand/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Souheil Bejaoui <souheil.bejaoui@acsone.eu>
- Marie Lejeune <marie.lejeune@acsone.eu>
2 changes: 2 additions & 0 deletions contract_brand/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module allows you to manage branded contracts. It adds a brand field on
the contract and propagate the value on the invoices.
Binary file added contract_brand/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading