Stock Ownership Availability Rules

stock_ownership_availability_rules
REPOSITORY
REPOSITORYOCA/stock-logistics-workflow
GIT
GIThttps://github.com/OCA/stock-logistics-workflow.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/stock-logistics-workflow/tree/10.0/stock_ownership_availability_rules
VERSION
VERSION 1.0.2
CATEGORY
CATEGORYPurchase Management
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Camptocamp
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Camptocamp
COMMITTERS
COMMITTERSPedro M. Baeza, GitHub, Cédric Pigeon, Denis Roussel, Stéphane Bidoul (ACSONE), OCA Transbot, oca-travis, OCA-git-bot
WEBSITE
WEBSITE
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:19:59
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - stock
    - product
    - base
    - decimal_precision
    - mail
    - base_setup
    - web_kanban
    - web
    - bus
    - web_tour
    - report
    - procurement
    - barcodes
    - web_planner
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (5)
XML IDNameModelTypeStatus
quant_search_view quant_search_view stock.quant xpath Inherits stock.quant_search_view
view_move_form view_move_form stock.move field Inherits stock.view_move_form
view_move_picking_form view_move_picking_form stock.move field Inherits stock.view_move_picking_form
view_move_search view_move_search stock.move filter Inherits stock.view_move_search
view_move_tree view_move_picking_tree stock.move field Inherits stock.view_move_tree
Models touched (3)

New fields (0)

No new fields.

Public methods (1)
  • action_open_quants(self)
    @api.multi

New fields (0)

No new fields.

Public methods (1)
  • create(self, vals)
    @api.model
    Set the owner based on the location. This is not a default method because we need to know the location.

New fields (1)
  • owner_id Many2one → res.partner
    help='This is the owner of the quant' index=True readonly=True required=True args: 'res.partner', 'Owner'
Public methods (1)
  • create(self, vals)
    @api.model
    Set the owner based on the location. This is not a default method because we need to know the location.
REPOSITORY
REPOSITORYOCA/stock-logistics-workflow
GIT
GIThttps://github.com/OCA/stock-logistics-workflow.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/stock-logistics-workflow/tree/9.0/stock_ownership_availability_rules
VERSION
VERSION 0.2.0
CATEGORY
CATEGORYPurchase Management
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Camptocamp
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Camptocamp
COMMITTERS
COMMITTERSPedro M. Baeza, Stéphane Bidoul (ACSONE)
WEBSITE
WEBSITE
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:15:22
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - stock
    - product
    - base
    - decimal_precision
    - mail
    - base_setup
    - web_kanban
    - web
    - bus
    - report
    - procurement
    - barcodes
    - web_planner
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (5)
XML IDNameModelTypeStatus
quant_search_view quant_search_view stock.quant filter Inherits stock.quant_search_view
view_move_form view_move_form stock.move field Inherits stock.view_move_form
view_move_picking_form view_move_picking_form stock.move field Inherits stock.view_move_picking_form
view_move_search view_move_search stock.move filter Inherits stock.view_move_search
view_move_tree view_move_picking_tree stock.move field Inherits stock.view_move_tree
Models touched (2)

New fields (0)

No new fields.

Public methods (1)
  • action_open_quants(self, cr, uid, ids, context=None)

New fields (1)
  • owner_id Many2one → res.partner
    help='This is the owner of the quant' readonly=True required=True select=True args: 'res.partner', 'Owner'
Public methods (2)
  • create(self, vals)
    @api.model
    Set the owner based on the location. This is not a default method because we need to know the location.
  • quants_get_prefered_domain(self, location, product, qty, domain=None, prefered_domain_list=None, restrict_lot_id=False, restrict_partner_id=False)
    @api.model
    Enforce the requested owner on quant reservation. If no restriction is imposed, enforce the location partner (or the company partner) as owner. On the other hand, the core stock module uses the requested owner as first choice, but then reserves anything else. Also, no restriction means we can reserve anything, while we want to reserve only own stock.
REPOSITORY
REPOSITORYOCA/stock-logistics-workflow
GIT
GIThttps://github.com/OCA/stock-logistics-workflow.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/stock-logistics-workflow/tree/8.0/stock_ownership_availability_rules
VERSION
VERSION 0.2.0
CATEGORY
CATEGORYPurchase Management
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Camptocamp
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Camptocamp
COMMITTERS
COMMITTERSStéphane Bidoul, Guewen Baconnier, Alexandre Fayolle, Laetitia Gangloff, Leonardo Pistone, GitHub, Cédric Pigeon, Laurent Mignon (ACSONE), Stéphane Bidoul (ACSONE), OCA Transbot, Rudolf Schnapka, oca-travis, Weblate, OCA-git-bot
WEBSITE
WEBSITE
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:11:24
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - stock
    - product
    - base
    - decimal_precision
    - mail
    - base_setup
    - web_kanban
    - web
    - report
    - procurement
    - board
    - web_kanban_gauge
    - web_kanban_sparkline
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (5)
XML IDNameModelTypeStatus
quant_search_view quant_search_view stock.quant filter Inherits stock.quant_search_view
view_move_form view_move_form stock.move field Inherits stock.view_move_form
view_move_picking_form view_move_picking_form stock.move field Inherits stock.view_move_picking_form
view_move_search view_move_search stock.move filter Inherits stock.view_move_search
view_move_tree view_move_picking_tree stock.move field Inherits stock.view_move_tree
Models touched (3)

New fields (0)

No new fields.

Public methods (1)
  • action_open_quants(self, cr, uid, ids, context=None)

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (1)
  • owner_id Many2one → res.partner
    help='This is the owner of the quant' readonly=True required=True select=True args: 'res.partner', 'Owner'
Public methods (2)
  • create(self, vals)
    @api.model
    Set the owner based on the location. This is not a default method because we need to know the location. Quants are always created as superuser and can't be manually created (enforced by ACL). Therefore, we can't use the company of the current user as default owner.
  • quants_get_prefered_domain(self, location, product, qty, domain=None, prefered_domain_list=None, restrict_lot_id=False, restrict_partner_id=False)
    @api.model
    Enforce the requested owner on quant reservation. If no restriction is imposed, enforce the location partner (or the company partner) as owner. On the other hand, the core stock module uses the requested owner as first choice, but then reserves anything else. Also, no restriction means we can reserve anything, while we want to reserve only own stock.