Coupon

coupon
REPOSITORY
REPOSITORYodoo/odoo
GIT
GIThttps://github.com/odoo/odoo.git
GIT FOLDER
GIT FOLDERhttps://github.com/odoo/odoo/tree/15.0/coupon
VERSION
VERSION 1.0
CATEGORY
CATEGORYSales
LICENSE
LICENSELGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORS
MAINTAINERS
MAINTAINERS
COMMITTERS
COMMITTERSRaphael Collet, Odoo Translation Bot, Martin Trigaux, Thibault Delavallée, Goffin Simon, Nicolas Lempereur, Romain Derie, Christophe Monniez, Adrian Torres, Xavier-Do, Victor Feyens, Andrea Grazioso (agr-odoo), Joseph Caburnay, Julien Mougenot, Ivan Yelizariev, nie, Tiffany Chang (tic), William Braeckman, Kevin Baptiste, Hardik Prajapati, Jacky (trj), Michael Mattiello (mcm), Mylyna Hy, Malay Khamar, Anita (anko), MAHAMADASIF ANSARI
WEBSITE
WEBSITE
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:25:30
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - account
    - base_setup
    - base
    - web
    - 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
Integrate coupon mechanism in orders.

Code Analysis

Views touched (13)
XML IDNameModelTypeStatus
coupon_generate_view_form coupon.generate.wizard.form coupon.generate.wizard form New
coupon_program_view_coupon_program_form coupon.program.form coupon.program xpath Inherits coupon_program_view_form_common
coupon_program_view_form_common coupon.program.common.form coupon.program form New
coupon_program_view_promo_program_form coupon.promotion.program.form coupon.program xpath Inherits coupon_program_view_form_common
coupon_program_view_promo_program_search coupon.promotion.program.search coupon.program search New
coupon_program_view_promo_program_tree coupon.promotion.program.tree coupon.program tree New
coupon_program_view_search coupon.program.search coupon.program search New
coupon_program_view_tree coupon.program.tree coupon.program tree New
coupon_view_form coupon.coupon.form coupon.coupon form New
coupon_view_tree coupon.coupon.tree coupon.coupon tree New
report_coupon report_coupon ir.ui.view qweb New
report_coupon_i18n report_coupon_i18n ir.ui.view qweb New
view_coupon_program_kanban coupon.program.kanban coupon.program kanban New
Models touched (8)

New fields (6)
  • code Char
    default=<expr> readonly=True required=True
  • discount_line_product_id Many2one → product.product
    help='Product used in the sales order to apply the discount.' readonly=False related='program_id.discount_line_product_id' args: 'product.product'
  • expiration_date Date
    compute='_compute_expiration_date' args: 'Expiration Date'
  • partner_id Many2one → res.partner
    args: 'res.partner', 'For Customer'
  • program_id Many2one → coupon.program
    args: 'coupon.program', 'Program'
  • state Selection
    default='new' required=True args: [('reserved', 'Pending'), ('new', 'Valid'), ('sent', 'Sent'), ('used', 'Used'), ('expired', 'Expired'), ('cancel', 'Cancelled')]
Public methods (3)
  • action_coupon_cancel(self)
  • action_coupon_send(self)
    Open a window to compose an email, with the edi invoice template message loaded by default
  • cron_expire_coupon(self)

New fields (5)
  • generation_type Selection
    default='nbr_coupon' args: [('nbr_coupon', 'Number of Coupons'), ('nbr_customer', 'Number of Selected Customers')]
  • has_partner_email Boolean
    compute='_compute_has_partner_email'
  • nbr_coupons Integer
    default=1 help='Number of coupons' string='Number of Coupons'
  • partners_domain Char
    default='[]' string='Customer'
  • template_id Many2one → mail.template
    domain="[('model', '=', 'coupon.coupon')]" args: 'mail.template', 'Use template'
Public methods (1)
  • generate_coupon(self)
    Generates the number of coupons entered in wizard field nbr_coupons

