Base Sequence Option

base_sequence_option
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/18.0/base_sequence_option
VERSION
VERSION 1.0.1
CATEGORY
CATEGORYTools
LICENSE
LICENSELGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Ecosoft
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Ecosoft
COMMITTERS
COMMITTERSStefan Rijnhart, Weblate, OCA-git-bot, oca-ci, Frédéric GRALL
WEBSITE
WEBSITEhttps://github.com/OCA/server-tools
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 19:30:07
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - base
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES odoo_test_helper
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION
This module allow user to add optional sequences to some document model.
On which sequence is used, is based on domain matching with document
values (and original sequence will be bypassed).

For example, it is now possible to,

- Avoid using Odoo automatic sequence on invoice and vendor bill with
  old style sequence.
- Customer payment and vendor payment to run on different sequence.
- Assign different sales order sequence based on customer region.

This is a base module and does nothing by itself. Following are modules
that will allow managing sequence options for each type of documents,
I.e.,

- Purchase Order: purchase_sequence_option
- Invoice / Bill / Refund / Payment: account_sequence_option
- Others: create a new module with few lines of code

Code Analysis

Views touched (3)
XML IDNameModelTypeStatus
view_ir_sequence_option_form view.ir.sequence.option.form ir.sequence.option form New
view_ir_sequence_option_line_tree view.ir.sequence.option.line.list ir.sequence.option.line list New
view_ir_sequence_option_tree view.ir.sequence.option.list ir.sequence.option list New
Models touched (3)

New fields (0)

No new fields.

Public methods (2)
  • next_by_code(self, sequence_code, sequence_date=None)
    @api.model
  • next_by_id(self, sequence_date=None)

New fields (5)
  • company_id Many2one → res.company
    comodel_name='res.company' default=<expr> help='Company related to this sequence option' index=True readonly=False required=True string='Company'
  • model Selection
    index=True readonly=False required=True selection=[] string='Apply On Model'
  • name Char
  • option_ids One2many → ir.sequence.option.line
    comodel_name='ir.sequence.option.line' inverse_name='base_id' string='Sequence Options'
  • use_sequence_option Boolean
    help='If checked, Odoo will try to find the new matching sequence first, if not found, fall back to use the original Odoo sequence.' string='Use sequence options'
Public methods (0)

No public methods.

New fields (10)
  • base_id Many2one → ir.sequence.option
    comodel_name='ir.sequence.option' index=True ondelete='cascade' required=True
  • company_id Many2one → res.company
    comodel_name='res.company' related='base_id.company_id' store=True
  • filter_domain Char
    default='[]' help='Find matching option by document values' string='Apply On'
  • implementation Selection
    related='sequence_id.implementation' string='Implementation'
  • model Selection
    related='base_id.model' store=True
  • name Char
    required=True string='Description'
  • prefix Char
    related='sequence_id.prefix' string='Prefix'
  • sequence_id Many2one → ir.sequence
    check_company=True comodel_name='ir.sequence' required=True string='Sequence'
  • suffix Char
    related='sequence_id.suffix' string='Suffix'
  • use_sequence_option Boolean
    related='base_id.use_sequence_option'
Public methods (2)
  • get_model_options(self, model)
  • get_sequence(self, record, options=False)
    Find sequence option that match the record values
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/17.0/base_sequence_option
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYTools
LICENSE
LICENSELGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Ecosoft
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Ecosoft
COMMITTERS
COMMITTERSWeblate, OCA-git-bot, oca-ci, Antoni Marroig Campomar
WEBSITE
WEBSITEhttps://github.com/OCA/server-tools
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 19:20:01
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - base
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES odoo_test_helper
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION
This module allow user to add optional sequences to some document model.
On which sequence is used, is based on domain matching with document
values (and original sequence will be bypassed).

For example, it is now possible to,

- Avoid using Odoo automatic sequence on invoice and vendor bill with
  old style sequence.
- Customer payment and vendor payment to run on different sequence.
- Assign different sales order sequence based on customer region.

This is a base module and does nothing by itself. Following are modules
that will allow managing sequence options for each type of documents,
I.e.,

- Purchase Order: purchase_sequence_option
- Invoice / Bill / Refund / Payment: account_sequence_option
- Others: create a new module with few lines of code

Code Analysis

Views touched (3)
XML IDNameModelTypeStatus
view_ir_sequence_option_form view.ir.sequence.option.form ir.sequence.option form New
view_ir_sequence_option_line_tree view.ir.sequence.option.line.tree ir.sequence.option.line tree New
view_ir_sequence_option_tree view.ir.sequence.option.tree ir.sequence.option tree New
Models touched (3)

New fields (0)

No new fields.

Public methods (2)
  • next_by_code(self, sequence_code, sequence_date=None)
    @api.model
  • next_by_id(self, sequence_date=None)

