mirror of
https://github.com/OCA/server-backend.git
synced 2025-02-18 09:52:42 +02:00
108
base_global_discount/README.rst
Normal file
108
base_global_discount/README.rst
Normal file
@@ -0,0 +1,108 @@
|
||||
====================
|
||||
Base Global Discount
|
||||
====================
|
||||
|
||||
..
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! This file is generated by oca-gen-addon-readme !!
|
||||
!! changes will be overwritten. !!
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
!! source digest: sha256:68aa982f3f23a381d794936f7c29432409f786f969c9bebc8fb0e133c575f781
|
||||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
.. |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%2Fserver--backend-lightgray.png?logo=github
|
||||
:target: https://github.com/OCA/server-backend/tree/17.0/base_global_discount
|
||||
:alt: OCA/server-backend
|
||||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
|
||||
:target: https://translation.odoo-community.org/projects/server-backend-17-0/server-backend-17-0-base_global_discount
|
||||
: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/server-backend&target_branch=17.0
|
||||
:alt: Try me on Runboat
|
||||
|
||||
|badge1| |badge2| |badge3| |badge4| |badge5|
|
||||
|
||||
Base module to have global discounts applied to either sales or
|
||||
purchases. It doesn't do much for itself, so account_global_discount or
|
||||
purchase_global_discount should be installed to benefit from it.
|
||||
|
||||
**Table of contents**
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
|
||||
Configuration
|
||||
=============
|
||||
|
||||
To use this module, you need to:
|
||||
|
||||
1. Go to *Settings > Users*, choose yours and set *Manage Global
|
||||
Discounts*.
|
||||
2. Go to *Settings > Parameters > Global Discounts*
|
||||
3. Choose the discount scope (sales or purchases).
|
||||
4. You can also restrict it to a certain company if needed.
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
You can assign global discounts to partners as well. You'll need the
|
||||
proper permission (*Manage Global Discounts*):
|
||||
|
||||
1. Go to a partner that is a company.
|
||||
2. Go to the *Sales & Purchases* tab.
|
||||
3. In section sale, you can set sale discounts.
|
||||
4. In section purchase, you can set purchase discounts.
|
||||
|
||||
Bug Tracker
|
||||
===========
|
||||
|
||||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-backend/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/server-backend/issues/new?body=module:%20base_global_discount%0Aversion:%2017.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
|
||||
-------
|
||||
|
||||
* Tecnativa
|
||||
|
||||
Contributors
|
||||
------------
|
||||
|
||||
- `Tecnativa <https://www.tecnativa.com>`__
|
||||
|
||||
- Pedro M. Baeza
|
||||
- David Vidal
|
||||
- Carlos Dauden
|
||||
- Rafael Blasco
|
||||
- Ernesto Tejeda
|
||||
|
||||
- Omar Castiñeira <omar@comunitea.com>
|
||||
|
||||
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/server-backend <https://github.com/OCA/server-backend/tree/17.0/base_global_discount>`_ project on GitHub.
|
||||
|
||||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
|
||||
1
base_global_discount/__init__.py
Normal file
1
base_global_discount/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import models
|
||||
21
base_global_discount/__manifest__.py
Normal file
21
base_global_discount/__manifest__.py
Normal file
@@ -0,0 +1,21 @@
|
||||
# Copyright 2019 Tecnativa S.L. - David Vidal
|
||||
# Copyright 2020 Xtendoo - Manuel Calero
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
{
|
||||
"name": "Base Global Discount",
|
||||
"version": "17.0.1.0.0",
|
||||
"category": "Base",
|
||||
"author": "Tecnativa, Odoo Community Association (OCA)",
|
||||
"website": "https://github.com/OCA/server-backend",
|
||||
"license": "AGPL-3",
|
||||
"depends": ["product"],
|
||||
"data": [
|
||||
"security/security.xml",
|
||||
"security/ir.model.access.csv",
|
||||
"views/global_discount_views.xml",
|
||||
"views/product_views.xml",
|
||||
"views/res_partner_views.xml",
|
||||
],
|
||||
"application": False,
|
||||
"installable": True,
|
||||
}
|
||||
149
base_global_discount/i18n/base_global_discount.pot
Normal file
149
base_global_discount/i18n/base_global_discount.pot
Normal file
@@ -0,0 +1,149 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * base_global_discount
|
||||
#
|
||||
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: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__company_id
|
||||
msgid "Company"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model,name:base_global_discount.model_res_partner
|
||||
msgid "Contact"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__create_uid
|
||||
msgid "Created by"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__create_date
|
||||
msgid "Created on"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__discount
|
||||
msgid "Discount"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__name
|
||||
msgid "Discount Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__discount_scope
|
||||
msgid "Discount Scope"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__display_name
|
||||
msgid "Display Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_product_product__bypass_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_product_template__bypass_global_discount
|
||||
msgid "Don't apply global discount"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,help:base_global_discount.field_global_discount__sequence
|
||||
msgid "Gives the order to apply discounts"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model,name:base_global_discount.model_global_discount
|
||||
msgid "Global Discount"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.actions.act_window,name:base_global_discount.action_global_discount_tree
|
||||
#: model:ir.ui.menu,name:base_global_discount.menu_global_discount
|
||||
#: model_terms:ir.ui.view,arch_db:base_global_discount.global_discount_view_form
|
||||
msgid "Global Discounts"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__id
|
||||
msgid "ID"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,help:base_global_discount.field_product_product__bypass_global_discount
|
||||
#: model:ir.model.fields,help:base_global_discount.field_product_template__bypass_global_discount
|
||||
msgid ""
|
||||
"If this checkbox is ticked, it means that this product will not be taken "
|
||||
"into account when calculating the global discounts."
|
||||
msgstr ""
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount____last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__write_uid
|
||||
msgid "Last Updated by"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__write_date
|
||||
msgid "Last Updated on"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:res.groups,name:base_global_discount.group_global_discount
|
||||
msgid "Manage Global Discounts"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model,name:base_global_discount.model_product_template
|
||||
msgid "Product"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model,name:base_global_discount.model_product_product
|
||||
msgid "Product Variant"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_res_partner__supplier_global_discount_ids
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_res_users__supplier_global_discount_ids
|
||||
#: model_terms:ir.ui.view,arch_db:base_global_discount.res_partner_form_view
|
||||
msgid "Purchase Global Discounts"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields.selection,name:base_global_discount.selection__global_discount__discount_scope__purchase
|
||||
msgid "Purchases"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_res_partner__customer_global_discount_ids
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_res_users__customer_global_discount_ids
|
||||
#: model_terms:ir.ui.view,arch_db:base_global_discount.res_partner_form_view
|
||||
msgid "Sale Global Discounts"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields.selection,name:base_global_discount.selection__global_discount__discount_scope__sale
|
||||
msgid "Sales"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__sequence
|
||||
msgid "Sequence"
|
||||
msgstr ""
|
||||
153
base_global_discount/i18n/es.po
Normal file
153
base_global_discount/i18n/es.po
Normal file
@@ -0,0 +1,153 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * base_global_discount
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 11.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2019-08-23 06:22+0000\n"
|
||||
"PO-Revision-Date: 2023-08-28 09:10+0000\n"
|
||||
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\n"
|
||||
"Language-Team: \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: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__company_id
|
||||
msgid "Company"
|
||||
msgstr "Compañía"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model,name:base_global_discount.model_res_partner
|
||||
msgid "Contact"
|
||||
msgstr "Contacto"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__create_uid
|
||||
msgid "Created by"
|
||||
msgstr "Creado por"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__create_date
|
||||
msgid "Created on"
|
||||
msgstr "Creado el"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__discount
|
||||
msgid "Discount"
|
||||
msgstr "Descuento"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__name
|
||||
msgid "Discount Name"
|
||||
msgstr "Nombre del descuento"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__discount_scope
|
||||
msgid "Discount Scope"
|
||||
msgstr "Ámbito del descuento"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__display_name
|
||||
msgid "Display Name"
|
||||
msgstr "Nombre mostrado"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_product_product__bypass_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_product_template__bypass_global_discount
|
||||
msgid "Don't apply global discount"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,help:base_global_discount.field_global_discount__sequence
|
||||
msgid "Gives the order to apply discounts"
|
||||
msgstr "Orden en el que se aplicarán los descuentos"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model,name:base_global_discount.model_global_discount
|
||||
msgid "Global Discount"
|
||||
msgstr "Descuento Global"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.actions.act_window,name:base_global_discount.action_global_discount_tree
|
||||
#: model:ir.ui.menu,name:base_global_discount.menu_global_discount
|
||||
#: model_terms:ir.ui.view,arch_db:base_global_discount.global_discount_view_form
|
||||
msgid "Global Discounts"
|
||||
msgstr "Descuentos Globales"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__id
|
||||
msgid "ID"
|
||||
msgstr "ID"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,help:base_global_discount.field_product_product__bypass_global_discount
|
||||
#: model:ir.model.fields,help:base_global_discount.field_product_template__bypass_global_discount
|
||||
msgid ""
|
||||
"If this checkbox is ticked, it means that this product will not be taken "
|
||||
"into account when calculating the global discounts."
|
||||
msgstr ""
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount____last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr "Última Modificación en"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__write_uid
|
||||
msgid "Last Updated by"
|
||||
msgstr "Última Actualización por"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__write_date
|
||||
msgid "Last Updated on"
|
||||
msgstr "Última Actualización el"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:res.groups,name:base_global_discount.group_global_discount
|
||||
msgid "Manage Global Discounts"
|
||||
msgstr "Gestionar Descuentos Globales"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model,name:base_global_discount.model_product_template
|
||||
msgid "Product"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model,name:base_global_discount.model_product_product
|
||||
msgid "Product Variant"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_res_partner__supplier_global_discount_ids
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_res_users__supplier_global_discount_ids
|
||||
#: model_terms:ir.ui.view,arch_db:base_global_discount.res_partner_form_view
|
||||
msgid "Purchase Global Discounts"
|
||||
msgstr "Descuentos globales de compra"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields.selection,name:base_global_discount.selection__global_discount__discount_scope__purchase
|
||||
msgid "Purchases"
|
||||
msgstr "Compras"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_res_partner__customer_global_discount_ids
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_res_users__customer_global_discount_ids
|
||||
#: model_terms:ir.ui.view,arch_db:base_global_discount.res_partner_form_view
|
||||
msgid "Sale Global Discounts"
|
||||
msgstr "Descuentos de venta globales"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields.selection,name:base_global_discount.selection__global_discount__discount_scope__sale
|
||||
msgid "Sales"
|
||||
msgstr "Ventas"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__sequence
|
||||
msgid "Sequence"
|
||||
msgstr "Secuencia"
|
||||
154
base_global_discount/i18n/it.po
Normal file
154
base_global_discount/i18n/it.po
Normal file
@@ -0,0 +1,154 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * base_global_discount
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 16.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"PO-Revision-Date: 2024-05-27 15:36+0000\n"
|
||||
"Last-Translator: mymage <stefano.consolaro@mymage.it>\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.17\n"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__company_id
|
||||
msgid "Company"
|
||||
msgstr "Azienda"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model,name:base_global_discount.model_res_partner
|
||||
msgid "Contact"
|
||||
msgstr "Contatto"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__create_uid
|
||||
msgid "Created by"
|
||||
msgstr "Creato da"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__create_date
|
||||
msgid "Created on"
|
||||
msgstr "Creato il"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__discount
|
||||
msgid "Discount"
|
||||
msgstr "Sconto"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__name
|
||||
msgid "Discount Name"
|
||||
msgstr "Nome sconto"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__discount_scope
|
||||
msgid "Discount Scope"
|
||||
msgstr "Ambito sconto"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__display_name
|
||||
msgid "Display Name"
|
||||
msgstr "Nome visualizzato"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_product_product__bypass_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_product_template__bypass_global_discount
|
||||
msgid "Don't apply global discount"
|
||||
msgstr "Non applicare sconto globale"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,help:base_global_discount.field_global_discount__sequence
|
||||
msgid "Gives the order to apply discounts"
|
||||
msgstr "Imposta l'ordine per applicare gli sconti"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model,name:base_global_discount.model_global_discount
|
||||
msgid "Global Discount"
|
||||
msgstr "Sconto globale"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.actions.act_window,name:base_global_discount.action_global_discount_tree
|
||||
#: model:ir.ui.menu,name:base_global_discount.menu_global_discount
|
||||
#: model_terms:ir.ui.view,arch_db:base_global_discount.global_discount_view_form
|
||||
msgid "Global Discounts"
|
||||
msgstr "Sconti globali"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__id
|
||||
msgid "ID"
|
||||
msgstr "ID"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,help:base_global_discount.field_product_product__bypass_global_discount
|
||||
#: model:ir.model.fields,help:base_global_discount.field_product_template__bypass_global_discount
|
||||
msgid ""
|
||||
"If this checkbox is ticked, it means that this product will not be taken "
|
||||
"into account when calculating the global discounts."
|
||||
msgstr ""
|
||||
"Se selezionata, significa che questo prodotto non verrà preso in "
|
||||
"considerazione nel calcolo degli sconto globali."
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount____last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr "Ultima modifica il"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__write_uid
|
||||
msgid "Last Updated by"
|
||||
msgstr "Ultimo aggiornamento di"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__write_date
|
||||
msgid "Last Updated on"
|
||||
msgstr "Ultimo aggiornamento il"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:res.groups,name:base_global_discount.group_global_discount
|
||||
msgid "Manage Global Discounts"
|
||||
msgstr "Gestione sconti globali"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model,name:base_global_discount.model_product_template
|
||||
msgid "Product"
|
||||
msgstr "Prodotto"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model,name:base_global_discount.model_product_product
|
||||
msgid "Product Variant"
|
||||
msgstr "Variante prodotto"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_res_partner__supplier_global_discount_ids
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_res_users__supplier_global_discount_ids
|
||||
#: model_terms:ir.ui.view,arch_db:base_global_discount.res_partner_form_view
|
||||
msgid "Purchase Global Discounts"
|
||||
msgstr "Sconti globali acquisto"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields.selection,name:base_global_discount.selection__global_discount__discount_scope__purchase
|
||||
msgid "Purchases"
|
||||
msgstr "Acquisti"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_res_partner__customer_global_discount_ids
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_res_users__customer_global_discount_ids
|
||||
#: model_terms:ir.ui.view,arch_db:base_global_discount.res_partner_form_view
|
||||
msgid "Sale Global Discounts"
|
||||
msgstr "Sconti globali vendita"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields.selection,name:base_global_discount.selection__global_discount__discount_scope__sale
|
||||
msgid "Sales"
|
||||
msgstr "Vendite"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__sequence
|
||||
msgid "Sequence"
|
||||
msgstr "Sequenza"
|
||||
152
base_global_discount/i18n/nl_NL.po
Normal file
152
base_global_discount/i18n/nl_NL.po
Normal file
@@ -0,0 +1,152 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * base_global_discount
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 13.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"PO-Revision-Date: 2021-01-29 11:44+0000\n"
|
||||
"Last-Translator: Cas Vissers <c.vissers@brahoo.nl>\n"
|
||||
"Language-Team: none\n"
|
||||
"Language: nl_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: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__company_id
|
||||
msgid "Company"
|
||||
msgstr "Bedrijf"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model,name:base_global_discount.model_res_partner
|
||||
msgid "Contact"
|
||||
msgstr "Contact"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__create_uid
|
||||
msgid "Created by"
|
||||
msgstr "Aangemaakt door"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__create_date
|
||||
msgid "Created on"
|
||||
msgstr "Aangemaakt op"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__discount
|
||||
msgid "Discount"
|
||||
msgstr "Korting"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__name
|
||||
msgid "Discount Name"
|
||||
msgstr "Kortingsnaam"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__discount_scope
|
||||
msgid "Discount Scope"
|
||||
msgstr "Kortingsbereik"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__display_name
|
||||
msgid "Display Name"
|
||||
msgstr "Schermnaam"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_product_product__bypass_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_product_template__bypass_global_discount
|
||||
msgid "Don't apply global discount"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,help:base_global_discount.field_global_discount__sequence
|
||||
msgid "Gives the order to apply discounts"
|
||||
msgstr "Geeft de opdracht om kortingen toe te passen"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model,name:base_global_discount.model_global_discount
|
||||
msgid "Global Discount"
|
||||
msgstr "Algemene korting"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.actions.act_window,name:base_global_discount.action_global_discount_tree
|
||||
#: model:ir.ui.menu,name:base_global_discount.menu_global_discount
|
||||
#: model_terms:ir.ui.view,arch_db:base_global_discount.global_discount_view_form
|
||||
msgid "Global Discounts"
|
||||
msgstr "Algemene korting"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__id
|
||||
msgid "ID"
|
||||
msgstr "ID"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,help:base_global_discount.field_product_product__bypass_global_discount
|
||||
#: model:ir.model.fields,help:base_global_discount.field_product_template__bypass_global_discount
|
||||
msgid ""
|
||||
"If this checkbox is ticked, it means that this product will not be taken "
|
||||
"into account when calculating the global discounts."
|
||||
msgstr ""
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount____last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr "Laatst gewijzigd op"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__write_uid
|
||||
msgid "Last Updated by"
|
||||
msgstr "Laatst bijgewerkt door"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__write_date
|
||||
msgid "Last Updated on"
|
||||
msgstr "Laatst bijgewerkt op"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:res.groups,name:base_global_discount.group_global_discount
|
||||
msgid "Manage Global Discounts"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model,name:base_global_discount.model_product_template
|
||||
msgid "Product"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model,name:base_global_discount.model_product_product
|
||||
msgid "Product Variant"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_res_partner__supplier_global_discount_ids
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_res_users__supplier_global_discount_ids
|
||||
#: model_terms:ir.ui.view,arch_db:base_global_discount.res_partner_form_view
|
||||
msgid "Purchase Global Discounts"
|
||||
msgstr "Algemene inkoopkorting"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields.selection,name:base_global_discount.selection__global_discount__discount_scope__purchase
|
||||
msgid "Purchases"
|
||||
msgstr "Inkopen"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_res_partner__customer_global_discount_ids
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_res_users__customer_global_discount_ids
|
||||
#: model_terms:ir.ui.view,arch_db:base_global_discount.res_partner_form_view
|
||||
msgid "Sale Global Discounts"
|
||||
msgstr "Algemene verkoopkorting"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields.selection,name:base_global_discount.selection__global_discount__discount_scope__sale
|
||||
msgid "Sales"
|
||||
msgstr "Verkoop"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__sequence
|
||||
msgid "Sequence"
|
||||
msgstr "Volgorde"
|
||||
152
base_global_discount/i18n/pt.po
Normal file
152
base_global_discount/i18n/pt.po
Normal file
@@ -0,0 +1,152 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * base_global_discount
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 12.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"PO-Revision-Date: 2020-09-17 13:00+0000\n"
|
||||
"Last-Translator: Pedro Castro Silva <pedrocs@exo.pt>\n"
|
||||
"Language-Team: none\n"
|
||||
"Language: pt\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 3.10\n"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__company_id
|
||||
msgid "Company"
|
||||
msgstr "Empresa"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model,name:base_global_discount.model_res_partner
|
||||
msgid "Contact"
|
||||
msgstr "Contacto"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__create_uid
|
||||
msgid "Created by"
|
||||
msgstr "Criado por"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__create_date
|
||||
msgid "Created on"
|
||||
msgstr "Criado em"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__discount
|
||||
msgid "Discount"
|
||||
msgstr "Desconto"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__name
|
||||
msgid "Discount Name"
|
||||
msgstr "Nome do Desconto"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__discount_scope
|
||||
msgid "Discount Scope"
|
||||
msgstr "Âmbito do Desconto"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__display_name
|
||||
msgid "Display Name"
|
||||
msgstr "Nome a Apresentar"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_product_product__bypass_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_product_template__bypass_global_discount
|
||||
msgid "Don't apply global discount"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,help:base_global_discount.field_global_discount__sequence
|
||||
msgid "Gives the order to apply discounts"
|
||||
msgstr "Dá a ordem de aplicação de descontos"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model,name:base_global_discount.model_global_discount
|
||||
msgid "Global Discount"
|
||||
msgstr "Desconto Global"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.actions.act_window,name:base_global_discount.action_global_discount_tree
|
||||
#: model:ir.ui.menu,name:base_global_discount.menu_global_discount
|
||||
#: model_terms:ir.ui.view,arch_db:base_global_discount.global_discount_view_form
|
||||
msgid "Global Discounts"
|
||||
msgstr "Descontos Globais"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__id
|
||||
msgid "ID"
|
||||
msgstr "ID"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,help:base_global_discount.field_product_product__bypass_global_discount
|
||||
#: model:ir.model.fields,help:base_global_discount.field_product_template__bypass_global_discount
|
||||
msgid ""
|
||||
"If this checkbox is ticked, it means that this product will not be taken "
|
||||
"into account when calculating the global discounts."
|
||||
msgstr ""
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount____last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr "Última Modificação Em"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__write_uid
|
||||
msgid "Last Updated by"
|
||||
msgstr "Atualizado pela última vez por"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__write_date
|
||||
msgid "Last Updated on"
|
||||
msgstr "Atualizado pela última vez em"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:res.groups,name:base_global_discount.group_global_discount
|
||||
msgid "Manage Global Discounts"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model,name:base_global_discount.model_product_template
|
||||
msgid "Product"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model,name:base_global_discount.model_product_product
|
||||
msgid "Product Variant"
|
||||
msgstr ""
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_res_partner__supplier_global_discount_ids
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_res_users__supplier_global_discount_ids
|
||||
#: model_terms:ir.ui.view,arch_db:base_global_discount.res_partner_form_view
|
||||
msgid "Purchase Global Discounts"
|
||||
msgstr "Descontos Globais de Compras"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields.selection,name:base_global_discount.selection__global_discount__discount_scope__purchase
|
||||
msgid "Purchases"
|
||||
msgstr "Compras"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_res_partner__customer_global_discount_ids
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_res_users__customer_global_discount_ids
|
||||
#: model_terms:ir.ui.view,arch_db:base_global_discount.res_partner_form_view
|
||||
msgid "Sale Global Discounts"
|
||||
msgstr "Descontos Globais de Vendas"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields.selection,name:base_global_discount.selection__global_discount__discount_scope__sale
|
||||
msgid "Sales"
|
||||
msgstr "Vendas"
|
||||
|
||||
#. module: base_global_discount
|
||||
#: model:ir.model.fields,field_description:base_global_discount.field_global_discount__sequence
|
||||
msgid "Sequence"
|
||||
msgstr "Sequência"
|
||||
4
base_global_discount/models/__init__.py
Normal file
4
base_global_discount/models/__init__.py
Normal file
@@ -0,0 +1,4 @@
|
||||
from . import global_discount
|
||||
from . import product_product
|
||||
from . import product_template
|
||||
from . import res_partner
|
||||
41
base_global_discount/models/global_discount.py
Normal file
41
base_global_discount/models/global_discount.py
Normal file
@@ -0,0 +1,41 @@
|
||||
# Copyright 2019 Tecnativa - David Vidal
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class GlobalDiscount(models.Model):
|
||||
_name = "global.discount"
|
||||
_description = "Global Discount"
|
||||
_order = "sequence, id desc"
|
||||
|
||||
sequence = fields.Integer(help="Gives the order to apply discounts")
|
||||
name = fields.Char(string="Discount Name", required=True)
|
||||
discount = fields.Float(digits="Discount", required=True, default=0.0)
|
||||
discount_scope = fields.Selection(
|
||||
selection=[("sale", "Sales"), ("purchase", "Purchases")],
|
||||
default="sale",
|
||||
required=True,
|
||||
)
|
||||
company_id = fields.Many2one(
|
||||
comodel_name="res.company",
|
||||
string="Company",
|
||||
default=lambda self: self.env.company,
|
||||
)
|
||||
|
||||
def _compute_display_name(self):
|
||||
for one in self:
|
||||
one.display_name = f"{one.name} ({one.discount:.2f}%)"
|
||||
|
||||
def _get_global_discount_vals(self, base, **kwargs):
|
||||
"""Prepare the dict of values to create to obtain the discounted
|
||||
amount
|
||||
|
||||
:param float base: the amount to discount
|
||||
:return: dict with the discounted amount
|
||||
"""
|
||||
self.ensure_one()
|
||||
return {
|
||||
"global_discount": self,
|
||||
"base": base,
|
||||
"base_discounted": base * (1 - (self.discount / 100)),
|
||||
}
|
||||
16
base_global_discount/models/product_product.py
Normal file
16
base_global_discount/models/product_product.py
Normal file
@@ -0,0 +1,16 @@
|
||||
# Copyright 2024 Studio73 - Ferran Mora <ferran@studio73.es>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ProductProduct(models.Model):
|
||||
_inherit = "product.product"
|
||||
|
||||
bypass_global_discount = fields.Boolean(
|
||||
string="Don't apply global discount",
|
||||
help=(
|
||||
"If this checkbox is ticked, it means that this product will not be taken "
|
||||
"into account when calculating the global discounts."
|
||||
),
|
||||
)
|
||||
43
base_global_discount/models/product_template.py
Normal file
43
base_global_discount/models/product_template.py
Normal file
@@ -0,0 +1,43 @@
|
||||
# Copyright 2024 Studio73 - Ferran Mora <ferran@studio73.es>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
|
||||
|
||||
from odoo import api, fields, models
|
||||
|
||||
|
||||
class ProductTemplate(models.Model):
|
||||
_inherit = "product.template"
|
||||
|
||||
bypass_global_discount = fields.Boolean(
|
||||
string="Don't apply global discount",
|
||||
help=(
|
||||
"If this checkbox is ticked, it means that this product will not be taken "
|
||||
"into account when calculating the global discounts."
|
||||
),
|
||||
compute="_compute_bypass_global_discount",
|
||||
inverse="_inverse_bypass_global_discount",
|
||||
search="_search_bypass_global_discount",
|
||||
)
|
||||
|
||||
def _search_bypass_global_discount(self, operator, value):
|
||||
templates = self.with_context(active_test=False).search(
|
||||
[("product_variant_ids.bypass_global_discount", operator, value)]
|
||||
)
|
||||
return [("id", "in", templates.ids)]
|
||||
|
||||
@api.depends("product_variant_ids.bypass_global_discount")
|
||||
def _compute_bypass_global_discount(self):
|
||||
self.bypass_global_discount = False
|
||||
for template in self:
|
||||
if len(template.product_variant_ids) == 1:
|
||||
template.bypass_global_discount = (
|
||||
template.product_variant_ids.bypass_global_discount
|
||||
)
|
||||
else:
|
||||
template.bypass_global_discount = False
|
||||
|
||||
def _inverse_bypass_global_discount(self):
|
||||
for template in self:
|
||||
if len(template.product_variant_ids) == 1:
|
||||
template.product_variant_ids.bypass_global_discount = (
|
||||
template.bypass_global_discount
|
||||
)
|
||||
24
base_global_discount/models/res_partner.py
Normal file
24
base_global_discount/models/res_partner.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# Copyright 2019 Tecnativa - David Vidal
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ResPartner(models.Model):
|
||||
_inherit = "res.partner"
|
||||
|
||||
customer_global_discount_ids = fields.Many2many(
|
||||
comodel_name="global.discount",
|
||||
relation="customer_global_discount_rel",
|
||||
column1="partner_id",
|
||||
column2="global_discount_id",
|
||||
string="Sale Global Discounts",
|
||||
domain=[("discount_scope", "=", "sale")],
|
||||
)
|
||||
supplier_global_discount_ids = fields.Many2many(
|
||||
comodel_name="global.discount",
|
||||
relation="supplier_global_discount_rel",
|
||||
column1="partner_id",
|
||||
column2="global_discount_id",
|
||||
string="Purchase Global Discounts",
|
||||
domain=[("discount_scope", "=", "purchase")],
|
||||
)
|
||||
3
base_global_discount/pyproject.toml
Normal file
3
base_global_discount/pyproject.toml
Normal file
@@ -0,0 +1,3 @@
|
||||
[build-system]
|
||||
requires = ["whool"]
|
||||
build-backend = "whool.buildapi"
|
||||
7
base_global_discount/readme/CONFIGURE.md
Normal file
7
base_global_discount/readme/CONFIGURE.md
Normal file
@@ -0,0 +1,7 @@
|
||||
To use this module, you need to:
|
||||
|
||||
1. Go to *Settings \> Users*, choose yours and set *Manage Global
|
||||
Discounts*.
|
||||
2. Go to *Settings \> Parameters \> Global Discounts*
|
||||
3. Choose the discount scope (sales or purchases).
|
||||
4. You can also restrict it to a certain company if needed.
|
||||
7
base_global_discount/readme/CONTRIBUTORS.md
Normal file
7
base_global_discount/readme/CONTRIBUTORS.md
Normal file
@@ -0,0 +1,7 @@
|
||||
- [Tecnativa](https://www.tecnativa.com)
|
||||
- Pedro M. Baeza
|
||||
- David Vidal
|
||||
- Carlos Dauden
|
||||
- Rafael Blasco
|
||||
- Ernesto Tejeda
|
||||
- Omar Castiñeira \<<omar@comunitea.com>\>
|
||||
3
base_global_discount/readme/DESCRIPTION.md
Normal file
3
base_global_discount/readme/DESCRIPTION.md
Normal file
@@ -0,0 +1,3 @@
|
||||
Base module to have global discounts applied to either sales or
|
||||
purchases. It doesn't do much for itself, so account_global_discount or
|
||||
purchase_global_discount should be installed to benefit from it.
|
||||
7
base_global_discount/readme/USAGE.md
Normal file
7
base_global_discount/readme/USAGE.md
Normal file
@@ -0,0 +1,7 @@
|
||||
You can assign global discounts to partners as well. You'll need the
|
||||
proper permission (*Manage Global Discounts*):
|
||||
|
||||
1. Go to a partner that is a company.
|
||||
2. Go to the *Sales & Purchases* tab.
|
||||
3. In section sale, you can set sale discounts.
|
||||
4. In section purchase, you can set purchase discounts.
|
||||
3
base_global_discount/security/ir.model.access.csv
Normal file
3
base_global_discount/security/ir.model.access.csv
Normal file
@@ -0,0 +1,3 @@
|
||||
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
|
||||
access_global_discount_user,Global Discount Users,model_global_discount,base.group_user,1,0,0,0
|
||||
access_global_discount_manager,Global Discount Manager,model_global_discount,base_global_discount.group_global_discount,1,1,1,1
|
||||
|
20
base_global_discount/security/security.xml
Normal file
20
base_global_discount/security/security.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" ?>
|
||||
<!-- Copyright 2019 Tecnativa - David Vidal
|
||||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
||||
<odoo>
|
||||
<record model="ir.rule" id="global_discount_comp_rule">
|
||||
<field name="name">Global Discount multi-company</field>
|
||||
<field name="model_id" ref="base_global_discount.model_global_discount" />
|
||||
<field
|
||||
name="domain_force"
|
||||
>['|',('company_id','=',False),('company_id', 'in', company_ids)]</field>
|
||||
<field name="perm_read" eval="1" />
|
||||
<field name="perm_create" eval="1" />
|
||||
<field name="perm_write" eval="1" />
|
||||
<field name="perm_unlink" eval="1" />
|
||||
</record>
|
||||
<record id="group_global_discount" model="res.groups">
|
||||
<field name="name">Manage Global Discounts</field>
|
||||
<field name="category_id" ref="base.module_category_hidden" />
|
||||
</record>
|
||||
</odoo>
|
||||
BIN
base_global_discount/static/description/icon.png
Normal file
BIN
base_global_discount/static/description/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.2 KiB |
124
base_global_discount/static/description/index.html
Normal file
124
base_global_discount/static/description/index.html
Normal file
@@ -0,0 +1,124 @@
|
||||
<section class="oe_container">
|
||||
<div class="oe_row oe_spaced">
|
||||
<div class="oe_span12">
|
||||
<h2 class="oe_slogan">Module name</h2>
|
||||
<p>This module was written to extend the functionality of ... to support ... and allow you to ...</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container oe_dark">
|
||||
<div class="oe_row oe_spaced">
|
||||
<div class="oe_span12">
|
||||
<h2 class="oe_slogan">Installation</h2>
|
||||
</div>
|
||||
<div class="oe_span6">
|
||||
<p class="oe_mt32">To install this module, you need to:
|
||||
<ul>
|
||||
<li>...</li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
<div class="oe_span6">
|
||||
<div class="oe_demo oe_picture oe_screenshot">
|
||||
<a href="https://www.openerp.com/saas_master/demo?lang=en_US&module=crm">
|
||||
<img src="crm_sc_01.png">
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container">
|
||||
<div class="oe_row oe_spaced">
|
||||
<div class="oe_span12">
|
||||
<h2 class="oe_slogan">Configuration</h2>
|
||||
</div>
|
||||
<div class="oe_span6">
|
||||
<p class="oe_mt32">To configure this module, you need to:
|
||||
<ul>
|
||||
<li>...</li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
<div class="oe_span6">
|
||||
<div class="oe_demo oe_picture oe_screenshot">
|
||||
<a href="https://www.openerp.com/saas_master/demo?lang=en_US&module=crm">
|
||||
<img src="crm_sc_01.png">
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container oe_dark">
|
||||
<div class="oe_row oe_spaced">
|
||||
<div class="oe_span12">
|
||||
<h2 class="oe_slogan">Usage</h2>
|
||||
</div>
|
||||
<div class="oe_span6">
|
||||
<p class="oe_mt32">To use this module, you need to:
|
||||
<ul>
|
||||
<li>...</li>
|
||||
</ul>
|
||||
</p>
|
||||
<p class="oe_mt32">For further information, please visit:
|
||||
<ul>
|
||||
<li><a href="https://www.odoo.com/forum/help-1">https://www.odoo.com/forum/help-1</a></li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
<div class="oe_span6">
|
||||
<div class="oe_demo oe_picture oe_screenshot">
|
||||
<a href="https://www.openerp.com/saas_master/demo?lang=en_US&module=crm">
|
||||
<img src="crm_sc_01.png">
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container">
|
||||
<div class="oe_row oe_spaced">
|
||||
<div class="oe_span12">
|
||||
<h2 class="oe_slogan">Known issues / Roadmap</h2>
|
||||
</div>
|
||||
<div class="oe_span6">
|
||||
<p class="oe_mt32">
|
||||
<ul>
|
||||
<li>...</li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
<div class="oe_span6">
|
||||
<div class="oe_demo oe_picture oe_screenshot">
|
||||
<a href="https://www.openerp.com/saas_master/demo?lang=en_US&module=crm">
|
||||
<img src="crm_sc_01.png">
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="oe_container oe_dark">
|
||||
<div class="oe_row">
|
||||
<div class="oe_span12">
|
||||
<h2 class="oe_slogan">Credits</h2>
|
||||
</div>
|
||||
<div class="oe_span12">
|
||||
<h3>Contributors</h3>
|
||||
<ul>
|
||||
<li>Firstname Lastname <<a href="mailto:email.address@example.com">email.address@example.com</a>></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="oe_span12">
|
||||
<h3>Maintainer</h3>
|
||||
<p>
|
||||
This module is maintained by the OCA.<br/>
|
||||
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.<br/>
|
||||
To contribute to this module, please visit <a href="http://odoo-community.org">http://odoo-community.org</a>.<br/>
|
||||
<a href="http://odoo-community.org"><img class="oe_picture oe_centered" src="http://odoo-community.org/logo.png"></a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
1
base_global_discount/tests/__init__.py
Normal file
1
base_global_discount/tests/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import test_global_discount
|
||||
38
base_global_discount/tests/test_global_discount.py
Normal file
38
base_global_discount/tests/test_global_discount.py
Normal file
@@ -0,0 +1,38 @@
|
||||
# Copyright 2019 Tecnativa - David Vidal
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
from odoo.tests import common
|
||||
|
||||
|
||||
class TestGlobalDiscount(common.TransactionCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super().setUpClass()
|
||||
cls.global_discount_obj = cls.env["global.discount"]
|
||||
cls.global_discount_1 = cls.global_discount_obj.create(
|
||||
{"name": "Test Discount 1", "discount_scope": "sale", "discount": 20}
|
||||
)
|
||||
cls.global_discount_2 = cls.global_discount_obj.create(
|
||||
{"name": "Test Discount 2", "discount_scope": "sale", "discount": 30}
|
||||
)
|
||||
|
||||
def test_01_global_discounts(self):
|
||||
"""Chain two discounts of different types"""
|
||||
discount_vals = self.global_discount_1._get_global_discount_vals(100.0)
|
||||
self.assertAlmostEqual(discount_vals["base_discounted"], 80.0)
|
||||
discount_vals = self.global_discount_2._get_global_discount_vals(
|
||||
discount_vals["base_discounted"]
|
||||
)
|
||||
self.assertAlmostEqual(discount_vals["base_discounted"], 56.0)
|
||||
|
||||
def test_02_display_name(self):
|
||||
"""Test that the name is computed fine"""
|
||||
self.assertTrue("%)" in self.global_discount_1.display_name)
|
||||
|
||||
def test_03_bypass_products(self):
|
||||
template_obj = self.env["product.template"]
|
||||
template = template_obj.create({"name": "Test Template"})
|
||||
template.bypass_global_discount = True
|
||||
self.assertTrue(template.bypass_global_discount)
|
||||
search_result = template._search_bypass_global_discount("=", True)
|
||||
self.assertEqual(len(search_result), 1)
|
||||
self.assertEqual(template.id, search_result[0][2][0])
|
||||
47
base_global_discount/views/global_discount_views.xml
Normal file
47
base_global_discount/views/global_discount_views.xml
Normal file
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!-- Copyright 2019 Tecnativa - David Vidal
|
||||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
||||
<odoo>
|
||||
<record id="global_discount_view_tree" model="ir.ui.view">
|
||||
<field name="model">global.discount</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree editable="bottom">
|
||||
<field name="sequence" widget="handle" />
|
||||
<field name="name" />
|
||||
<field name="discount" />
|
||||
<field name="discount_scope" />
|
||||
<field name="company_id" />
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="global_discount_view_form" model="ir.ui.view">
|
||||
<field name="model">global.discount</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Global Discounts">
|
||||
<sheet>
|
||||
<group col="4">
|
||||
<field name="name" />
|
||||
<field name="sequence" />
|
||||
<field name="discount" />
|
||||
<field name="discount_scope" />
|
||||
<field name="company_id" />
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_global_discount_tree" model="ir.actions.act_window">
|
||||
<field name="name">Global Discounts</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">global.discount</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<menuitem
|
||||
id="menu_global_discount"
|
||||
action="action_global_discount_tree"
|
||||
name="Global Discounts"
|
||||
sequence="1"
|
||||
parent="base.menu_ir_property"
|
||||
groups="base_global_discount.group_global_discount"
|
||||
/>
|
||||
</odoo>
|
||||
32
base_global_discount/views/product_views.xml
Normal file
32
base_global_discount/views/product_views.xml
Normal file
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
<record id="product_normal_form_view" model="ir.ui.view">
|
||||
<field name="name">sale_order_global_discount.product_normal_form_view</field>
|
||||
<field name="model">product.product</field>
|
||||
<field name="priority" eval="16" />
|
||||
<field name="inherit_id" ref="product.product_normal_form_view" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//group[@name='group_standard_price']" position="inside">
|
||||
<field
|
||||
name="bypass_global_discount"
|
||||
groups="base_global_discount.group_global_discount"
|
||||
/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<record id="product_template_only_form_view" model="ir.ui.view">
|
||||
<field name="name">product.template.sale_order_global_discount.form</field>
|
||||
<field name="model">product.template</field>
|
||||
<field name="priority" eval="24" />
|
||||
<field name="inherit_id" ref="product.product_template_only_form_view" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//group[@name='group_standard_price']" position="inside">
|
||||
<field
|
||||
name="bypass_global_discount"
|
||||
invisible="product_variant_count > 1"
|
||||
groups="base_global_discount.group_global_discount"
|
||||
/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
43
base_global_discount/views/res_partner_views.xml
Normal file
43
base_global_discount/views/res_partner_views.xml
Normal file
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!-- Copyright 2019 Tecnativa - David Vidal
|
||||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
||||
<odoo>
|
||||
<record model="ir.ui.view" id="res_partner_form_view">
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="base.view_partner_form" />
|
||||
<field name="arch" type="xml">
|
||||
<group name="sale" position="inside">
|
||||
<field
|
||||
name="customer_global_discount_ids"
|
||||
widget="many2many_tags"
|
||||
groups="base_global_discount.group_global_discount"
|
||||
invisible="not is_company and parent_id"
|
||||
/>
|
||||
<field
|
||||
name="customer_global_discount_ids"
|
||||
string="Sale Global Discounts"
|
||||
widget="many2many_tags"
|
||||
groups="!base_global_discount.group_global_discount"
|
||||
invisible="not is_company and parent_id"
|
||||
readonly="1"
|
||||
/>
|
||||
</group>
|
||||
<group name="purchase" position="inside">
|
||||
<field
|
||||
name="supplier_global_discount_ids"
|
||||
widget="many2many_tags"
|
||||
groups="base_global_discount.group_global_discount"
|
||||
invisible="not is_company and parent_id"
|
||||
/>
|
||||
<field
|
||||
name="supplier_global_discount_ids"
|
||||
string="Purchase Global Discounts"
|
||||
readonly="1"
|
||||
widget="many2many_tags"
|
||||
groups="!base_global_discount.group_global_discount"
|
||||
invisible="not is_company and parent_id"
|
||||
/>
|
||||
</group>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
BIN
pandoc-3.3-1-amd64.deb
Normal file
BIN
pandoc-3.3-1-amd64.deb
Normal file
Binary file not shown.
Reference in New Issue
Block a user