Purchase Order General Discount

purchase_order_general_discount
REPOSITORY
REPOSITORYOCA/purchase-workflow
GIT
GIThttps://github.com/OCA/purchase-workflow.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/purchase-workflow/tree/19.0/purchase_order_general_discount
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYPurchases
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, Antoni Marroig Campomar
WEBSITE
WEBSITEhttps://github.com/OCA/purchase-workflow
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 19:40:50
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - purchase
    - account
    - base_setup
    - base
    - web
    - onboarding
    - product
    - mail
    - bus
    - web_tour
    - html_editor
    - uom
    - analytic
    - portal
    - http_routing
    - auth_signup
    - digest
    - resource
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION
This module allows to set a general discount in a purchase order. This
general discount is applied to each line order.

You can also set a default general discount on suppliers and configure
to which line field the discount will be applied.

Code Analysis

Views touched (3)
XML IDNameModelTypeStatus
purchase_order_form purchase.order xpath Inherits purchase.purchase_order_form
res_config_settings_view_form_purchase res.config.settings.view.form.inherit.purchase res.config.settings xpath Inherits purchase.res_config_settings_view_form_purchase
res_partner_form_view res.partner xpath Inherits base.view_partner_form
Models touched (4)

New fields (1)
  • general_discount Float
    digits='Discount' string='Gen. Disc. (%)'
Public methods (3)
  • action_update_general_discount(self)
  • onchange_general_discount(self)
    @api.onchange('general_discount')
  • onchange_partner_id(self)
    @api.onchange('partner_id')

New fields (1)
  • purchase_general_discount_field Selection
    default='discount' help='Set the purchase line discount field in which the discounts will be applied.' selection='_get_purchase_discount_fields' string='Purchase Discount Field'
Public methods (0)

No public methods.

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

No public methods.

New fields (1)
  • purchase_general_discount Float
    company_dependent=True digits='Discount' string='Purchase General Discount (%)'
Public methods (0)

No public methods.

REPOSITORY
REPOSITORYOCA/purchase-workflow
GIT
GIThttps://github.com/OCA/purchase-workflow.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/purchase-workflow/tree/18.0/purchase_order_general_discount
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYPurchases
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, achulii
WEBSITE
WEBSITEhttps://github.com/OCA/purchase-workflow
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 19:30:17
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - purchase
    - account
    - base_setup
    - base
    - web
    - onboarding
    - product
    - mail
    - bus
    - web_tour
    - html_editor
    - uom
    - analytic
    - portal
    - web_editor
    - http_routing
    - auth_signup
    - digest
    - resource
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION
This module allows to set a general discount in a purchase order. This
general discount is applied to each line order.

You can also set a default general discount on suppliers and configure
to which line field the discount will be applied.

Code Analysis

Views touched (3)
XML IDNameModelTypeStatus
purchase_order_form purchase.order xpath Inherits purchase.purchase_order_form
res_config_settings_view_form_purchase res.config.settings.view.form.inherit.purchase res.config.settings xpath Inherits purchase.res_config_settings_view_form_purchase
res_partner_form_view res.partner xpath Inherits base.view_partner_form
Models touched (4)

New fields (1)
  • general_discount Float
    digits='Discount' string='Gen. Disc. (%)'
Public methods (3)
  • action_update_general_discount(self)
  • onchange_general_discount(self)
    @api.onchange('general_discount')
  • onchange_partner_id(self)
    @api.onchange('partner_id')

New fields (1)
  • purchase_general_discount_field Selection
    default='discount' help='Set the purchase line discount field in which the discounts will be applied.' selection='_get_purchase_discount_fields' string='Purchase Discount Field'
Public methods (0)

No public methods.

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

No public methods.

New fields (1)
  • purchase_general_discount Float
    company_dependent=True digits='Discount' string='Purchase General Discount (%)'
Public methods (0)

No public methods.

REPOSITORY
REPOSITORYOCA/purchase-workflow
GIT
GIThttps://github.com/OCA/purchase-workflow.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/purchase-workflow/tree/17.0/purchase_order_general_discount
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYPurchases
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, “dedinside1337”
WEBSITE
WEBSITEhttps://github.com/OCA/purchase-workflow
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 19:20:09
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - purchase
    - account
    - base_setup
    - base
    - web
    - onboarding
    - product
    - mail
    - bus
    - web_tour
    - uom
    - analytic
    - portal
    - web_editor
    - http_routing
    - auth_signup
    - digest
    - resource
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION
This module allows to set a general discount in a purchase order. This
general discount is applied to each line order.

