Point of Sale Coupons

pos_coupon
REPOSITORY
REPOSITORYodoo/odoo
GIT
GIThttps://github.com/odoo/odoo.git
GIT FOLDER
GIT FOLDERhttps://github.com/odoo/odoo/tree/15.0/pos_coupon
VERSION
VERSION 1.0
CATEGORY
CATEGORYSales/Point Of Sale
LICENSE
LICENSELGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORS
MAINTAINERS
MAINTAINERS
COMMITTERS
COMMITTERSOdoo Translation Bot, Martin Trigaux, Thibault Delavallée, Yannick Tivisse, Pierre Masereel, Christophe Monniez, wan, Xavier-Do, Hugo Adan, Joseph Caburnay, Julien Mougenot, Tiffany Chang (tic), Romain Estievenart, roen-odoo, Hubert Van de Walle (huvw), pedrambiria, Jacky (trj), MerlinGuillaume, Yolann Sabaux, Nicolas Bayet, rhe-odoo, Moises Lopez - https://www.vauxoo.com/, Javier Vega, JVegaB
WEBSITE
WEBSITE
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:25:26
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - coupon
    - account
    - base_setup
    - base
    - web
    - product
    - mail
    - bus
    - web_tour
    - uom
    - analytic
    - portal
    - web_editor
    - http_routing
    - auth_signup
    - digest
    - resource
    - point_of_sale
    - stock_account
    - stock
    - barcodes
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (5)
XML IDNameModelTypeStatus
pos_coupon_pos_config_view_form pos.config.form pos.config xpath Inherits point_of_sale.pos_config_view_form
pos_coupon_program_view_coupon_program_form coupon.program.form coupon.program xpath Inherits coupon.coupon_program_view_coupon_program_form
pos_coupon_program_view_promo_program_form coupon.program.form coupon.program xpath Inherits coupon.coupon_program_view_promo_program_form
pos_coupon_view_form coupon.coupon.form coupon.coupon xpath Inherits coupon.coupon_view_form
res_config_view_form_inherit_pos_coupon res.config.form.inherit.pos.coupon res.config.settings xpath Inherits point_of_sale.res_config_settings_view_form
Models touched (6)

New fields (1)
  • type Selection
    ondelete={'coupon': 'set default'} selection_add=[('coupon', 'Coupon')]
Public methods (0)

No public methods.

New fields (2)
  • pos_order_id Many2one → pos.order
    help='PoS order where this coupon is consumed/booked.' string='Applied on PoS Order' args: 'pos.order'
  • source_pos_order_id Many2one → pos.order
    help='PoS order where this coupon is generated.' string='PoS Order Reference' args: 'pos.order'
Public methods (0)

No public methods.

New fields (7)
  • pos_config_ids Many2many → pos.config
    readonly=True string='Point of Sales' args: 'pos.config'
  • pos_order_count Integer
    compute='_compute_pos_order_count' args: 'PoS Order Count'
  • pos_order_ids Many2many → pos.order
    copy=False help='The PoS orders where this program is applied.' args: 'pos.order'
  • pos_order_line_ids One2many → pos.order.line
    help='Order lines where this program is applied.' string='PoS Order Lines' args: 'pos.order.line', 'program_id'
  • promo_barcode Char
    default=<expr> help='A technical field used as an alternative to the promo_code. This is automatically generated when promo_code is changed.' args: 'Barcode'
  • valid_partner_ids Many2many → res.partner
    compute='_compute_valid_partner_ids' help='These are the partners that can avail this program.' args: 'res.partner', 'Valid Partners'
  • valid_product_ids Many2many → product.product
    compute='_compute_valid_product_ids' help='These are the products that are valid in this program.' args: 'product.product', 'Valid Products'
Public methods (2)
  • action_view_pos_orders(self)
  • write(self, vals)

New fields (4)
  • coupon_program_ids Many2many → coupon.program
    compute='_filter_programs' inverse='_set_programs' string='Coupon Programs' args: 'coupon.program'
  • program_ids Many2many → coupon.program
    string='Coupons and Promotions' args: 'coupon.program'
  • promo_program_ids Many2many → coupon.program
    compute='_filter_programs' inverse='_set_programs' string='Promotion Programs' args: 'coupon.program'
  • use_coupon_programs Boolean
    help='Use coupon and promotion programs in this PoS configuration.' args: 'Coupons & Promotions'
Public methods (2)
  • open_session_cb(self, check_coa=True)
  • use_coupon_code(self, code, creation_date, partner_id, reserved_program_ids)

New fields (3)
  • applied_program_ids Many2many → coupon.program
    help='Technical field. This is set when the order is validated. We normally get this value thru the `program_id` of the reward lines.' string='Applied Programs' args: 'coupon.program'
  • generated_coupon_ids One2many → coupon.coupon
    string='Generated Coupons' args: 'coupon.coupon', 'source_pos_order_id'
  • used_coupon_ids One2many → coupon.coupon
    string='Consumed Coupons' args: 'coupon.coupon', 'pos_order_id'
Public methods (1)
  • validate_coupon_programs(self, program_ids_to_generate_coupons, unused_coupon_ids)
    This is called after create_from_ui is called. We set here fields that are used to link programs and coupons to the order. We also return the generated coupons that can be used in the frontend to print the generated codes in the receipt.

New fields (3)
  • coupon_id Many2one → coupon.coupon
    help='Coupon that generated this reward.' string='Coupon' args: 'coupon.coupon'
  • is_program_reward Boolean
    help='Flag indicating that this order line is a result of coupon/promo program.' args: 'Is reward line'
  • program_id Many2one → coupon.program
    help='Promotion/Coupon Program where this reward line is based.' string='Program' args: 'coupon.program'
Public methods (0)

No public methods.