Sale Order General Discount

sale_order_general_discount
REPOSITORY
REPOSITORYOCA/sale-workflow
GIT
GIThttps://github.com/OCA/sale-workflow.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/sale-workflow/tree/19.0/sale_order_general_discount
VERSION
VERSION 1.0.1
CATEGORY
CATEGORYSales
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA)
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA)
COMMITTERS
COMMITTERSJordiMForgeFlow, OCA-git-bot, oca-ci, AlexGarS73
WEBSITE
WEBSITEhttps://github.com/OCA/sale-workflow
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 19:40:48
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - sale
    - sales_team
    - base
    - mail
    - base_setup
    - web
    - bus
    - web_tour
    - html_editor
    - account_payment
    - account
    - onboarding
    - product
    - uom
    - analytic
    - portal
    - http_routing
    - auth_signup
    - digest
    - resource
    - payment
    - utm
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION
This module allows to set a general discount in a sales order. This
general discount is set to each line order in the standard discount
field.

You can configure:  
- a default general discount on customers
- On each product define if general discount is applied

Code Analysis

Views touched (4)
XML IDNameModelTypeStatus
product_normal_form_view sale_order_general_discount.product_normal_form_view product.product xpath Inherits product.product_normal_form_view
product_template_only_form_view product.template.sale_order_general_discount.form product.template xpath Inherits product.product_template_only_form_view
sale_order_general_discount_form_view sale.order.general.discount.form sale.order xpath Inherits sale.view_order_form
view_partner_form res.partner xpath Inherits base.view_partner_form
Models touched (5)

New fields (1)
  • bypass_general_discount Boolean
    help='If this checkbox is not ticked, it means changing general discount on sale order will impact sale order lines with this related product.'
Public methods (0)

No public methods.

New fields (1)
  • bypass_general_discount Boolean
    compute='_compute_bypass_general_discount' help='If this checkbox is not ticked, it means changing general discount on sale order will impact sale order lines with this related product.' inverse='_inverse_bypass_general_discount' search='_search_bypass_general_discount'
Public methods (0)

No public methods.

New fields (1)
  • sale_discount Float
    company_dependent=True digits='Discount'
Public methods (0)

No public methods.

New fields (1)
  • general_discount Float
    compute='_compute_general_discount' digits='Discount' readonly=False store=True
Public methods (1)
  • get_view(self, view_id=None, view_type='form', **options)
    @api.model
    The purpose of this is to write a context on "order_line" field respecting other contexts on this field. There is a PR (https://github.com/odoo/odoo/pull/26607) to odoo for avoiding this. If merged, remove this method and add the attribute in the field.

New fields (1)
  • discount Float
    compute='_compute_discount' readonly=False store=True
Public methods (0)

No public methods.

REPOSITORY
REPOSITORYOCA/sale-workflow
GIT
GIThttps://github.com/OCA/sale-workflow.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/sale-workflow/tree/18.0/sale_order_general_discount
VERSION
VERSION 1.0.1
CATEGORY
CATEGORYSales
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA)
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA)
COMMITTERS
COMMITTERSVíctor Martínez, JordiMForgeFlow, Weblate, OCA-git-bot, oca-ci, Bhavesh Heliconia
WEBSITE
WEBSITEhttps://github.com/OCA/sale-workflow
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 19:30:11
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - sale
    - sales_team
    - base
    - mail
    - base_setup
    - web
    - bus
    - web_tour
    - html_editor
    - account_payment
    - account
    - onboarding
    - product
    - uom
    - analytic
    - portal
    - web_editor
    - http_routing
    - auth_signup
    - digest
    - resource
    - payment
    - utm
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION
This module allows to set a general discount in a sales order. This
general discount is set to each line order in the standard discount
field.

You can configure:  
- a default general discount on customers
- On each product define if general discount is applied

Code Analysis

Views touched (4)
XML IDNameModelTypeStatus
product_normal_form_view sale_order_general_discount.product_normal_form_view product.product xpath Inherits product.product_normal_form_view
product_template_only_form_view product.template.sale_order_general_discount.form product.template xpath Inherits product.product_template_only_form_view
sale_order_general_discount_form_view sale.order.general.discount.form sale.order xpath Inherits sale.view_order_form
view_partner_form res.partner xpath Inherits base.view_partner_form
Models touched (5)