You can also set a default general discount on suppliers and configure
to which line field the discount will be applied.

Code Analysis

Views touched (3)
XML IDNameModelTypeStatus
purchase_order_form purchase.order xpath Inherits purchase.purchase_order_form
res_config_settings_view_form_purchase res.config.settings.view.form.inherit.purchase res.config.settings xpath Inherits purchase.res_config_settings_view_form_purchase
res_partner_form_view res.partner xpath Inherits base.view_partner_form
Models touched (4)

New fields (1)
  • general_discount Float
    digits='Discount' string='Gen. Disc. (%)'
Public methods (3)
  • action_update_general_discount(self)
  • onchange_general_discount(self)
    @api.onchange('general_discount', 'order_line')
  • onchange_partner_id(self)
    @api.onchange('partner_id')

New fields (1)
  • purchase_general_discount_field Selection
    default='discount' help='Set the purchase line discount field in which the discounts will be applied.' selection='_get_purchase_discount_fields' string='Purchase Discount Field'
Public methods (0)

No public methods.

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

No public methods.

New fields (1)
  • purchase_general_discount Float
    company_dependent=True digits='Discount' string='Purchase General Discount (%)'
Public methods (0)

No public methods.

REPOSITORY
REPOSITORYOCA/purchase-workflow
GIT
GIThttps://github.com/OCA/purchase-workflow.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/purchase-workflow/tree/16.0/purchase_order_general_discount
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYPurchases
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, Cuong, Nguyen Minh Tran Manh
WEBSITE
WEBSITEhttps://github.com/OCA/purchase-workflow
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:53:55
ODOO DEPENDENCIES
ODOO DEPENDENCIES OCA/purchase-workflow:
    - purchase_discount
odoo/odoo:
    - purchase_stock
    - stock_account
    - stock
    - product
    - base
    - mail
    - base_setup
    - web
    - bus
    - web_tour
    - uom
    - barcodes_gs1_nomenclature
    - barcodes
    - digest
    - portal
    - web_editor
    - http_routing
    - auth_signup
    - resource
    - account
    - analytic
    - purchase
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (3)
XML IDNameModelTypeStatus
purchase_order_form purchase.order xpath Inherits purchase.purchase_order_form
res_config_settings_view_form_purchase res.config.settings.view.form.inherit.purchase res.config.settings xpath Inherits purchase.res_config_settings_view_form_purchase
res_partner_form_view res.partner xpath Inherits base.view_partner_form
Models touched (4)

New fields (1)
  • general_discount Float
    digits='Discount' string='Gen. Disc. (%)'
Public methods (3)
  • action_update_general_discount(self)
  • onchange_general_discount(self)
    @api.onchange('general_discount')
  • onchange_partner_id(self)
    @api.onchange('partner_id')

New fields (1)
  • purchase_general_discount_field Selection
    default='discount' help='Set the purchase line discount field in which the discounts will be applied.' selection='_get_purchase_discount_fields' string='Purchase Discount Field'
Public methods (0)

No public methods.

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

No public methods.

New fields (1)
  • purchase_general_discount Float
    company_dependent=True digits='Discount' string='Purchase General Discount (%)'
Public methods (0)

No public methods.

REPOSITORY
REPOSITORYOCA/purchase-workflow
GIT
GIThttps://github.com/OCA/purchase-workflow.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/purchase-workflow/tree/15.0/purchase_order_general_discount
VERSION
VERSION 1.0.2
CATEGORY
CATEGORYPurchases
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA)
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA)
COMMITTERS
COMMITTERSErnesto Tejeda, Weblate, OCA-git-bot, oca-ci, pilarvargas-tecnativa, angel
WEBSITE
WEBSITEhttps://github.com/OCA/purchase-workflow
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:46:41
ODOO DEPENDENCIES
ODOO DEPENDENCIES OCA/purchase-workflow:
    - purchase_discount