New fields (5)
  • company_id Many2one → res.company
    comodel_name='res.company' default=<expr> help='Company related to this sequence option' index=True readonly=False required=True string='Company'
  • model Selection
    index=True readonly=False required=True selection=[] string='Apply On Model'
  • name Char
  • option_ids One2many → ir.sequence.option.line
    comodel_name='ir.sequence.option.line' inverse_name='base_id' string='Sequence Options'
  • use_sequence_option Boolean
    help='If checked, Odoo will try to find the new matching sequence first, if not found, fall back to use the original Odoo sequence.' string='Use sequence options'
Public methods (0)

No public methods.

New fields (10)
  • base_id Many2one → ir.sequence.option
    comodel_name='ir.sequence.option' index=True ondelete='cascade' required=True
  • company_id Many2one → res.company
    comodel_name='res.company' related='base_id.company_id' store=True
  • filter_domain Char
    default='[]' help='Find matching option by document values' string='Apply On'
  • implementation Selection
    related='sequence_id.implementation' string='Implementation'
  • model Selection
    related='base_id.model' store=True
  • name Char
    required=True string='Description'
  • prefix Char
    related='sequence_id.prefix' string='Prefix'
  • sequence_id Many2one → ir.sequence
    check_company=True comodel_name='ir.sequence' required=True string='Sequence'
  • suffix Char
    related='sequence_id.suffix' string='Suffix'
  • use_sequence_option Boolean
    related='base_id.use_sequence_option' store=True
Public methods (2)
  • get_model_options(self, model)
  • get_sequence(self, record, options=False)
    Find sequence option that match the record values
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/16.0/base_sequence_option
VERSION
VERSION 1.0.1
CATEGORY
CATEGORYTools
LICENSE
LICENSELGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Ecosoft
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Ecosoft
COMMITTERS
COMMITTERSWeblate, OCA-git-bot, oca-ci, matteoopenf, Saran440
WEBSITE
WEBSITEhttps://github.com/OCA/server-tools
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:53:53
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - base
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES odoo_test_helper
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (3)
XML IDNameModelTypeStatus
view_ir_sequence_option_form view.ir.sequence.option.form ir.sequence.option form New
view_ir_sequence_option_line_tree view.ir.sequence.option.line.tree ir.sequence.option.line tree New
view_ir_sequence_option_tree view.ir.sequence.option.tree ir.sequence.option tree New
Models touched (3)

New fields (0)

No new fields.

Public methods (2)
  • next_by_code(self, sequence_code, sequence_date=None)
    @api.model
  • next_by_id(self, sequence_date=None)

New fields (5)
  • company_id Many2one → res.company
    comodel_name='res.company' default=<expr> help='Company related to this sequence option' index=True readonly=False required=True string='Company'
  • model Selection
    index=True readonly=False required=True selection=[] string='Apply On Model'
  • name Char
  • option_ids One2many → ir.sequence.option.line
    comodel_name='ir.sequence.option.line' inverse_name='base_id' string='Sequence Options'
  • use_sequence_option Boolean
    help='If checked, Odoo will try to find the new matching sequence first, if not found, fall back to use the original Odoo sequence.' string='Use sequence options'
Public methods (0)

No public methods.

New fields (10)
  • base_id Many2one → ir.sequence.option
    comodel_name='ir.sequence.option' index=True ondelete='cascade' required=True
  • company_id Many2one → res.company
    comodel_name='res.company' related='base_id.company_id' store=True
  • filter_domain Char
    default='[]' help='Find matching option by document values' string='Apply On'
  • implementation Selection
    readonly=True related='sequence_id.implementation' string='Implementation'
  • model Selection
    readonly=True related='base_id.model' store=True
  • name Char
    required=True string='Description'
  • prefix Char
    readonly=True related='sequence_id.prefix' string='Prefix'
  • sequence_id Many2one → ir.sequence
    check_company=True comodel_name='ir.sequence' required=True string='Sequence'
  • suffix Char
    readonly=True related='sequence_id.suffix' string='Suffix'
  • use_sequence_option Boolean
    related='base_id.use_sequence_option' store=True
Public methods (2)
  • get_model_options(self, model)
  • get_sequence(self, record, options=False)
    Find sequence option that match the record values
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/15.0/base_sequence_option
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYTools
LICENSE
LICENSELGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Ecosoft
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Ecosoft
COMMITTERS
COMMITTERSWeblate, OCA-git-bot, oca-ci, Rad0van
WEBSITE
WEBSITEhttps://github.com/OCA/server-tools
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:46:38
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - base
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES odoo_test_helper
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (3)
XML IDNameModelTypeStatus
view_ir_sequence_option_form view.ir.sequence.option.form ir.sequence.option form New
view_ir_sequence_option_line_tree view.ir.sequence.option.line.tree ir.sequence.option.line tree New
view_ir_sequence_option_tree view.ir.sequence.option.tree ir.sequence.option tree New
Models touched (3)