New fields (1)
  • bypass_general_discount Boolean
    help='If this checkbox is not ticked, it means changing general discount on sale order will impact sale order lines with this related product.'
Public methods (0)

No public methods.

New fields (1)
  • bypass_general_discount Boolean
    compute='_compute_bypass_general_discount' help='If this checkbox is not ticked, it means changing general discount on sale order will impact sale order lines with this related product.' inverse='_inverse_bypass_general_discount' search='_search_bypass_general_discount'
Public methods (0)

No public methods.

New fields (1)
  • sale_discount Float
    company_dependent=True digits='Discount'
Public methods (0)

No public methods.

New fields (1)
  • general_discount Float
    compute='_compute_general_discount' digits='Discount' readonly=False store=True
Public methods (1)
  • get_view(self, view_id=None, view_type='form', **options)
    @api.model
    The purpose of this is to write a context on "order_line" field respecting other contexts on this field. There is a PR (https://github.com/odoo/odoo/pull/26607) to odoo for avoiding this. If merged, remove this method and add the attribute in the field.

New fields (1)
  • discount Float
    compute='_compute_discount' readonly=False store=True
Public methods (0)

No public methods.

REPOSITORY
REPOSITORYOCA/sale-workflow
GIT
GIThttps://github.com/OCA/sale-workflow.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/sale-workflow/tree/17.0/sale_order_general_discount
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYSales
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA)
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA)
COMMITTERS
COMMITTERSCarlos Lopez, Weblate, OCA-git-bot, oca-ci, adrip-s73, Mohamed Osman
WEBSITE
WEBSITEhttps://github.com/OCA/sale-workflow
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 19:20:05
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - sale
    - sales_team
    - base
    - mail
    - base_setup
    - web
    - bus
    - web_tour
    - account_payment
    - account
    - onboarding
    - product
    - uom
    - analytic
    - portal
    - web_editor
    - http_routing
    - auth_signup
    - digest
    - resource
    - payment
    - utm
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION
This module allows to set a general discount in a sales order. This
general discount is set to each line order in the standard discount
field.

You can configure:  
- a default general discount on customers
- On each product define if general discount is applied

Code Analysis

Views touched (4)
XML IDNameModelTypeStatus
product_normal_form_view sale_order_general_discount.product_normal_form_view product.product xpath Inherits product.product_normal_form_view
product_template_only_form_view product.template.sale_order_general_discount.form product.template xpath Inherits product.product_template_only_form_view
sale_order_general_discount_form_view sale.order.general.discount.form sale.order xpath Inherits sale.view_order_form
view_partner_form res.partner xpath Inherits base.view_partner_form
Models touched (5)

New fields (1)
  • bypass_general_discount Boolean
    help='If this checkbox is not ticked, it means changing general discount on sale order will impact sale order lines with this related product.' string="Don't apply general discount"
Public methods (0)

No public methods.

New fields (1)
  • bypass_general_discount Boolean
    compute='_compute_bypass_general_discount' help='If this checkbox is not ticked, it means changing general discount on sale order will impact sale order lines with this related product.' inverse='_inverse_bypass_general_discount' search='_search_bypass_general_discount' string="Don't apply general discount"
Public methods (0)

No public methods.

New fields (1)
  • sale_discount Float
    company_dependent=True digits='Discount' string='Discount'
Public methods (0)

No public methods.

New fields (1)
  • general_discount Float
    compute='_compute_general_discount' digits='Discount' readonly=False store=True string='Discount (%)'