odoo/odoo:
    - purchase_stock
    - stock_account
    - stock
    - product
    - base
    - mail
    - base_setup
    - web
    - bus
    - web_tour
    - uom
    - barcodes
    - digest
    - portal
    - web_editor
    - http_routing
    - auth_signup
    - resource
    - account
    - analytic
    - purchase
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (3)
XML IDNameModelTypeStatus
purchase_order_form purchase.order xpath Inherits purchase.purchase_order_form
res_config_settings_view_form_purchase res.config.settings.view.form.inherit.purchase res.config.settings xpath Inherits purchase.res_config_settings_view_form_purchase
res_partner_form_view res.partner xpath Inherits base.view_partner_form
Models touched (5)

New fields (1)
  • general_discount Float
    digits='Discount' string='Gen. Disc. (%)'
Public methods (4)
  • action_update_general_discount(self)
  • 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 (0)

No public methods.

New fields (1)
  • purchase_general_discount_field Selection
    default='discount' help='Set the purchase line discount field in which the discounts will be applied.' selection='_get_purchase_discount_fields' string='Purchase Discount Field'
Public methods (0)

No public methods.

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

No public methods.

New fields (1)
  • purchase_general_discount Float
    company_dependent=True digits='Discount' string='Purchase General Discount (%)'
Public methods (0)

No public methods.

REPOSITORY
REPOSITORYOCA/purchase-workflow
GIT
GIThttps://github.com/OCA/purchase-workflow.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/purchase-workflow/tree/14.0/purchase_order_general_discount
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYPurchases
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, Jose Zambudio Bernabeu
WEBSITE
WEBSITEhttps://github.com/OCA/purchase-workflow
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:41:09
ODOO DEPENDENCIES
ODOO DEPENDENCIES OCA/purchase-workflow:
    - purchase_discount
odoo/odoo:
    - purchase_stock
    - stock_account
    - stock
    - product
    - base
    - mail
    - base_setup
    - web
    - bus
    - web_tour
    - uom
    - barcodes
    - digest
    - portal
    - web_editor
    - http_routing
    - auth_signup
    - resource
    - account
    - analytic
    - purchase
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (3)
XML IDNameModelTypeStatus
purchase_order_form purchase.order xpath Inherits purchase.purchase_order_form
res_config_settings_view_form_purchase res.config.settings.view.form.inherit.purchase res.config.settings xpath Inherits purchase.res_config_settings_view_form_purchase
res_partner_form_view res.partner xpath Inherits base.view_partner_form
Models touched (4)

New fields (1)
  • general_discount Float
    digits='Discount' string='Gen. Disc. (%)'
Public methods (4)
  • action_update_general_discount(self)
  • 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 (1)
  • purchase_general_discount_field Selection
    default='discount' help='Set the purchase line discount field in which the discounts will be applied.' selection='_get_purchase_discount_fields' string='Purchase Discount Field'
Public methods (0)

No public methods.

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

No public methods.

New fields (1)
  • purchase_general_discount Float
    company_dependent=True digits='Discount' string='Purchase General Discount (%)'
Public methods (0)

No public methods.

REPOSITORY
REPOSITORYOCA/purchase-workflow
GIT
GIThttps://github.com/OCA/purchase-workflow.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/purchase-workflow/tree/13.0/purchase_order_general_discount
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYPurchases
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA)
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA)
COMMITTERS
COMMITTERSoca-travis, Weblate, OCA-git-bot, CarlosRoca13
WEBSITE
WEBSITEhttps://github.com/OCA/purchase-workflow
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:34:18
ODOO DEPENDENCIES
ODOO DEPENDENCIES OCA/purchase-workflow:
    - purchase_discount
odoo/odoo:
    - purchase_stock
    - stock_account
    - stock
    - product
    - base
    - mail
    - base_setup
    - web
    - bus
    - web_tour
    - uom
    - barcodes
    - account
    - analytic
    - portal
    - web_editor
    - http_routing
    - auth_signup
    - digest
    - resource
    - purchase
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (3)
XML IDNameModelTypeStatus
purchase_order_form purchase.order xpath Inherits purchase.purchase_order_form
res_config_settings_view_form_purchase res.config.settings.view.form.inherit.purchase res.config.settings xpath Inherits purchase.res_config_settings_view_form_purchase
res_partner_form_view res.partner xpath Inherits base.view_partner_form
Models touched (4)