New fields (0)

No new fields.

Public methods (2)
  • next_by_code(self, sequence_code, sequence_date=None)
    @api.model
  • next_by_id(self, sequence_date=None)

New fields (5)
  • company_id Many2one → res.company
    comodel_name='res.company' default=<expr> help='Company related to this sequence option' index=True readonly=False required=True string='Company'
  • model Selection
    index=True readonly=False required=True selection=[] string='Apply On Model'
  • name Char
    readonly=True
  • option_ids One2many → ir.sequence.option.line
    comodel_name='ir.sequence.option.line' inverse_name='base_id' string='Sequence Options'
  • use_sequence_option Boolean
    help='If checked, Odoo will try to find the new matching sequence first, if not found, fall back to use the original Odoo sequence.' string='Use sequence options'
Public methods (0)

No public methods.

New fields (10)
  • base_id Many2one → ir.sequence.option
    comodel_name='ir.sequence.option' index=True ondelete='cascade' required=True
  • company_id Many2one → res.company
    comodel_name='res.company' related='base_id.company_id' store=True
  • filter_domain Char
    default='[]' help='Find matching option by document values' string='Apply On'
  • implementation Selection
    readonly=True related='sequence_id.implementation' string='Implementation'
  • model Selection
    readonly=True related='base_id.model' store=True
  • name Char
    required=True string='Description'
  • prefix Char
    readonly=True related='sequence_id.prefix' string='Prefix'
  • sequence_id Many2one → ir.sequence
    check_company=True comodel_name='ir.sequence' required=True string='Sequence'
  • suffix Char
    readonly=True related='sequence_id.suffix' string='Suffix'
  • use_sequence_option Boolean
    related='base_id.use_sequence_option' store=True
Public methods (2)
  • get_model_options(self, model)
  • get_sequence(self, record, options=False)
    Find sequence option that match the record values
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/14.0/base_sequence_option
VERSION
VERSION 1.0.1
CATEGORY
CATEGORYTools
LICENSE
LICENSELGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Ecosoft
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Ecosoft
COMMITTERS
COMMITTERSEnric Tobella, oca-travis, Weblate, OCA-git-bot, oca-ci, Kitti U, Benoit Aimont
WEBSITE
WEBSITEhttps://github.com/OCA/server-tools
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:41:05
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - base
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (3)
XML IDNameModelTypeStatus
view_ir_sequence_option_form view.ir.sequence.option.form ir.sequence.option form New
view_ir_sequence_option_line_tree view.ir.sequence.option.line.tree ir.sequence.option.line tree New
view_ir_sequence_option_tree view.ir.sequence.option.tree ir.sequence.option tree New
Models touched (3)

New fields (0)

No new fields.

Public methods (2)
  • next_by_code(self, sequence_code, sequence_date=None)
    @api.model
  • next_by_id(self, sequence_date=None)

New fields (5)
  • company_id Many2one → res.company
    comodel_name='res.company' default=<expr> help='Company related to this sequence option' index=True readonly=False required=True string='Company'
  • model Selection
    index=True readonly=False required=True selection=[] string='Apply On Model'
  • name Char
    readonly=True
  • option_ids One2many → ir.sequence.option.line
    comodel_name='ir.sequence.option.line' inverse_name='base_id' string='Sequence Options'
  • use_sequence_option Boolean
    help='If checked, Odoo will try to find the new matching sequence first, if not found, fall back to use the original Odoo sequence.' string='Use sequence options'
Public methods (0)

No public methods.

New fields (10)
  • base_id Many2one → ir.sequence.option
    comodel_name='ir.sequence.option' index=True ondelete='cascade' required=True
  • company_id Many2one → res.company
    comodel_name='res.company' related='base_id.company_id' store=True
  • filter_domain Char
    default='[]' help='Find matching option by document values' string='Apply On'
  • implementation Selection
    readonly=True related='sequence_id.implementation' string='Implementation'
  • model Selection
    readonly=True related='base_id.model' store=True
  • name Char
    required=True string='Description'
  • prefix Char
    readonly=True related='sequence_id.prefix' string='Prefix'
  • sequence_id Many2one → ir.sequence
    check_company=True comodel_name='ir.sequence' required=True string='Sequence'
  • suffix Char
    readonly=True related='sequence_id.suffix' string='Suffix'
  • use_sequence_option Boolean
    related='base_id.use_sequence_option' store=True
Public methods (2)
  • get_model_options(self, model)
  • get_sequence(self, record, options=False)
    Find sequence option that match the record values
STATUS
STATUSOpen migration PR - not merged yet for this version
REPOSITORY
REPOSITORYOCA/server-tools
PULL REQUEST
PULL REQUEST[19.0][MIG] base_sequence_option (#3514)