Public methods (1)
  • get_view(self, view_id=None, view_type='form', **options)
    @api.model
    The purpose of this is to write a context on "order_line" field respecting other contexts on this field. There is a PR (https://github.com/odoo/odoo/pull/26607) to odoo for avoiding this. If merged, remove this method and add the attribute in the field.

New fields (1)
  • discount Float
    compute='_compute_discount' readonly=False store=True
Public methods (0)

No public methods.

REPOSITORY
REPOSITORYOCA/sale-workflow
GIT
GIThttps://github.com/OCA/sale-workflow.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/sale-workflow/tree/16.0/sale_order_general_discount
VERSION
VERSION 1.2.0
CATEGORY
CATEGORYSales
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA)
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA)
COMMITTERS
COMMITTERSWeblate, OCA-git-bot, Ethan Hildick, ferran-73, oca-ci, Justine Doutreloux
WEBSITE
WEBSITEhttps://github.com/OCA/sale-workflow
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:53:45
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - sale
    - sales_team
    - base
    - mail
    - base_setup
    - web
    - bus
    - web_tour
    - account_payment
    - account
    - product
    - uom
    - analytic
    - portal
    - web_editor
    - http_routing
    - auth_signup
    - digest
    - resource
    - payment
    - utm
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (2)
XML IDNameModelTypeStatus
sale_order_general_discount_form_view sale.order.general.discount.form sale.order xpath Inherits sale.view_order_form
view_partner_form res.partner xpath Inherits base.view_partner_form
Models touched (3)

New fields (1)
  • sale_discount Float
    company_dependent=True digits='Discount' string='Discount'
Public methods (0)

No public methods.

New fields (1)
  • general_discount Float
    compute='_compute_general_discount' digits='Discount' readonly=False store=True string='Discount (%)'
Public methods (1)
  • get_view(self, view_id=None, view_type='form', **options)
    @api.model
    The purpose of this is to write a context on "order_line" field respecting other contexts on this field. There is a PR (https://github.com/odoo/odoo/pull/26607) to odoo for avoiding this. If merged, remove this method and add the attribute in the field.

New fields (0)

No new fields.

Public methods (0)

No public methods.

REPOSITORY
REPOSITORYOCA/sale-workflow
GIT
GIThttps://github.com/OCA/sale-workflow.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/sale-workflow/tree/15.0/sale_order_general_discount
VERSION
VERSION 1.0.1
CATEGORY
CATEGORYSales
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA)
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA)
COMMITTERS
COMMITTERSWeblate, OCA-git-bot, oca-ci, Stefan, josep-tecnativa
WEBSITE
WEBSITEhttps://github.com/OCA/sale-workflow
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:46:33
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - sale
    - sales_team
    - base
    - mail
    - base_setup
    - web
    - bus
    - web_tour
    - payment
    - account
    - product
    - uom
    - analytic
    - portal
    - web_editor
    - http_routing
    - auth_signup
    - digest
    - resource
    - utm
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (2)
XML IDNameModelTypeStatus
sale_order_general_discount_form_view sale.order.general.discount.form sale.order xpath Inherits sale.view_order_form
view_partner_form res.partner xpath Inherits base.view_partner_form
Models touched (3)

New fields (1)
  • sale_discount Float
    company_dependent=True digits='Discount' string='Discount'
Public methods (0)

No public methods.

New fields (1)
  • general_discount Float
    compute='_compute_general_discount' digits='Discount' readonly=False store=True string='Discount (%)'
Public methods (1)
  • fields_view_get(self, view_id=None, view_type='form', toolbar=False, submenu=False)
    @api.model
    The purpose of this is to write a context on "order_line" field respecting other contexts on this field. There is a PR (https://github.com/odoo/odoo/pull/26607) to odoo for avoiding this. If merged, remove this method and add the attribute in the field.

New fields (1)
  • discount Float
    compute='_compute_discount' readonly=False store=True
Public methods (1)
  • create(self, vals)
    @api.model
    Apply general discount for sale order lines which are not created from sale order form view.
REPOSITORY
REPOSITORYOCA/sale-workflow
GIT
GIThttps://github.com/OCA/sale-workflow.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/sale-workflow/tree/14.0/sale_order_general_discount
VERSION
VERSION 3.0.1
CATEGORY
CATEGORYSales
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA)
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA)
COMMITTERS
COMMITTERSAlexandre Fayolle, Ivàn Todorovich, OCA Transbot, oca-travis, Weblate, OCA-git-bot, oca-ci, Alessandro Uffreduzzi, matteo.tognini, Kev-Roche
WEBSITE
WEBSITEhttps://github.com/OCA/sale-workflow
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:40:58
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - sale
    - sales_team
    - base
    - mail
    - base_setup
    - web
    - bus
    - web_tour
    - payment
    - account
    - product
    - uom
    - analytic
    - portal
    - web_editor
    - http_routing
    - auth_signup
    - digest
    - resource
    - utm
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (3)
XML IDNameModelTypeStatus
res_config_settings_form_view res.config.settings.form.view res.config.settings div Inherits base.res_config_settings_view_form
sale_order_general_discount_form_view sale.order.general.discount.form sale.order xpath Inherits sale.view_order_form
view_partner_form res.partner xpath Inherits base.view_partner_form
Models touched (5)