New fields (16)
  • active Boolean
    default=True help='A program is available for the customers when active' args: 'Active'
  • company_id Many2one → res.company
    default=<expr> required=True string='Company' args: 'res.company'
  • coupon_count Integer
    compute='_compute_coupon_count'
  • coupon_ids One2many → coupon.coupon
    copy=False string='Generated Coupons' args: 'coupon.coupon', 'program_id'
  • currency_id Many2one
    readonly=True related='company_id.currency_id' string='Currency'
  • maximum_use_number Integer
    help='Maximum number of sales orders in which reward can be provided'
  • name Char
    required=True translate=True
  • program_type Selection
    help='A promotional program can be either a limited promotional offer without code (applied automatically)\n or with a code (displayed on a magazine for example) that may generate a discount on the current\n order or create a coupon for a next order.\n\n A coupon program generates coupons with a code that can be used to generate a discount on the current\n order or create a coupon for a next order.' args: [('promotion_program', 'Promotional Program'), ('coupon_program', 'Coupon Program')]
  • promo_applicability Selection
    default='on_current_order' string='Applicability' args: [('on_current_order', 'Apply On Current Order'), ('on_next_order', 'Send a Coupon')]
  • promo_code Char
    copy=False help="A promotion code is a code that is associated with a marketing discount. For example, a retailer might tell frequent customers to enter the promotion code 'THX001' to receive a 10%% discount on their whole order." args: 'Promotion Code'
  • promo_code_usage Selection
    help=<expr> args: [('no_code_needed', 'Automatically Applied'), ('code_needed', 'Use a code')]
  • reward_id Many2one → coupon.reward
    copy=False ondelete='restrict' required=True string='Reward' args: 'coupon.reward'
  • rule_id Many2one → coupon.rule
    ondelete='restrict' required=True string='Coupon Rule' args: 'coupon.rule'
  • sequence Integer
    copy=False help=<expr>
  • total_order_count Integer
    compute='_compute_total_order_count' args: 'Total Order Count'
  • validity_duration Integer
    default=30 help='Validity duration for a coupon after its generation'
Public methods (4)
  • create(self, vals)
    @api.model
  • toggle_active(self)
  • unlink(self)
  • write(self, vals)

New fields (12)
  • discount_apply_on Selection
    default='on_order' help=<expr> args: [('on_order', 'On Order'), ('cheapest_product', 'On Cheapest Product'), ('specific_products', 'On Specific Products')]
  • discount_fixed_amount Float
    help='The discount in fixed amount' string='Fixed Amount'
  • discount_line_product_id Many2one → product.product
    copy=False help='Product used in the sales order to apply the discount. Each coupon program has its own reward product for reporting purpose' string='Reward Line Product' args: 'product.product'
  • discount_max_amount Float
    default=0 help='Maximum amount of discount that can be provided'
  • discount_percentage Float
    default=10 help='The discount in percentage, between 1 and 100' string='Discount'
  • discount_specific_product_ids Many2many → product.product
    help='Products that will be discounted if the discount is applied on specific products' string='Products' args: 'product.product'
  • discount_type Selection
    default='percentage' help=<expr> args: [('percentage', 'Percentage'), ('fixed_amount', 'Fixed Amount')]
  • reward_description Char
    args: 'Reward Description'
  • reward_product_id Many2one → product.product
    help='Reward Product' string='Free Product' args: 'product.product'
  • reward_product_quantity Integer
    default=1 help='Reward product quantity' string='Quantity'
  • reward_product_uom_id Many2one
    readonly=True related='reward_product_id.product_tmpl_id.uom_id' string='Unit of Measure'
  • reward_type Selection
    default='discount' help=<expr> string='Reward Type' args: [('discount', 'Discount'), ('product', 'Free Product')]
Public methods (1)
  • name_get(self)
    Returns a complete description of the reward

New fields (7)
  • rule_date_from Datetime
    help='Coupon program start date' string='Start Date'
  • rule_date_to Datetime
    help='Coupon program end date' string='End Date'
  • rule_min_quantity Integer
    default=1 help='Minimum required product quantity to get the reward' string='Minimum Quantity'
  • rule_minimum_amount Float
    default=0.0 help='Minimum required amount to get the reward'
  • rule_minimum_amount_tax_inclusion Selection
    default='tax_excluded' args: [('tax_included', 'Tax Included'), ('tax_excluded', 'Tax Excluded')]
  • rule_partners_domain Char
    help='Coupon program will work for selected customers only' string='Based on Customers'
  • rule_products_domain Char
    default=[['sale_ok', '=', True]] help='On Purchase of selected product, reward will be given' string='Based on Products'
Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (0)

