Repository
OCA/sale-workflow · module folder · Try on Runboat
Module version
0.3.1
Category
Sales
Folder size
0.08 MB
License
LGPL-3
Application
No
Auto-installable
No
Website
https://github.com/OCA/sale-workflow
Last tracking update
2026-08-07 07:17:43
Authors
Camptocamp, Odoo Community Association (OCA)
Maintainers
Camptocamp, Odoo Community Association (OCA)
Committers
Pedro M. Baeza, Denis Roussel, Stéphane Bidoul (ACSONE)
Odoo dependencies
Python dependencies
None
System dependencies
None
Required by
logistic_order, sale_quotation_sourcing_stock_route_transit
Description

Code Analysis

Views touched (2)
XML IDNameModelTypeStatus
sale_order_form_view sale.order form Inherits sale.view_order_form
sale_order_sourcing_wizard sale.order.sourcing form New
HTTP endpoints (0)

No HTTP endpoints found for this module.

Models touched (6)

New fields (0)

No new fields.

Public methods (1)
  • make_po(self)
    @api.multi
    link the procurement to the PO line sourcing the SO line if the SO line is manually sourced. Otherwise, use the normal implementation.

New fields (0)

No new fields.

Public methods (2)
  • name_get(self)
    @api.multi
    Add the PO number in the name
  • name_search(self, name, args=None, operator='ilike', limit=100)
    @api.model
    Do the name search on purchase order, bounded by args

New fields (0)

No new fields.

Public methods (2)
  • action_button_confirm(self)
    @api.multi
    before triggering the workflow, if some lines need sourcing, run the sourcing wizard, otherwise, propagate the call and do the confirmation of the SO.
  • has_consistent_routes(self)
    @api.multi

New fields (2)
  • manually_sourced Boolean
    args: 'Manually Sourced'
  • sourced_by Many2one → purchase.order.line
    copy=False domain="[('product_id', '=', product_id), ('order_id.state', 'in', ['draft', 'confirmed'])]" args: 'purchase.order.line'
Public methods (3)
  • has_consistent_route(self)
    @api.multi
  • needs_sourcing(self)
    @api.multi
  • set_route_form_so(self)
    @api.one@api.onchange('sourced_by')@api.constrains('sourced_by')
    Set route on SO line based on fields sourced_by. Wee look for the PO related to current SO line by the sourced_by fields. If the PO has a destination location with usage "customer" we apply the dropshipping route to current SO line. If the PO has a destination location with usage "internal" we apply the make to order route to current SO line. As there is no trigger decorator that works on non computed fields we use constrains decorator instead.

New fields (4)
  • po_line_id Many2one → purchase.order.line
    domain="[('product_id', '=', product_id), ('order_id.state', 'in', ['draft', 'confirmed'])]" string='Sourced By' args: 'purchase.order.line'
  • product_id Many2one → product.product
    related=('so_line_id', 'product_id') string='Product' args: 'product.product'
  • so_line_id Many2one → sale.order.line
    string='Sale Order Line' args: 'sale.order.line'
  • wizard_id Many2one → sale.order.sourcing
    string='Wizard' args: 'sale.order.sourcing'
Public methods (0)

No public methods.

New fields (2)
  • line_ids One2many → sale.order.line.sourcing
    string='Lines' args: 'sale.order.line.sourcing', 'wizard_id'
  • sale_id Many2one → sale.order
    string='Sale Order' args: 'sale.order'
Public methods (1)
  • action_done(self)
    @api.multi

Loading…

Loading…