New fields (1)
  • general_discount_applicable_to Text
    default='[]' required=True
Public methods (0)

No public methods.

New fields (1)
  • general_discount_applicable_to Text
    readonly=False related='company_id.general_discount_applicable_to'
Public methods (0)

No public methods.

New fields (1)
  • sale_discount Float
    company_dependent=True digits='Discount' string='Discount'
Public methods (0)

No public methods.

New fields (1)
  • general_discount Float
    compute='_compute_general_discount' digits='Discount' readonly=False store=True string='Discount (%)'
Public methods (0)

No public methods.

New fields (1)
  • discount Float
    compute='_compute_discount' readonly=False store=True
Public methods (1)
  • get_discount_vals_for_product(self, product_id, order_id)
    @api.model
REPOSITORY
REPOSITORYOCA/sale-workflow
GIT
GIThttps://github.com/OCA/sale-workflow.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/sale-workflow/tree/13.0/sale_order_general_discount
VERSION
VERSION 1.0.1
CATEGORY
CATEGORYSales
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA)
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA)
COMMITTERS
COMMITTERSOCA Transbot, oca-travis, OCA-git-bot, Oriana Maita, Carlos Roca
WEBSITE
WEBSITEhttps://github.com/OCA/sale-workflow
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:34:13
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - sale
    - sales_team
    - base
    - mail
    - base_setup
    - web
    - bus
    - web_tour
    - payment
    - account
    - product
    - uom
    - analytic
    - portal
    - web_editor
    - http_routing
    - auth_signup
    - digest
    - resource
    - utm
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (2)
XML IDNameModelTypeStatus
sale_order_general_discount_form_view sale.order.general.discount.form sale.order xpath Inherits sale.view_order_form
view_partner_form res.partner xpath Inherits base.view_partner_form
Models touched (3)

New fields (1)
  • sale_discount Float
    company_dependent=True digits='Discount' string='Discount' tracking=True
Public methods (0)

No public methods.

New fields (1)
  • general_discount Float
    compute='_compute_general_discount' digits='Discount' readonly=False store=True string='Discount (%)'
Public methods (1)
  • fields_view_get(self, view_id=None, view_type='form', toolbar=False, submenu=False)
    @api.model
    The purpose of this is to write a context on "order_line" field respecting other contexts on this field. There is a PR (https://github.com/odoo/odoo/pull/26607) to odoo for avoiding this. If merged, remove this method and add the attribute in the field.

New fields (1)
  • discount Float
    compute='_compute_discount' readonly=False store=True
Public methods (1)
  • create(self, vals)
    @api.model
    Apply general discount for sale order lines which are not created from sale order form view.
REPOSITORY
REPOSITORYOCA/sale-workflow
GIT
GIThttps://github.com/OCA/sale-workflow.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/sale-workflow/tree/12.0/sale_order_general_discount
VERSION
VERSION 1.1.0
CATEGORY
CATEGORYSales
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA)
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA)
COMMITTERS
COMMITTERSOCA Transbot, Sergio Teruel, oca-travis, Weblate, OCA-git-bot, Raf Ven, Carlos Roca
WEBSITE
WEBSITEhttps://github.com/OCA/sale-workflow
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:29:17
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - sale
    - sales_team
    - base
    - mail
    - base_setup
    - web
    - bus
    - web_tour
    - payment
    - account
    - product
    - decimal_precision
    - uom
    - analytic
    - portal
    - http_routing
    - digest
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (2)
XML IDNameModelTypeStatus
sale_order_general_discount_form_view sale.order.general.discount.form sale.order xpath Inherits sale.view_order_form
view_partner_form res.partner xpath Inherits base.view_partner_form
Models touched (3)

New fields (1)
  • sale_discount Float
    company_dependent=True digits=dp.get_precision('Discount') string='Discount (%)' track_visibility='onchange'
Public methods (0)

No public methods.

New fields (1)
  • general_discount Float
    digits=dp.get_precision('Discount') string='Discount (%)'