New fields (1)
  • general_discount Float
    digits='Discount' string='Gen. Disc. (%)'
Public methods (4)
  • action_update_general_discount(self)
  • 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 (1)
  • purchase_general_discount_field Selection
    default='discount' help='Set the purchase line discount field in wich the discounts will be applied.' selection='_get_purchase_discount_fields' string='Purchase Discount Field'
Public methods (0)

No public methods.

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

No public methods.

New fields (1)
  • purchase_general_discount Float
    company_dependent=True digits='Discount' string='Purchase General Discount (%)'
Public methods (0)

No public methods.

REPOSITORY
REPOSITORYOCA/purchase-workflow
GIT
GIThttps://github.com/OCA/purchase-workflow.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/purchase-workflow/tree/12.0/purchase_order_general_discount
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYPurchases
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, Weblate, OCA-git-bot, Carlos Roca
WEBSITE
WEBSITEhttps://github.com/OCA/purchase-workflow
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:29:23
ODOO DEPENDENCIES
ODOO DEPENDENCIES OCA/purchase-workflow:
    - purchase_discount
odoo/odoo:
    - purchase_stock
    - stock_account
    - stock
    - product
    - base
    - decimal_precision
    - mail
    - base_setup
    - web
    - bus
    - web_tour
    - uom
    - barcodes
    - account
    - analytic
    - portal
    - http_routing
    - digest
    - purchase
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (3)
XML IDNameModelTypeStatus
purchase_order_form purchase.order xpath Inherits purchase.purchase_order_form
res_config_settings_view_form_purchase res.config.settings.view.form.inherit.purchase res.config.settings xpath Inherits purchase.res_config_settings_view_form_purchase
res_partner_form_view res.partner xpath Inherits base.view_partner_form
Models touched (4)

New fields (1)
  • general_discount Float
    digits=dp.get_precision('Discount') string='Gen. Disc. (%)'
Public methods (4)
  • action_update_general_discount(self)
  • 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 (1)
  • purchase_general_discount_field Selection
    default='discount' help='Set the purchase line discount field in wich the discounts will be applied.' selection='_get_purchase_discount_fields' string='Purchase Discount Field'
Public methods (0)

No public methods.

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

No public methods.

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

No public methods.

REPOSITORY
REPOSITORYOCA/purchase-workflow
GIT
GIThttps://github.com/OCA/purchase-workflow.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/purchase-workflow/tree/11.0/purchase_order_general_discount
VERSION
VERSION 1.1.1
CATEGORY
CATEGORYPurchases
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSTecnativa, Odoo Community Association (OCA)
MAINTAINERS
MAINTAINERSTecnativa, Odoo Community Association (OCA)
COMMITTERS
COMMITTERSdavid, OCA Transbot, oca-travis, OCA-git-bot, David
WEBSITE
WEBSITEhttps://github.com/OCA/purchase-workflow
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:24:01
ODOO DEPENDENCIES
ODOO DEPENDENCIES OCA/purchase-workflow:
    - purchase_discount
odoo/odoo:
    - purchase
    - stock_account
    - stock
    - product
    - base
    - decimal_precision
    - mail
    - base_setup
    - web
    - bus
    - web_tour
    - barcodes
    - web_planner
    - account
    - analytic
    - portal
    - http_routing
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (3)
XML IDNameModelTypeStatus
purchase_order_form purchase.order xpath Inherits purchase.purchase_order_form
res_config_settings_view_form_purchase res.config.settings xpath Inherits purchase.res_config_settings_view_form_purchase
res_partner_form_view res.partner xpath Inherits base.view_partner_form
Models touched (4)

New fields (1)
  • general_discount Float
    digits=dp.get_precision('Discount') string='Gen. Disc. (%)'
Public methods (4)
  • action_update_general_discount(self)
  • 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 (1)
  • purchase_general_discount_field Selection
    default='discount' help='Set the purchase line discount field in wich the discounts will be applied.' selection='_get_purchase_discount_fields' string='Purchase Discount Field'
Public methods (0)

No public methods.

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

No public methods.

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

No public methods.