No public methods.

REPOSITORY
REPOSITORYodoo/odoo
GIT
GIThttps://github.com/odoo/odoo.git
GIT FOLDER
GIT FOLDERhttps://github.com/odoo/odoo/tree/14.0/coupon
VERSION
VERSION 1.0
CATEGORY
CATEGORYSales
LICENSE
LICENSELGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORS
MAINTAINERS
MAINTAINERS
COMMITTERS
COMMITTERSOdoo Translation Bot, Martin Trigaux, Olivier Dony, Xavier Morel, Nicolas Lempereur, Aaron Bohy, Barad Mahendra, Pierre Masereel, Christophe Monniez, Xavier-Do, Andrea Grazioso (agr-odoo), Loan (lse), Ivan Yelizariev, Baptiste Vergote, Swapnesh Shah, nie, Ivàn Todorovich, William Braeckman, BVE, Mylyna Hy, Malay Khamar
WEBSITE
WEBSITE
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:14:31
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - account
    - base_setup
    - base
    - web
    - 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
Integrate coupon mechanism in orders.

Code Analysis

Views touched (13)
XML IDNameModelTypeStatus
coupon_generate_view_form coupon.generate.wizard.form coupon.generate.wizard form New
coupon_program_view_coupon_program_form coupon.program.form coupon.program xpath Inherits coupon_program_view_form_common
coupon_program_view_form_common coupon.program.common.form coupon.program form New
coupon_program_view_promo_program_form coupon.promotion.program.form coupon.program xpath Inherits coupon_program_view_form_common
coupon_program_view_promo_program_search coupon.promotion.program.search coupon.program search New
coupon_program_view_promo_program_tree coupon.promotion.program.tree coupon.program tree New
coupon_program_view_search coupon.program.search coupon.program search New
coupon_program_view_tree coupon.program.tree coupon.program tree New
coupon_view_form coupon.coupon.form coupon.coupon form New
coupon_view_tree coupon.coupon.tree coupon.coupon tree New
report_coupon report_coupon ir.ui.view qweb New
report_coupon_i18n report_coupon_i18n ir.ui.view qweb New
view_coupon_program_kanban coupon.program.kanban coupon.program kanban New
Models touched (7)

New fields (6)
  • code Char
    default=_generate_code readonly=True required=True
  • discount_line_product_id Many2one → product.product
    help='Product used in the sales order to apply the discount.' readonly=False related='program_id.discount_line_product_id' args: 'product.product'
  • expiration_date Date
    compute='_compute_expiration_date' args: 'Expiration Date'
  • partner_id Many2one → res.partner
    args: 'res.partner', 'For Customer'
  • program_id Many2one → coupon.program
    args: 'coupon.program', 'Program'
  • state Selection
    default='new' required=True args: [('reserved', 'Pending'), ('new', 'Valid'), ('sent', 'Sent'), ('used', 'Used'), ('expired', 'Expired'), ('cancel', 'Cancelled')]
Public methods (3)
  • action_coupon_cancel(self)
  • action_coupon_sent(self)
    Open a window to compose an email, with the edi invoice template message loaded by default
  • cron_expire_coupon(self)

New fields (4)
  • generation_type Selection
    default='nbr_coupon' args: [('nbr_coupon', 'Number of Coupons'), ('nbr_customer', 'Number of Selected Customers')]
  • has_partner_email Boolean
    compute='_compute_has_partner_email'
  • nbr_coupons Integer
    default=1 help='Number of coupons' string='Number of Coupons'
  • partners_domain Char
    default='[]' string='Customer'
Public methods (1)
  • generate_coupon(self)
    Generates the number of coupons entered in wizard field nbr_coupons

