From 01d7361651f2ba73594bd1e6ee2f603161d13390 Mon Sep 17 00:00:00 2001 From: RicardCForgeFlow Date: Mon, 11 Mar 2024 10:17:42 +0100 Subject: [PATCH] [MIG] account_brand: Migration to 17.0 --- account_brand/README.rst | 3 +++ account_brand/__manifest__.py | 2 +- account_brand/models/account_move.py | 11 ++--------- account_brand/readme/USAGE.md | 2 ++ account_brand/static/description/index.html | 14 +++++++++----- account_brand/tests/test_account_move.py | 4 ++-- account_brand/tests/test_brand_mixin.py | 2 +- account_brand/views/account_move_views.xml | 6 ++++-- 8 files changed, 24 insertions(+), 20 deletions(-) diff --git a/account_brand/README.rst b/account_brand/README.rst index f95ec586e..350197e53 100644 --- a/account_brand/README.rst +++ b/account_brand/README.rst @@ -53,6 +53,9 @@ To use this module, you need to: 3. Enter the information and select the brand 4. Print the PDF report. It includes the information of the brand. +To do point 4, the Brand External Report Layout OCA module must be +installed. + Bug Tracker =========== diff --git a/account_brand/__manifest__.py b/account_brand/__manifest__.py index edec0c66e..6725d75f2 100644 --- a/account_brand/__manifest__.py +++ b/account_brand/__manifest__.py @@ -5,7 +5,7 @@ { "name": "Account Brand", "summary": "Send branded invoices and refunds", - "version": "16.0.1.0.0", + "version": "17.0.1.0.0", "category": "Accounting Management", "website": "https://github.com/OCA/brand", "author": "Open Source Integrators," diff --git a/account_brand/models/account_move.py b/account_brand/models/account_move.py index 46e8c96d2..ad0223704 100644 --- a/account_brand/models/account_move.py +++ b/account_brand/models/account_move.py @@ -9,14 +9,7 @@ class AccountMove(models.Model): _name = "account.move" _inherit = ["account.move", "res.brand.mixin"] - brand_id = fields.Many2one( - states={ - "open": [("readonly", True)], - "in_payment": [("readonly", True)], - "paid": [("readonly", True)], - "cancel": [("readonly", True)], - } - ) + brand_id = fields.Many2one() def _is_brand_required(self): self.ensure_one() @@ -59,7 +52,7 @@ def _onchange_partner_id(self): account_id = rec_account if account_id: self.line_ids.filtered( - lambda l, a=account_id: l.account_id.account_type + lambda line, a=account_id: line.account_id.account_type == a.account_type ).update({"account_id": account_id.id}) return res diff --git a/account_brand/readme/USAGE.md b/account_brand/readme/USAGE.md index 9b843078b..3e0706d71 100644 --- a/account_brand/readme/USAGE.md +++ b/account_brand/readme/USAGE.md @@ -4,3 +4,5 @@ To use this module, you need to: 2. Select or create an invoice 3. Enter the information and select the brand 4. Print the PDF report. It includes the information of the brand. + +To do point 4, the Brand External Report Layout OCA module must be installed. diff --git a/account_brand/static/description/index.html b/account_brand/static/description/index.html index 433316250..4410293cb 100644 --- a/account_brand/static/description/index.html +++ b/account_brand/static/description/index.html @@ -1,4 +1,3 @@ - @@ -9,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -275,7 +275,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -301,7 +301,7 @@ span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -402,6 +402,8 @@

Usage

  • Enter the information and select the brand
  • Print the PDF report. It includes the information of the brand.
  • +

    To do point 4, the Brand External Report Layout OCA module must be +installed.

    Bug Tracker

    @@ -442,7 +444,9 @@

    Other credits

    Maintainers

    This module is maintained by the OCA.

    -Odoo Community Association + +Odoo Community Association +

    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.

    diff --git a/account_brand/tests/test_account_move.py b/account_brand/tests/test_account_move.py index f7ed4c058..7c3835e42 100644 --- a/account_brand/tests/test_account_move.py +++ b/account_brand/tests/test_account_move.py @@ -6,7 +6,7 @@ class TestAccountMove(TransactionCase): def setUp(self): - super(TestAccountMove, self).setUp() + super().setUp() self.product = self.env.ref("product.product_product_4") self.account_receivable = self.env["account.account"].create( { @@ -63,7 +63,7 @@ def setUp(self): def _get_receivable_account(self, move): return self.move.line_ids.filtered( - lambda l: l.account_id.account_type == "asset_receivable" + lambda line: line.account_id.account_type == "asset_receivable" ).account_id def test_on_change_partner_id(self): diff --git a/account_brand/tests/test_brand_mixin.py b/account_brand/tests/test_brand_mixin.py index 9c8443573..b87635ad7 100644 --- a/account_brand/tests/test_brand_mixin.py +++ b/account_brand/tests/test_brand_mixin.py @@ -11,7 +11,7 @@ class TestBrandMixin(TransactionCase): def setUp(self): - super(TestBrandMixin, self).setUp() + super().setUp() self.partner = self.env.user.partner_id self.company = self.env.user.company_id self.other_company = self.env["res.company"].create( diff --git a/account_brand/views/account_move_views.xml b/account_brand/views/account_move_views.xml index cbdf8752a..bc402fe57 100644 --- a/account_brand/views/account_move_views.xml +++ b/account_brand/views/account_move_views.xml @@ -2,13 +2,15 @@ + account.move.form - account_brand account.move - +