mirror of
https://github.com/OCA/server-backend.git
synced 2025-02-18 09:52:42 +02:00
[IMP] base_global_discount: Add discounted amount selection
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
# Copyright 2019 Tecnativa S.L. - David Vidal
|
# Copyright 2019 Tecnativa S.L. - David Vidal
|
||||||
# Copyright 2020 Xtendoo - Manuel Calero
|
# Copyright 2020 Xtendoo - Manuel Calero
|
||||||
|
# Copyright 2022 Simone Rubino - TAKOBI
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||||
{
|
{
|
||||||
'name': 'Base Global Discount',
|
'name': 'Base Global Discount',
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
# Copyright 2019 Tecnativa - David Vidal
|
# Copyright 2019 Tecnativa - David Vidal
|
||||||
|
# Copyright 2022 Simone Rubino - TAKOBI
|
||||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||||
from odoo import fields, models
|
from odoo import fields, models
|
||||||
from odoo.addons import decimal_precision as dp
|
from odoo.addons import decimal_precision as dp
|
||||||
@@ -21,6 +22,16 @@ class GlobalDiscount(models.Model):
|
|||||||
required=True,
|
required=True,
|
||||||
default=0.0,
|
default=0.0,
|
||||||
)
|
)
|
||||||
|
discount_base = fields.Selection(
|
||||||
|
selection=[
|
||||||
|
('subtotal', 'Subtotal'),
|
||||||
|
('total', 'Total'),
|
||||||
|
],
|
||||||
|
default='subtotal',
|
||||||
|
required='True',
|
||||||
|
string='Discount Base',
|
||||||
|
help='Amount that will be discounted.',
|
||||||
|
)
|
||||||
discount_scope = fields.Selection(
|
discount_scope = fields.Selection(
|
||||||
selection=[
|
selection=[
|
||||||
('sale', 'Sales'),
|
('sale', 'Sales'),
|
||||||
|
|||||||
@@ -4,3 +4,6 @@
|
|||||||
* David Vidal
|
* David Vidal
|
||||||
* Carlos Dauden
|
* Carlos Dauden
|
||||||
* Rafael Blasco
|
* Rafael Blasco
|
||||||
|
* `TAKOBI <https://takobi.online>`_:
|
||||||
|
|
||||||
|
* Simone Rubino <sir@takobi.online>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<!-- Copyright 2019 Tecnativa - David Vidal
|
<!-- Copyright 2019 Tecnativa - David Vidal
|
||||||
|
Copyright 2022 Simone Rubino - TAKOBI
|
||||||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
||||||
<odoo>
|
<odoo>
|
||||||
|
|
||||||
@@ -10,6 +11,7 @@
|
|||||||
<field name="sequence" widget="handle"/>
|
<field name="sequence" widget="handle"/>
|
||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
<field name="discount"/>
|
<field name="discount"/>
|
||||||
|
<field name="discount_base"/>
|
||||||
<field name="discount_scope"/>
|
<field name="discount_scope"/>
|
||||||
<field name="company_id"/>
|
<field name="company_id"/>
|
||||||
</tree>
|
</tree>
|
||||||
@@ -25,6 +27,7 @@
|
|||||||
<field name="name"/>
|
<field name="name"/>
|
||||||
<field name="sequence"/>
|
<field name="sequence"/>
|
||||||
<field name="discount"/>
|
<field name="discount"/>
|
||||||
|
<field name="discount_base"/>
|
||||||
<field name="discount_scope"/>
|
<field name="discount_scope"/>
|
||||||
<field name="company_id"/>
|
<field name="company_id"/>
|
||||||
</group>
|
</group>
|
||||||
|
|||||||
Reference in New Issue
Block a user