New fields (15)
  • active Boolean
    default=True help='A program is available for the customers when active' args: 'Active'
  • company_id Many2one → res.company
    default=<expr> string='Company' args: 'res.company'
  • coupon_count Integer
    compute='_compute_coupon_count'
  • coupon_ids One2many → coupon.coupon
    copy=False string='Generated Coupons' args: 'coupon.coupon', 'program_id'
  • currency_id Many2one
    readonly=True related='company_id.currency_id' string='Currency'
  • maximum_use_number Integer
    help='Maximum number of sales orders in which reward can be provided'
  • name Char
    required=True translate=True
  • program_type Selection
    help='A promotional program can be either a limited promotional offer without code (applied automatically)\n or with a code (displayed on a magazine for example) that may generate a discount on the current\n order or create a coupon for a next order.\n\n A coupon program generates coupons with a code that can be used to generate a discount on the current\n order or create a coupon for a next order.' args: [('promotion_program', 'Promotional Program'), ('coupon_program', 'Coupon Program')]
  • promo_applicability Selection
    default='on_current_order' string='Applicability' args: [('on_current_order', 'Apply On Current Order'), ('on_next_order', 'Send a Coupon')]
  • promo_code Char
    copy=False help="A promotion code is a code that is associated with a marketing discount. For example, a retailer might tell frequent customers to enter the promotion code 'THX001' to receive a 10%% discount on their whole order." args: 'Promotion Code'
  • promo_code_usage Selection
    help=<expr> args: [('no_code_needed', 'Automatically Applied'), ('code_needed', 'Use a code')]
  • reward_id Many2one → coupon.reward
    copy=False ondelete='restrict' required=True string='Reward' args: 'coupon.reward'
  • rule_id Many2one → coupon.rule
    ondelete='restrict' required=True string='Coupon Rule' args: 'coupon.rule'
  • sequence Integer
    copy=False help=<expr>
  • validity_duration Integer
    default=30 help='Validity duration for a coupon after its generation'
Public methods (4)
  • create(self, vals)
    @api.model
  • toggle_active(self)
  • unlink(self)
  • write(self, vals)

New fields (12)
  • discount_apply_on Selection
    default='on_order' help=<expr> args: [('on_order', 'On Order'), ('cheapest_product', 'On Cheapest Product'), ('specific_products', 'On Specific Products')]
  • discount_fixed_amount Float
    help='The discount in fixed amount' string='Fixed Amount'
  • discount_line_product_id Many2one → product.product
    copy=False help='Product used in the sales order to apply the discount. Each coupon program has its own reward product for reporting purpose' string='Reward Line Product' args: 'product.product'
  • discount_max_amount Float
    default=0 help='Maximum amount of discount that can be provided'
  • discount_percentage Float
    default=10 help='The discount in percentage, between 1 and 100' string='Discount'
  • discount_specific_product_ids Many2many → product.product
    help='Products that will be discounted if the discount is applied on specific products' string='Products' args: 'product.product'
  • discount_type Selection
    default='percentage' help=<expr> args: [('percentage', 'Percentage'), ('fixed_amount', 'Fixed Amount')]
  • reward_description Char
    args: 'Reward Description'
  • reward_product_id Many2one → product.product
    help='Reward Product' string='Free Product' args: 'product.product'
  • reward_product_quantity Integer
    default=1 help='Reward product quantity' string='Quantity'
  • reward_product_uom_id Many2one
    readonly=True related='reward_product_id.product_tmpl_id.uom_id' string='Unit of Measure'
  • reward_type Selection
    default='discount' help=<expr> string='Reward Type' args: [('discount', 'Discount'), ('product', 'Free Product')]
Public methods (1)
  • name_get(self)
    Returns a complete description of the reward

New fields (7)
  • rule_date_from Datetime
    help='Coupon program start date' string='Start Date'
  • rule_date_to Datetime
    help='Coupon program end date' string='End Date'
  • rule_min_quantity Integer
    default=1 help='Minimum required product quantity to get the reward' string='Minimum Quantity'
  • rule_minimum_amount Float
    default=0.0 help='Minimum required amount to get the reward'
  • rule_minimum_amount_tax_inclusion Selection
    default='tax_excluded' args: [('tax_included', 'Tax Included'), ('tax_excluded', 'Tax Excluded')]
  • rule_partners_domain Char
    help='Coupon program will work for selected customers only' string='Based on Customers'
  • rule_products_domain Char
    default=[['sale_ok', '=', True]] help='On Purchase of selected product, reward will be given' string='Based on Products'
Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (1)
  • send_mail(self, **kwargs)

New fields (0)

No new fields.

Public methods (0)

No public methods.