diff --git a/README.md b/README.md index f3b18e97d..84cd25075 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ addon | version | maintainers | summary [brand_external_report_layout](brand_external_report_layout/) | 15.0.1.0.0 | [![sbejaoui](https://github.com/sbejaoui.png?size=30px)](https://github.com/sbejaoui) | This module allows you to have a different layout by brand for your external reports. [contract_brand](contract_brand/) | 15.0.1.0.0 | [![sbejaoui](https://github.com/sbejaoui.png?size=30px)](https://github.com/sbejaoui) | This module allows you to manage branded contracts. It adds a brand field on the contract and propagate the value on the invoices. [product_brand](product_brand/) | 15.0.1.0.0 | | Product Brand Manager -[sale_brand](sale_brand/) | 15.0.1.0.1 | [![osi-scampbell](https://github.com/osi-scampbell.png?size=30px)](https://github.com/osi-scampbell) [![sbejaoui](https://github.com/sbejaoui.png?size=30px)](https://github.com/sbejaoui) | Send branded sales orders +[sale_brand](sale_brand/) | 15.0.1.0.3 | [![osi-scampbell](https://github.com/osi-scampbell.png?size=30px)](https://github.com/osi-scampbell) [![sbejaoui](https://github.com/sbejaoui.png?size=30px)](https://github.com/sbejaoui) | Send branded sales orders [//]: # (end addons) diff --git a/sale_brand/__manifest__.py b/sale_brand/__manifest__.py index 029d4e653..1f13c4661 100644 --- a/sale_brand/__manifest__.py +++ b/sale_brand/__manifest__.py @@ -4,13 +4,17 @@ { "name": "Sale Brand", "summary": "Send branded sales orders", - "version": "15.0.1.0.1", + "version": "15.0.1.0.3", "category": "Sales Management", "website": "https://github.com/OCA/brand", "author": "Open Source Integrators, Odoo Community Association (OCA)", "license": "AGPL-3", "depends": ["sale", "brand", "account_brand", "analytic_brand"], - "data": ["views/sale_views.xml", "views/crm_team_views.xml"], + "data": [ + "views/sale_views.xml", + "views/crm_team_views.xml", + "views/res_brand.xml", + ], "installable": True, "development_status": "Beta", "maintainers": ["osi-scampbell", "sbejaoui"], diff --git a/sale_brand/i18n/es_AR.po b/sale_brand/i18n/es_AR.po index 67f7cf7c1..09f7d8e57 100644 --- a/sale_brand/i18n/es_AR.po +++ b/sale_brand/i18n/es_AR.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 15.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2022-09-05 07:07+0000\n" +"PO-Revision-Date: 2022-11-02 05:44+0000\n" "Last-Translator: Ignacio Buioli \n" "Language-Team: none\n" "Language: es_AR\n" @@ -14,9 +14,20 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.3.2\n" +"X-Generator: Weblate 4.14.1\n" #. module: sale_brand +#: model:ir.model.fields.selection,name:sale_brand.selection__res_brand__terms_type__plain +msgid "Add a Note" +msgstr "Añadir una Nota" + +#. module: sale_brand +#: model:ir.model.fields.selection,name:sale_brand.selection__res_brand__terms_type__html +msgid "Add a link to a Web Page" +msgstr "Añadir un vínculo a una Página Web" + +#. module: sale_brand +#: model:ir.model,name:sale_brand.model_res_brand #: model:ir.model.fields,field_description:sale_brand.field_crm_team__brand_id #: model:ir.model.fields,field_description:sale_brand.field_sale_order__brand_id msgid "Brand" @@ -37,6 +48,21 @@ msgstr "Marca a utilizar para este venta" msgid "Company" msgstr "Compañía" +#. module: sale_brand +#: model:ir.model.fields,field_description:sale_brand.field_res_brand__invoice_terms +msgid "Default Terms and Conditions" +msgstr "Términos y Condiciones Predeterminados" + +#. module: sale_brand +#: model_terms:ir.ui.view,arch_db:sale_brand.res_brand_sale_form_view +msgid "Insert your terms & conditions here..." +msgstr "Inserte sus términos y condiciones acá..." + +#. module: sale_brand +#: model:ir.model.fields,field_description:sale_brand.field_res_brand__terms_url +msgid "Preview terms" +msgstr "Previsualización de términos" + #. module: sale_brand #: model:ir.model,name:sale_brand.model_sale_advance_payment_inv msgid "Sales Advance Payment Invoice" @@ -51,3 +77,29 @@ msgstr "Pedido de Ventas" #: model:ir.model,name:sale_brand.model_crm_team msgid "Sales Team" msgstr "Equipo de Ventas" + +#. module: sale_brand +#: model:ir.model.fields,field_description:sale_brand.field_res_brand__terms_type +msgid "Terms & Conditions format" +msgstr "Formato de Términos y Condiciones" + +#. module: sale_brand +#: code:addons/sale_brand/models/sale_order.py:0 +#, python-format +msgid "Terms & Conditions: %s" +msgstr "Términos y Condiciones: %s" + +#. module: sale_brand +#: model:ir.model.fields,field_description:sale_brand.field_res_brand__terms_page +msgid "Terms Page" +msgstr "Página de Términos" + +#. module: sale_brand +#: model_terms:ir.ui.view,arch_db:sale_brand.res_brand_sale_form_view +msgid "Terms page" +msgstr "Página de términos" + +#. module: sale_brand +#: model:ir.model.fields,help:sale_brand.field_res_brand__terms_page +msgid "page on the brands site where the terms can be found" +msgstr "página en el sitio de las marcas donde pueden encontrarse los términos" diff --git a/sale_brand/i18n/fr_FR.po b/sale_brand/i18n/fr_FR.po index 145c368f5..4a8d0eaff 100644 --- a/sale_brand/i18n/fr_FR.po +++ b/sale_brand/i18n/fr_FR.po @@ -17,6 +17,17 @@ msgstr "" "X-Generator: Weblate 4.3.2\n" #. module: sale_brand +#: model:ir.model.fields.selection,name:sale_brand.selection__res_brand__terms_type__plain +msgid "Add a Note" +msgstr "" + +#. module: sale_brand +#: model:ir.model.fields.selection,name:sale_brand.selection__res_brand__terms_type__html +msgid "Add a link to a Web Page" +msgstr "" + +#. module: sale_brand +#: model:ir.model,name:sale_brand.model_res_brand #: model:ir.model.fields,field_description:sale_brand.field_crm_team__brand_id #: model:ir.model.fields,field_description:sale_brand.field_sale_order__brand_id msgid "Brand" @@ -38,25 +49,19 @@ msgid "Company" msgstr "Société" #. module: sale_brand -#: model:ir.model.fields,field_description:sale_brand.field_crm_team__display_name -#: model:ir.model.fields,field_description:sale_brand.field_sale_advance_payment_inv__display_name -#: model:ir.model.fields,field_description:sale_brand.field_sale_order__display_name -msgid "Display Name" -msgstr "Nom affiché" +#: model:ir.model.fields,field_description:sale_brand.field_res_brand__invoice_terms +msgid "Default Terms and Conditions" +msgstr "" #. module: sale_brand -#: model:ir.model.fields,field_description:sale_brand.field_crm_team__id -#: model:ir.model.fields,field_description:sale_brand.field_sale_advance_payment_inv__id -#: model:ir.model.fields,field_description:sale_brand.field_sale_order__id -msgid "ID" -msgstr "ID" +#: model_terms:ir.ui.view,arch_db:sale_brand.res_brand_sale_form_view +msgid "Insert your terms & conditions here..." +msgstr "" #. module: sale_brand -#: model:ir.model.fields,field_description:sale_brand.field_crm_team____last_update -#: model:ir.model.fields,field_description:sale_brand.field_sale_advance_payment_inv____last_update -#: model:ir.model.fields,field_description:sale_brand.field_sale_order____last_update -msgid "Last Modified on" -msgstr "Dernière modif le" +#: model:ir.model.fields,field_description:sale_brand.field_res_brand__terms_url +msgid "Preview terms" +msgstr "" #. module: sale_brand #: model:ir.model,name:sale_brand.model_sale_advance_payment_inv @@ -72,3 +77,38 @@ msgstr "Commande de vente" #: model:ir.model,name:sale_brand.model_crm_team msgid "Sales Team" msgstr "Equipe commerciale" + +#. module: sale_brand +#: model:ir.model.fields,field_description:sale_brand.field_res_brand__terms_type +msgid "Terms & Conditions format" +msgstr "" + +#. module: sale_brand +#: code:addons/sale_brand/models/sale_order.py:0 +#, python-format +msgid "Terms & Conditions: %s" +msgstr "" + +#. module: sale_brand +#: model:ir.model.fields,field_description:sale_brand.field_res_brand__terms_page +msgid "Terms Page" +msgstr "" + +#. module: sale_brand +#: model_terms:ir.ui.view,arch_db:sale_brand.res_brand_sale_form_view +msgid "Terms page" +msgstr "" + +#. module: sale_brand +#: model:ir.model.fields,help:sale_brand.field_res_brand__terms_page +msgid "page on the brands site where the terms can be found" +msgstr "" + +#~ msgid "Display Name" +#~ msgstr "Nom affiché" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Dernière modif le" diff --git a/sale_brand/i18n/hr.po b/sale_brand/i18n/hr.po index ea2dc930a..f91e27cd7 100644 --- a/sale_brand/i18n/hr.po +++ b/sale_brand/i18n/hr.po @@ -18,16 +18,52 @@ msgstr "" "X-Generator: Weblate 3.8\n" #. module: sale_brand +#: model:ir.model.fields.selection,name:sale_brand.selection__res_brand__terms_type__plain +msgid "Add a Note" +msgstr "" + +#. module: sale_brand +#: model:ir.model.fields.selection,name:sale_brand.selection__res_brand__terms_type__html +msgid "Add a link to a Web Page" +msgstr "" + +#. module: sale_brand +#: model:ir.model,name:sale_brand.model_res_brand #: model:ir.model.fields,field_description:sale_brand.field_crm_team__brand_id #: model:ir.model.fields,field_description:sale_brand.field_sale_order__brand_id msgid "Brand" msgstr "Brand" +#. module: sale_brand +#: model:ir.model.fields,field_description:sale_brand.field_sale_order__brand_use_level +msgid "Brand Use Level" +msgstr "" + #. module: sale_brand #: model:ir.model.fields,help:sale_brand.field_sale_order__brand_id msgid "Brand to use for this sale" msgstr "Za ovu prodaju koristiti brand" +#. module: sale_brand +#: model:ir.model.fields,field_description:sale_brand.field_sale_order__company_id +msgid "Company" +msgstr "" + +#. module: sale_brand +#: model:ir.model.fields,field_description:sale_brand.field_res_brand__invoice_terms +msgid "Default Terms and Conditions" +msgstr "" + +#. module: sale_brand +#: model_terms:ir.ui.view,arch_db:sale_brand.res_brand_sale_form_view +msgid "Insert your terms & conditions here..." +msgstr "" + +#. module: sale_brand +#: model:ir.model.fields,field_description:sale_brand.field_res_brand__terms_url +msgid "Preview terms" +msgstr "" + #. module: sale_brand #: model:ir.model,name:sale_brand.model_sale_advance_payment_inv msgid "Sales Advance Payment Invoice" @@ -43,3 +79,29 @@ msgstr "Ponuda" #: model:ir.model,name:sale_brand.model_crm_team msgid "Sales Team" msgstr "" + +#. module: sale_brand +#: model:ir.model.fields,field_description:sale_brand.field_res_brand__terms_type +msgid "Terms & Conditions format" +msgstr "" + +#. module: sale_brand +#: code:addons/sale_brand/models/sale_order.py:0 +#, python-format +msgid "Terms & Conditions: %s" +msgstr "" + +#. module: sale_brand +#: model:ir.model.fields,field_description:sale_brand.field_res_brand__terms_page +msgid "Terms Page" +msgstr "" + +#. module: sale_brand +#: model_terms:ir.ui.view,arch_db:sale_brand.res_brand_sale_form_view +msgid "Terms page" +msgstr "" + +#. module: sale_brand +#: model:ir.model.fields,help:sale_brand.field_res_brand__terms_page +msgid "page on the brands site where the terms can be found" +msgstr "" diff --git a/sale_brand/i18n/it.po b/sale_brand/i18n/it.po index 7ffc91259..ee7261851 100644 --- a/sale_brand/i18n/it.po +++ b/sale_brand/i18n/it.po @@ -17,6 +17,17 @@ msgstr "" "X-Generator: Weblate 4.3.2\n" #. module: sale_brand +#: model:ir.model.fields.selection,name:sale_brand.selection__res_brand__terms_type__plain +msgid "Add a Note" +msgstr "" + +#. module: sale_brand +#: model:ir.model.fields.selection,name:sale_brand.selection__res_brand__terms_type__html +msgid "Add a link to a Web Page" +msgstr "" + +#. module: sale_brand +#: model:ir.model,name:sale_brand.model_res_brand #: model:ir.model.fields,field_description:sale_brand.field_crm_team__brand_id #: model:ir.model.fields,field_description:sale_brand.field_sale_order__brand_id msgid "Brand" @@ -38,25 +49,19 @@ msgid "Company" msgstr "Azienda" #. module: sale_brand -#: model:ir.model.fields,field_description:sale_brand.field_crm_team__display_name -#: model:ir.model.fields,field_description:sale_brand.field_sale_advance_payment_inv__display_name -#: model:ir.model.fields,field_description:sale_brand.field_sale_order__display_name -msgid "Display Name" -msgstr "Nome visualizzato" +#: model:ir.model.fields,field_description:sale_brand.field_res_brand__invoice_terms +msgid "Default Terms and Conditions" +msgstr "" #. module: sale_brand -#: model:ir.model.fields,field_description:sale_brand.field_crm_team__id -#: model:ir.model.fields,field_description:sale_brand.field_sale_advance_payment_inv__id -#: model:ir.model.fields,field_description:sale_brand.field_sale_order__id -msgid "ID" -msgstr "ID" +#: model_terms:ir.ui.view,arch_db:sale_brand.res_brand_sale_form_view +msgid "Insert your terms & conditions here..." +msgstr "" #. module: sale_brand -#: model:ir.model.fields,field_description:sale_brand.field_crm_team____last_update -#: model:ir.model.fields,field_description:sale_brand.field_sale_advance_payment_inv____last_update -#: model:ir.model.fields,field_description:sale_brand.field_sale_order____last_update -msgid "Last Modified on" -msgstr "Ultima Modifica il" +#: model:ir.model.fields,field_description:sale_brand.field_res_brand__terms_url +msgid "Preview terms" +msgstr "" #. module: sale_brand #: model:ir.model,name:sale_brand.model_sale_advance_payment_inv @@ -72,3 +77,38 @@ msgstr "Ordine di vendita" #: model:ir.model,name:sale_brand.model_crm_team msgid "Sales Team" msgstr "Team di Vendita" + +#. module: sale_brand +#: model:ir.model.fields,field_description:sale_brand.field_res_brand__terms_type +msgid "Terms & Conditions format" +msgstr "" + +#. module: sale_brand +#: code:addons/sale_brand/models/sale_order.py:0 +#, python-format +msgid "Terms & Conditions: %s" +msgstr "" + +#. module: sale_brand +#: model:ir.model.fields,field_description:sale_brand.field_res_brand__terms_page +msgid "Terms Page" +msgstr "" + +#. module: sale_brand +#: model_terms:ir.ui.view,arch_db:sale_brand.res_brand_sale_form_view +msgid "Terms page" +msgstr "" + +#. module: sale_brand +#: model:ir.model.fields,help:sale_brand.field_res_brand__terms_page +msgid "page on the brands site where the terms can be found" +msgstr "" + +#~ msgid "Display Name" +#~ msgstr "Nome visualizzato" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Ultima Modifica il" diff --git a/sale_brand/i18n/nl.po b/sale_brand/i18n/nl.po index b04fbfc8d..444112222 100644 --- a/sale_brand/i18n/nl.po +++ b/sale_brand/i18n/nl.po @@ -17,16 +17,52 @@ msgstr "" "X-Generator: Weblate 4.3.2\n" #. module: sale_brand +#: model:ir.model.fields.selection,name:sale_brand.selection__res_brand__terms_type__plain +msgid "Add a Note" +msgstr "" + +#. module: sale_brand +#: model:ir.model.fields.selection,name:sale_brand.selection__res_brand__terms_type__html +msgid "Add a link to a Web Page" +msgstr "" + +#. module: sale_brand +#: model:ir.model,name:sale_brand.model_res_brand #: model:ir.model.fields,field_description:sale_brand.field_crm_team__brand_id #: model:ir.model.fields,field_description:sale_brand.field_sale_order__brand_id msgid "Brand" msgstr "Merk" +#. module: sale_brand +#: model:ir.model.fields,field_description:sale_brand.field_sale_order__brand_use_level +msgid "Brand Use Level" +msgstr "" + #. module: sale_brand #: model:ir.model.fields,help:sale_brand.field_sale_order__brand_id msgid "Brand to use for this sale" msgstr "Merk te gebruiken voor deze verkoop" +#. module: sale_brand +#: model:ir.model.fields,field_description:sale_brand.field_sale_order__company_id +msgid "Company" +msgstr "" + +#. module: sale_brand +#: model:ir.model.fields,field_description:sale_brand.field_res_brand__invoice_terms +msgid "Default Terms and Conditions" +msgstr "" + +#. module: sale_brand +#: model_terms:ir.ui.view,arch_db:sale_brand.res_brand_sale_form_view +msgid "Insert your terms & conditions here..." +msgstr "" + +#. module: sale_brand +#: model:ir.model.fields,field_description:sale_brand.field_res_brand__terms_url +msgid "Preview terms" +msgstr "" + #. module: sale_brand #: model:ir.model,name:sale_brand.model_sale_advance_payment_inv msgid "Sales Advance Payment Invoice" @@ -41,3 +77,29 @@ msgstr "" #: model:ir.model,name:sale_brand.model_crm_team msgid "Sales Team" msgstr "" + +#. module: sale_brand +#: model:ir.model.fields,field_description:sale_brand.field_res_brand__terms_type +msgid "Terms & Conditions format" +msgstr "" + +#. module: sale_brand +#: code:addons/sale_brand/models/sale_order.py:0 +#, python-format +msgid "Terms & Conditions: %s" +msgstr "" + +#. module: sale_brand +#: model:ir.model.fields,field_description:sale_brand.field_res_brand__terms_page +msgid "Terms Page" +msgstr "" + +#. module: sale_brand +#: model_terms:ir.ui.view,arch_db:sale_brand.res_brand_sale_form_view +msgid "Terms page" +msgstr "" + +#. module: sale_brand +#: model:ir.model.fields,help:sale_brand.field_res_brand__terms_page +msgid "page on the brands site where the terms can be found" +msgstr "" diff --git a/sale_brand/i18n/sale_brand.pot b/sale_brand/i18n/sale_brand.pot index 07d236e32..2de16f1fb 100644 --- a/sale_brand/i18n/sale_brand.pot +++ b/sale_brand/i18n/sale_brand.pot @@ -14,6 +14,17 @@ msgstr "" "Plural-Forms: \n" #. module: sale_brand +#: model:ir.model.fields.selection,name:sale_brand.selection__res_brand__terms_type__plain +msgid "Add a Note" +msgstr "" + +#. module: sale_brand +#: model:ir.model.fields.selection,name:sale_brand.selection__res_brand__terms_type__html +msgid "Add a link to a Web Page" +msgstr "" + +#. module: sale_brand +#: model:ir.model,name:sale_brand.model_res_brand #: model:ir.model.fields,field_description:sale_brand.field_crm_team__brand_id #: model:ir.model.fields,field_description:sale_brand.field_sale_order__brand_id msgid "Brand" @@ -34,6 +45,21 @@ msgstr "" msgid "Company" msgstr "" +#. module: sale_brand +#: model:ir.model.fields,field_description:sale_brand.field_res_brand__invoice_terms +msgid "Default Terms and Conditions" +msgstr "" + +#. module: sale_brand +#: model_terms:ir.ui.view,arch_db:sale_brand.res_brand_sale_form_view +msgid "Insert your terms & conditions here..." +msgstr "" + +#. module: sale_brand +#: model:ir.model.fields,field_description:sale_brand.field_res_brand__terms_url +msgid "Preview terms" +msgstr "" + #. module: sale_brand #: model:ir.model,name:sale_brand.model_sale_advance_payment_inv msgid "Sales Advance Payment Invoice" @@ -48,3 +74,29 @@ msgstr "" #: model:ir.model,name:sale_brand.model_crm_team msgid "Sales Team" msgstr "" + +#. module: sale_brand +#: model:ir.model.fields,field_description:sale_brand.field_res_brand__terms_type +msgid "Terms & Conditions format" +msgstr "" + +#. module: sale_brand +#: code:addons/sale_brand/models/sale_order.py:0 +#, python-format +msgid "Terms & Conditions: %s" +msgstr "" + +#. module: sale_brand +#: model:ir.model.fields,field_description:sale_brand.field_res_brand__terms_page +msgid "Terms Page" +msgstr "" + +#. module: sale_brand +#: model_terms:ir.ui.view,arch_db:sale_brand.res_brand_sale_form_view +msgid "Terms page" +msgstr "" + +#. module: sale_brand +#: model:ir.model.fields,help:sale_brand.field_res_brand__terms_page +msgid "page on the brands site where the terms can be found" +msgstr "" diff --git a/sale_brand/i18n/zh_CN.po b/sale_brand/i18n/zh_CN.po index 78113808d..1d5794c80 100644 --- a/sale_brand/i18n/zh_CN.po +++ b/sale_brand/i18n/zh_CN.po @@ -17,16 +17,52 @@ msgstr "" "X-Generator: Weblate 3.8\n" #. module: sale_brand +#: model:ir.model.fields.selection,name:sale_brand.selection__res_brand__terms_type__plain +msgid "Add a Note" +msgstr "" + +#. module: sale_brand +#: model:ir.model.fields.selection,name:sale_brand.selection__res_brand__terms_type__html +msgid "Add a link to a Web Page" +msgstr "" + +#. module: sale_brand +#: model:ir.model,name:sale_brand.model_res_brand #: model:ir.model.fields,field_description:sale_brand.field_crm_team__brand_id #: model:ir.model.fields,field_description:sale_brand.field_sale_order__brand_id msgid "Brand" msgstr "品牌" +#. module: sale_brand +#: model:ir.model.fields,field_description:sale_brand.field_sale_order__brand_use_level +msgid "Brand Use Level" +msgstr "" + #. module: sale_brand #: model:ir.model.fields,help:sale_brand.field_sale_order__brand_id msgid "Brand to use for this sale" msgstr "品牌用于此次销售" +#. module: sale_brand +#: model:ir.model.fields,field_description:sale_brand.field_sale_order__company_id +msgid "Company" +msgstr "" + +#. module: sale_brand +#: model:ir.model.fields,field_description:sale_brand.field_res_brand__invoice_terms +msgid "Default Terms and Conditions" +msgstr "" + +#. module: sale_brand +#: model_terms:ir.ui.view,arch_db:sale_brand.res_brand_sale_form_view +msgid "Insert your terms & conditions here..." +msgstr "" + +#. module: sale_brand +#: model:ir.model.fields,field_description:sale_brand.field_res_brand__terms_url +msgid "Preview terms" +msgstr "" + #. module: sale_brand #: model:ir.model,name:sale_brand.model_sale_advance_payment_inv msgid "Sales Advance Payment Invoice" @@ -42,3 +78,29 @@ msgstr "销售订单" #: model:ir.model,name:sale_brand.model_crm_team msgid "Sales Team" msgstr "" + +#. module: sale_brand +#: model:ir.model.fields,field_description:sale_brand.field_res_brand__terms_type +msgid "Terms & Conditions format" +msgstr "" + +#. module: sale_brand +#: code:addons/sale_brand/models/sale_order.py:0 +#, python-format +msgid "Terms & Conditions: %s" +msgstr "" + +#. module: sale_brand +#: model:ir.model.fields,field_description:sale_brand.field_res_brand__terms_page +msgid "Terms Page" +msgstr "" + +#. module: sale_brand +#: model_terms:ir.ui.view,arch_db:sale_brand.res_brand_sale_form_view +msgid "Terms page" +msgstr "" + +#. module: sale_brand +#: model:ir.model.fields,help:sale_brand.field_res_brand__terms_page +msgid "page on the brands site where the terms can be found" +msgstr "" diff --git a/sale_brand/models/__init__.py b/sale_brand/models/__init__.py index 326207d35..c88cab6c2 100644 --- a/sale_brand/models/__init__.py +++ b/sale_brand/models/__init__.py @@ -1,2 +1,3 @@ from . import sale_order from . import crm_team +from . import res_brand diff --git a/sale_brand/models/res_brand.py b/sale_brand/models/res_brand.py new file mode 100644 index 000000000..ecdab2601 --- /dev/null +++ b/sale_brand/models/res_brand.py @@ -0,0 +1,40 @@ +# Copyright 2022 Snakebyte +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +import re + +from odoo import api, fields, models + + +class ResBrand(models.Model): + _inherit = "res.brand" + + invoice_terms = fields.Html(string="Default Terms and Conditions", translate=True) + terms_type = fields.Selection( + [("plain", "Add a Note"), ("html", "Add a link to a Web Page")], + string="Terms & Conditions format", + default="plain", + ) + terms_page = fields.Char( + help="page on the brands site where the terms can be found", + translate=True, + default="/terms", + ) + terms_url = fields.Char(string="Preview terms", compute="_compute_terms_url") + + # flake8: noqa: B950 + @api.onchange("website", "terms_page") + def _compute_terms_url(self): + link_tags = re.compile( + r"""(?)""" + ) + for brand in self: + idx = 0 + final = "" + text = brand.website + brand.terms_page + for item in re.finditer(link_tags, text): + final += text[idx : item.start()] + final += item.group(0) + idx = item.end() + final += text[idx:] + brand.terms_url = final diff --git a/sale_brand/models/sale_order.py b/sale_brand/models/sale_order.py index b56d03cb6..fcec4a212 100644 --- a/sale_brand/models/sale_order.py +++ b/sale_brand/models/sale_order.py @@ -1,7 +1,7 @@ -# Copyright (C) 2019 Open Source Integrators +# Copyright (C) 2019 Open Source Integrators, 2022 Snakebyte # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import api, fields, models +from odoo import _, api, fields, models class SaleOrder(models.Model): @@ -28,6 +28,7 @@ def _prepare_invoice(self): def _onchange_brand_id(self): res = super()._onchange_brand_id() for order in self: + order.note = order._default_note() if order.state == "draft" and order.brand_id: order.analytic_account_id = order.brand_id.analytic_account_id return res @@ -45,3 +46,15 @@ def default_get(self, fields_list): res["brand_id"] = team.brand_id.id return res + + def _default_note(self): + use_invoice_terms = ( + self.env["ir.config_parameter"] + .sudo() + .get_param("account.use_invoice_terms") + ) + if use_invoice_terms and self.brand_id: + if self.brand_id.terms_type == "html": + return _("Terms & Conditions: %s", self.brand_id.terms_url) + return self.brand_id.invoice_terms or "" + return super()._default_note() diff --git a/sale_brand/tests/test_sale_order.py b/sale_brand/tests/test_sale_order.py index 51a55fabe..419bed6a2 100644 --- a/sale_brand/tests/test_sale_order.py +++ b/sale_brand/tests/test_sale_order.py @@ -3,15 +3,71 @@ from odoo.tests.common import TransactionCase +from odoo.addons.brand.models.res_company import BRAND_USE_LEVEL_NO_USE_LEVEL + class TestSaleOrder(TransactionCase): def setUp(self): super(TestSaleOrder, self).setUp() self.sale = self.env.ref("sale.sale_order_1") + self.sale.company_id.brand_use_level = "required" self.sale.brand_id = self.env["res.brand"].create({"name": "brand"}) self.sale.order_line.mapped("product_id").write({"invoice_policy": "order"}) self.sale.action_confirm() + def test_terms_url(self): + self.env["ir.config_parameter"].sudo().set_param( + "account.use_invoice_terms", True + ) + + self.sale.brand_id.write( + { + "website": "https://odoo-community.org", + "terms_type": "html", + "invoice_terms": "We are not responsible for or product to work", + "terms_page": "/terms", + } + ) + self.assertEqual( + self.sale.brand_id.terms_url, "https://odoo-community.org/terms" + ) + self.sale._onchange_brand_id() + self.assertEqual( + self.sale.note, + "

Terms & Conditions: https://odoo-community.org/terms

", + ) + + self.sale.brand_id.write({"terms_type": "plain"}) + self.sale._onchange_brand_id() + self.assertEqual( + self.sale.note, + "

We are not responsible for or product to work

", + ) + + self.env["ir.config_parameter"].sudo().set_param( + "account.use_invoice_terms", False + ) + self.sale.brand_id.write({"terms_type": "plain"}) + self.sale._onchange_brand_id() + self.assertEqual( + self.sale.note, + "", + ) + + self.env["ir.config_parameter"].sudo().set_param( + "account.use_invoice_terms", True + ) + self.env.company.write( + { + "terms_type": "plain", + "invoice_terms": "Company terms", + "brand_use_level": BRAND_USE_LEVEL_NO_USE_LEVEL, + } + ) + self.sale.brand_id = False + self.sale._onchange_brand_id() + self.assertEqual(self.sale.note, "

Company terms

") + def test_create_invoice(self): """It should create branded invoice""" self.assertEqual(self.sale.invoice_status, "to invoice") diff --git a/sale_brand/views/res_brand.xml b/sale_brand/views/res_brand.xml new file mode 100644 index 000000000..a5b0271e5 --- /dev/null +++ b/sale_brand/views/res_brand.xml @@ -0,0 +1,33 @@ + + + + + res.brand + + + + + + + + + + + diff --git a/sale_brand/wizard/sale_make_invoice_advance.py b/sale_brand/wizard/sale_make_invoice_advance.py index 428fe4d70..68989bfbe 100644 --- a/sale_brand/wizard/sale_make_invoice_advance.py +++ b/sale_brand/wizard/sale_make_invoice_advance.py @@ -7,8 +7,7 @@ class SaleAdvancePaymentInv(models.TransientModel): _inherit = "sale.advance.payment.inv" - def _create_invoice(self, order, so_line, amount): - invoice = super()._create_invoice(order, so_line, amount) - invoice.brand_id = order.brand_id - invoice._onchange_partner_id() - return invoice + def _prepare_invoice_values(self, order, name, amount, so_line): + res = super()._prepare_invoice_values(order, name, amount, so_line) + res["brand_id"] = order.brand_id.id + return res