diff --git a/sale_brand/README.rst b/sale_brand/README.rst new file mode 100644 index 000000000..cbb86eaa8 --- /dev/null +++ b/sale_brand/README.rst @@ -0,0 +1,111 @@ +========== +Sale Brand +========== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:63590982c6425fb8cb33756ff939e13082a5c69508a20f0ef087551f4404bca3 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/17.0/sale_brand + :alt: OCA/brand +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/brand-17-0/brand-17-0-sale_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=17.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows you to send branded quotations and sales orders to +your customers. It adds a brand field on the quotation and propagate the +value on the invoices. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To use this module, you need to: + +1. Go to Sales > Quotations +2. Select or create a quotation +3. Enter the information and the brand +4. Confirm the quotation and generate an invoice, invoice will have + brand details from sale order + +Bug Tracker +=========== + +Bugs are tracked on `GitHub 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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Open Source Integrators + +Contributors +------------ + +- Raphael Lee +- Steve Campbell +- Maxime Chambreuil +- Freni Patel +- `Obertix `__: + + - Vicent Cubells + +Other credits +------------- + +- Open Source Integrators + +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-osi-scampbell| image:: https://github.com/osi-scampbell.png?size=40px + :target: https://github.com/osi-scampbell + :alt: osi-scampbell +.. |maintainer-sbejaoui| image:: https://github.com/sbejaoui.png?size=40px + :target: https://github.com/sbejaoui + :alt: sbejaoui + +Current `maintainers `__: + +|maintainer-osi-scampbell| |maintainer-sbejaoui| + +This module is part of the `OCA/brand `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/sale_brand/__init__.py b/sale_brand/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/sale_brand/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/sale_brand/__manifest__.py b/sale_brand/__manifest__.py new file mode 100644 index 000000000..d6b97d352 --- /dev/null +++ b/sale_brand/__manifest__.py @@ -0,0 +1,17 @@ +# Copyright (C) 2019 Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Sale Brand", + "summary": "Send branded sales orders", + "version": "17.0.1.0.0", + "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"], + "data": ["views/sale_views.xml", "views/crm_team_views.xml"], + "installable": True, + "development_status": "Beta", + "maintainers": ["osi-scampbell", "sbejaoui"], +} diff --git a/sale_brand/i18n/es.po b/sale_brand/i18n/es.po new file mode 100644 index 000000000..d47e015bc --- /dev/null +++ b/sale_brand/i18n/es.po @@ -0,0 +1,48 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_brand +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-07-31 18:09+0000\n" +"Last-Translator: Ivorra78 \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: sale_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 "Marca" + +#. module: sale_brand +#: model:ir.model.fields,field_description:sale_brand.field_sale_order__brand_use_level +msgid "Brand Use Level" +msgstr "Nivel de uso de la marca" + +#. module: sale_brand +#: model:ir.model.fields,help:sale_brand.field_sale_order__brand_id +msgid "Brand to use for this sale" +msgstr "Marca a utilizar para esta venta" + +#. module: sale_brand +#: model:ir.model.fields,field_description:sale_brand.field_sale_order__company_id +msgid "Company" +msgstr "Companía" + +#. module: sale_brand +#: model:ir.model,name:sale_brand.model_sale_order +msgid "Sales Order" +msgstr "Órdenes de Venta" + +#. module: sale_brand +#: model:ir.model,name:sale_brand.model_crm_team +msgid "Sales Team" +msgstr "Equipo de Venta" diff --git a/sale_brand/i18n/es_AR.po b/sale_brand/i18n/es_AR.po new file mode 100644 index 000000000..01d470855 --- /dev/null +++ b/sale_brand/i18n/es_AR.po @@ -0,0 +1,51 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_brand +# +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" +"Last-Translator: Ignacio Buioli \n" +"Language-Team: none\n" +"Language: es_AR\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.3.2\n" + +#. module: sale_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 "Marca" + +#. module: sale_brand +#: model:ir.model.fields,field_description:sale_brand.field_sale_order__brand_use_level +msgid "Brand Use Level" +msgstr "Nivel de Uso de Marca" + +#. module: sale_brand +#: model:ir.model.fields,help:sale_brand.field_sale_order__brand_id +msgid "Brand to use for this sale" +msgstr "Marca a utilizar para este venta" + +#. module: sale_brand +#: model:ir.model.fields,field_description:sale_brand.field_sale_order__company_id +msgid "Company" +msgstr "Compañía" + +#. module: sale_brand +#: model:ir.model,name:sale_brand.model_sale_order +msgid "Sales Order" +msgstr "Pedido de Ventas" + +#. module: sale_brand +#: model:ir.model,name:sale_brand.model_crm_team +msgid "Sales Team" +msgstr "Equipo de Ventas" + +#~ msgid "Sales Advance Payment Invoice" +#~ msgstr "Factura de Pago Anticipado de Ventas" diff --git a/sale_brand/i18n/fr_FR.po b/sale_brand/i18n/fr_FR.po new file mode 100644 index 000000000..df4e6aeaf --- /dev/null +++ b/sale_brand/i18n/fr_FR.po @@ -0,0 +1,60 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_brand +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2021-10-04 11:34+0000\n" +"Last-Translator: mourad-ehm \n" +"Language-Team: none\n" +"Language: fr_FR\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.3.2\n" + +#. module: sale_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 "Marque" + +#. module: sale_brand +#: model:ir.model.fields,field_description:sale_brand.field_sale_order__brand_use_level +msgid "Brand Use Level" +msgstr "Niveau utilisation Marque" + +#. module: sale_brand +#: model:ir.model.fields,help:sale_brand.field_sale_order__brand_id +msgid "Brand to use for this sale" +msgstr "Marque à utiliser pour cette vente" + +#. module: sale_brand +#: model:ir.model.fields,field_description:sale_brand.field_sale_order__company_id +msgid "Company" +msgstr "Société" + +#. module: sale_brand +#: model:ir.model,name:sale_brand.model_sale_order +msgid "Sales Order" +msgstr "Commande de vente" + +#. module: sale_brand +#: model:ir.model,name:sale_brand.model_crm_team +msgid "Sales Team" +msgstr "Equipe commerciale" + +#~ msgid "Display Name" +#~ msgstr "Nom affiché" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Last Modified on" +#~ msgstr "Dernière modif le" + +#~ msgid "Sales Advance Payment Invoice" +#~ msgstr "Facture d'acompte sur les ventes" diff --git a/sale_brand/i18n/hr.po b/sale_brand/i18n/hr.po new file mode 100644 index 000000000..4490e3ca5 --- /dev/null +++ b/sale_brand/i18n/hr.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_brand +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-01-06 13:45+0000\n" +"Last-Translator: Bole \n" +"Language-Team: none\n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"X-Generator: Weblate 4.14.1\n" + +#. module: sale_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 "Brend" + +#. module: sale_brand +#: model:ir.model.fields,field_description:sale_brand.field_sale_order__brand_use_level +msgid "Brand Use Level" +msgstr "Razina upotrebe Brenda" + +#. 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 "Tvrtka" + +#. module: sale_brand +#: model:ir.model,name:sale_brand.model_sale_order +msgid "Sales Order" +msgstr "Ponuda" + +#. module: sale_brand +#: model:ir.model,name:sale_brand.model_crm_team +msgid "Sales Team" +msgstr "Prodajni tim" diff --git a/sale_brand/i18n/it.po b/sale_brand/i18n/it.po new file mode 100644 index 000000000..1a8149eb3 --- /dev/null +++ b/sale_brand/i18n/it.po @@ -0,0 +1,57 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_brand +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-04-07 14:22+0000\n" +"Last-Translator: Francesco Foresti \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 4.14.1\n" + +#. module: sale_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 "Marca" + +#. module: sale_brand +#: model:ir.model.fields,field_description:sale_brand.field_sale_order__brand_use_level +msgid "Brand Use Level" +msgstr "Livello uso marca" + +#. module: sale_brand +#: model:ir.model.fields,help:sale_brand.field_sale_order__brand_id +msgid "Brand to use for this sale" +msgstr "Marca da usare per questa vendita" + +#. module: sale_brand +#: model:ir.model.fields,field_description:sale_brand.field_sale_order__company_id +msgid "Company" +msgstr "Azienda" + +#. module: sale_brand +#: model:ir.model,name:sale_brand.model_sale_order +msgid "Sales Order" +msgstr "Ordine di vendita" + +#. module: sale_brand +#: model:ir.model,name:sale_brand.model_crm_team +msgid "Sales Team" +msgstr "Team di vendita" + +#~ 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 new file mode 100644 index 000000000..44d0dbbae --- /dev/null +++ b/sale_brand/i18n/nl.po @@ -0,0 +1,48 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_brand +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2020-12-13 23:19+0000\n" +"Last-Translator: Bosd \n" +"Language-Team: none\n" +"Language: nl\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.3.2\n" + +#. module: sale_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,name:sale_brand.model_sale_order +msgid "Sales Order" +msgstr "" + +#. module: sale_brand +#: model:ir.model,name:sale_brand.model_crm_team +msgid "Sales Team" +msgstr "" diff --git a/sale_brand/i18n/sale_brand.pot b/sale_brand/i18n/sale_brand.pot new file mode 100644 index 000000000..a5b9910f9 --- /dev/null +++ b/sale_brand/i18n/sale_brand.pot @@ -0,0 +1,45 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_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: sale_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,name:sale_brand.model_sale_order +msgid "Sales Order" +msgstr "" + +#. module: sale_brand +#: model:ir.model,name:sale_brand.model_crm_team +msgid "Sales Team" +msgstr "" diff --git a/sale_brand/i18n/zh_CN.po b/sale_brand/i18n/zh_CN.po new file mode 100644 index 000000000..a5394d6cf --- /dev/null +++ b/sale_brand/i18n/zh_CN.po @@ -0,0 +1,49 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sale_brand +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-09-01 09:03+0000\n" +"Last-Translator: 黎伟杰 <674416404@qq.com>\n" +"Language-Team: none\n" +"Language: zh_CN\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 3.8\n" + +#. module: sale_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,name:sale_brand.model_sale_order +#, fuzzy +msgid "Sales Order" +msgstr "销售订单" + +#. module: sale_brand +#: model:ir.model,name:sale_brand.model_crm_team +msgid "Sales Team" +msgstr "" diff --git a/sale_brand/models/__init__.py b/sale_brand/models/__init__.py new file mode 100644 index 000000000..326207d35 --- /dev/null +++ b/sale_brand/models/__init__.py @@ -0,0 +1,2 @@ +from . import sale_order +from . import crm_team diff --git a/sale_brand/models/crm_team.py b/sale_brand/models/crm_team.py new file mode 100644 index 000000000..cda26f59f --- /dev/null +++ b/sale_brand/models/crm_team.py @@ -0,0 +1,10 @@ +# Copyright (C) 2019 Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class CrmTeam(models.Model): + _inherit = "crm.team" + + brand_id = fields.Many2one(comodel_name="res.brand", string="Brand") diff --git a/sale_brand/models/sale_order.py b/sale_brand/models/sale_order.py new file mode 100644 index 000000000..1fb5f3158 --- /dev/null +++ b/sale_brand/models/sale_order.py @@ -0,0 +1,32 @@ +# Copyright (C) 2019 Open Source Integrators +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class SaleOrder(models.Model): + _name = "sale.order" + _inherit = ["sale.order", "res.brand.mixin"] + + brand_id = fields.Many2one() + + def _prepare_invoice(self): + invoice_vals = {} + for order in self: + invoice_vals = super(SaleOrder, order)._prepare_invoice() + invoice_vals.update({"brand_id": order.brand_id.id}) + return invoice_vals + + @api.onchange("team_id") + def _onchange_team_id(self): + if self.team_id.brand_id: + self.brand_id = self.team_id.brand_id + + def default_get(self, fields_list): + res = super().default_get(fields_list) + + if res.get("team_id", False) and not res.get("brand_id", False): + team = self.env["crm.team"].browse(res["team_id"]) + res["brand_id"] = team.brand_id.id + + return res diff --git a/sale_brand/pyproject.toml b/sale_brand/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/sale_brand/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/sale_brand/readme/CONTRIBUTORS.md b/sale_brand/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..1a5b7c8c3 --- /dev/null +++ b/sale_brand/readme/CONTRIBUTORS.md @@ -0,0 +1,6 @@ +- Raphael Lee \<\> +- Steve Campbell \<\> +- Maxime Chambreuil \<\> +- Freni Patel \<\> +- [Obertix](https://www.obertix.net): + - Vicent Cubells diff --git a/sale_brand/readme/CREDITS.md b/sale_brand/readme/CREDITS.md new file mode 100644 index 000000000..f9890b5be --- /dev/null +++ b/sale_brand/readme/CREDITS.md @@ -0,0 +1 @@ +- Open Source Integrators \<\> diff --git a/sale_brand/readme/DESCRIPTION.md b/sale_brand/readme/DESCRIPTION.md new file mode 100644 index 000000000..778b32b2d --- /dev/null +++ b/sale_brand/readme/DESCRIPTION.md @@ -0,0 +1,3 @@ +This module allows you to send branded quotations and sales orders to +your customers. It adds a brand field on the quotation and propagate the +value on the invoices. diff --git a/sale_brand/readme/USAGE.md b/sale_brand/readme/USAGE.md new file mode 100644 index 000000000..1de0fc56e --- /dev/null +++ b/sale_brand/readme/USAGE.md @@ -0,0 +1,6 @@ +To use this module, you need to: + +1. Go to Sales \> Quotations +2. Select or create a quotation +3. Enter the information and the brand +4. Confirm the quotation and generate an invoice, invoice will have brand details from sale order diff --git a/sale_brand/static/description/icon.png b/sale_brand/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/sale_brand/static/description/icon.png differ diff --git a/sale_brand/static/description/index.html b/sale_brand/static/description/index.html new file mode 100644 index 000000000..1af3aa4ac --- /dev/null +++ b/sale_brand/static/description/index.html @@ -0,0 +1,453 @@ + + + + + +Sale Brand + + + +
+

Sale Brand

+ + +

Beta License: AGPL-3 OCA/brand Translate me on Weblate Try me on Runboat

+

This module allows you to send branded quotations and sales orders to +your customers. It adds a brand field on the quotation and propagate the +value on the invoices.

+

Table of contents

+ +
+

Usage

+

To use this module, you need to:

+
    +
  1. Go to Sales > Quotations
  2. +
  3. Select or create a quotation
  4. +
  5. Enter the information and the brand
  6. +
  7. Confirm the quotation and generate an invoice, invoice will have +brand details from sale order
  8. +
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub 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.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Open Source Integrators
  • +
+
+
+

Contributors

+ +
+
+

Other credits

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+ +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.

+

Current maintainers:

+

osi-scampbell sbejaoui

+

This module is part of the OCA/brand project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/sale_brand/tests/__init__.py b/sale_brand/tests/__init__.py new file mode 100644 index 000000000..6f699d0d8 --- /dev/null +++ b/sale_brand/tests/__init__.py @@ -0,0 +1 @@ +from . import test_sale_order diff --git a/sale_brand/tests/test_sale_order.py b/sale_brand/tests/test_sale_order.py new file mode 100644 index 000000000..ebe4c778b --- /dev/null +++ b/sale_brand/tests/test_sale_order.py @@ -0,0 +1,50 @@ +# Copyright 2019 ACSONE SA/NV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo.tests.common import TransactionCase + + +class TestSaleOrder(TransactionCase): + def setUp(self): + super().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_create_invoice(self): + """It should create branded invoice""" + self.assertEqual(self.sale.invoice_status, "to invoice") + invoice = self.sale._create_invoices() + self.assertEqual(invoice.brand_id, self.sale.brand_id) + + def test_create_down_payment_invoice(self): + """It should create branded down-payment invoice""" + advance_payment_wizard = self.env["sale.advance.payment.inv"].create( + { + "advance_payment_method": "fixed", + "fixed_amount": 10.0, + "sale_order_ids": [(6, 0, self.sale.ids)], + } + ) + advance_payment_wizard.create_invoices() + invoice = self.sale.order_line.mapped("invoice_lines").mapped("move_id") + self.assertEqual(invoice.brand_id, self.sale.brand_id) + + def test_brand_onchange_team(self): + sale = self.sale.copy() + + brand = sale.brand_id + brand2 = self.env["res.brand"].create({"name": "brand"}) + team = self.env.ref("sales_team.team_sales_department") + team.brand_id = brand2.id + + sale.team_id = team.id + sale._onchange_team_id() + self.assertEqual(sale.brand_id, brand2) + + team.brand_id = False + sale.brand_id = brand.id + sale._onchange_team_id() + self.assertEqual(sale.brand_id, brand) diff --git a/sale_brand/views/crm_team_views.xml b/sale_brand/views/crm_team_views.xml new file mode 100644 index 000000000..01f0080be --- /dev/null +++ b/sale_brand/views/crm_team_views.xml @@ -0,0 +1,14 @@ + + + + + crm.team + + + + + + + + diff --git a/sale_brand/views/sale_views.xml b/sale_brand/views/sale_views.xml new file mode 100644 index 000000000..16dec6326 --- /dev/null +++ b/sale_brand/views/sale_views.xml @@ -0,0 +1,14 @@ + + + + sale.order.form.brand + sale.order + + + + + + + +