Repository
OCA/server-tools · module folder · Try on Runboat
Module version
1.0.1
Category
Tools
Folder size
0.08 MB
License
LGPL-3
Application
No
Auto-installable
No
Website
https://github.com/OCA/server-tools
Last tracking update
2026-08-07 08:42:57
Authors
Odoo Community Association (OCA), Ecosoft
Maintainers
Odoo Community Association (OCA), Ecosoft
Committers
Stefan Rijnhart, Weblate, OCA-git-bot, oca-ci, Frédéric GRALL
Odoo dependencies
odoo/odoo:
Python dependencies
odoo_test_helper
System dependencies
None
Required by
account_sequence_option, hr_expense_sequence_option
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
HTTP endpoints (0)

No HTTP endpoints found for this module.

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

Loading…

Loading…

Loading…

Loading…

Status
Open migration PR — not merged yet for this version
CI status
green — ready to merge
Open since
197 days ago
Last activity
84 days ago
Repository
OCA/server-tools
Pull request
[19.0][MIG] base_sequence_option (#3514)