Public methods (3)
  • fields_view_get(self, view_id=None, view_type='form', toolbar=False, submenu=False)
    @api.model
    The purpose of this is to write a context on "order_line" field respecting other contexts on this field. There is a PR (https://github.com/odoo/odoo/pull/26607) to odoo for avoiding this. If merged, remove this method and add the attribute in the field.
  • onchange_general_discount(self)
    @api.onchange('general_discount')
  • onchange_partner_id(self)
    @api.onchange('partner_id')

New fields (0)

No new fields.

Public methods (1)
  • create(self, vals)
    @api.model
    Apply general discount for sale order lines which are not created from sale order form view.
REPOSITORY
REPOSITORYOCA/sale-workflow
GIT
GIThttps://github.com/OCA/sale-workflow.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/sale-workflow/tree/11.0/sale_order_general_discount
VERSION
VERSION 1.0.1
CATEGORY
CATEGORYSales
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA)
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA)
COMMITTERS
COMMITTERSPedro M. Baeza, OCA Transbot, Sergio Teruel, oca-travis, OCA-git-bot, OCA Git Bot, sergio.teruel
WEBSITE
WEBSITEhttps://github.com/OCA/sale-workflow
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:23:57
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - sale
    - sales_team
    - base
    - mail
    - base_setup
    - web
    - bus
    - web_tour
    - account
    - product
    - decimal_precision
    - analytic
    - web_planner
    - portal
    - http_routing
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (2)
XML IDNameModelTypeStatus
sale_order_general_discount_form_view sale.order.general.discount.form sale.order xpath Inherits sale.view_order_form
view_partner_form res.partner xpath Inherits base.view_partner_form
Models touched (3)

New fields (1)
  • sale_discount Float
    company_dependent=True digits=dp.get_precision('Discount') string='Discount (%)'
Public methods (0)

No public methods.

New fields (1)
  • general_discount Float
    digits=dp.get_precision('Discount') string='Discount (%)'
Public methods (3)
  • fields_view_get(self, view_id=None, view_type='form', toolbar=False, submenu=False)
    @api.model
    The purpose of this is to write a context on "order_line" field respecting other contexts on this field. There is a PR (https://github.com/odoo/odoo/pull/26607) to odoo for avoiding this. If merged, remove this method and add the attribute in the field.
  • onchange_general_discount(self)
    @api.onchange('general_discount')
  • onchange_partner_id(self)
    @api.onchange('partner_id')

New fields (0)

No new fields.

Public methods (1)
  • create(self, vals)
    @api.model
    Apply general discount for sale order lines which are not created from sale order form view.
REPOSITORY
REPOSITORYOCA/sale-workflow
GIT
GIThttps://github.com/OCA/sale-workflow.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/sale-workflow/tree/9.0/sale_order_general_discount
VERSION
VERSION 1.0.1
CATEGORY
CATEGORYSales
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA)
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA)
COMMITTERS
COMMITTERSThomas Binsfeld, oca-travis, OCA-git-bot
WEBSITE
WEBSITEhttps://github.com/OCA/sale-workflow
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:15:20
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - sale
    - sales_team
    - base
    - mail
    - base_setup
    - web_kanban
    - web
    - bus
    - account
    - product
    - decimal_precision
    - report
    - analytic
    - web_tip
    - web_planner
    - procurement
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (2)
XML IDNameModelTypeStatus
sale_order_general_discount_form_view sale.order.general.discount.form sale.order xpath Inherits sale.view_order_form
view_partner_form res.partner xpath Inherits base.view_partner_form
Models touched (2)

New fields (1)
  • sale_discount Float
    company_dependent=True digits=dp.get_precision('Discount') string='Discount (%)'
Public methods (0)

No public methods.

New fields (1)
  • general_discount Float
    digits=dp.get_precision('Discount') string='Discount (%)'
Public methods (3)
  • fields_view_get(self, view_id=None, view_type='form', toolbar=False, submenu=False)
    @api.model
    The purpose of this is to write a context on "order_line" field respecting other contexts on this field. There is a PR (https://github.com/odoo/odoo/pull/26607) to odoo for avoiding this. If merged, remove this method and add the attribute in the field.
  • onchange_general_discount(self)
    @api.onchange('general_discount')
  • onchange_partner_id(self)
    @api.onchange('partner_id')