Repository
OCA/vertical-ngo · module folder · Try on Runboat
Module version
1.4.1
Category
Purchase Management
Folder size
0.29 MB
License
AGPL-3
Application
No
Auto-installable
No
Website
http://www.camptocamp.com
Last tracking update
2026-08-07 07:17:53
Authors
Camptocamp, Odoo Community Association (OCA)
Maintainers
Camptocamp, Odoo Community Association (OCA)
Committers
Pedro M. Baeza, Stéphane Bidoul (ACSONE)
Odoo dependencies
Python dependencies
None
System dependencies
None
Required by
framework_agreement_sourcing, logistic_budget, logistic_order_requisition_donation, logistic_requisition_department, logistic_requisition_donation
Description

Code Analysis

Views touched (25)
XML IDNameModelTypeStatus
purchase_order_form purchase_order_form purchase.order form Inherits ngo_purchase.purchase_order_form
quant_search_view stock.quant.search stock.quant search Inherits stock.quant_search_view
report_logistic_requisition report_logistic_requisition ir.ui.view qweb New
report_logistic_requisition_document report_logistic_requisition_document ir.ui.view qweb New
view_logistic_requisition_cancel Reason for the cancellation logistic.requisition.cancel form New
view_logistic_requisition_cancel_reason_form Logistics Requisition Cancel Reason logistic.requisition.cancel.reason form New
view_logistic_requisition_cancel_reason_tree Logistics Requisition Cancel Reason logistic.requisition.cancel.reason tree New
view_logistic_requisition_cost_estimate Logistics Requisition Cost Estimate logistic.requisition.cost.estimate form New
view_logistic_requisition_filter logistic.requisition.list.select logistic.requisition search New
view_logistic_requisition_form logistic.requisition.form logistic.requisition form New
view_logistic_requisition_line_assign_wizard Assign Requisition Line logistic.requisition.line.assign form New
view_logistic_requisition_line_calendar logistic.requisition.line.tree logistic.requisition.line calendar New
view_logistic_requisition_line_filter logistic.requisition.line.list.select logistic.requisition.line search New
view_logistic_requisition_line_form logistic.requisition.line.form logistic.requisition.line form New
view_logistic_requisition_line_kanban logistic.requisition.line.kanban logistic.requisition.line kanban New
view_logistic_requisition_line_tree logistic.requisition.line.tree logistic.requisition.line tree New
view_logistic_requisition_source_filter logistic.requisition.source.list.select logistic.requisition.source search New
view_logistic_requisition_source_form logistic.requisition.source.form logistic.requisition.source form New
view_logistic_requisition_source_tree logistic.requisition.source.tree logistic.requisition.source tree New
view_logistic_requisition_tree logistic.requisition.tree logistic.requisition tree New
view_order_form1 sale.order.form sale.order form Inherits sale_transport_multi_address.view_order_form
view_order_form2 sale.order.form sale.order form Inherits sale_sourced_by_line.view_order_form_form
view_order_form3 sale.order.form sale.order form Inherits sale_owner_stock_sourcing.view_order_form_inherit
view_order_form4 sale.order.form sale.order form Inherits logistic_order.view_order_form
view_order_line_form2_lr sale.order.line.form2.lr sale.order.line form Inherits sale.view_order_line_form2
HTTP endpoints (0)

No HTTP endpoints found for this module.

Models touched (17)

New fields (24)
  • analytic_id Many2one → account.analytic.account
    states=REQ_STATES args: 'account.analytic.account', 'Project'
  • cancel_reason_id Many2one → logistic.requisition.cancel.reason
    copy=False ondelete='restrict' readonly=True string='Reason for Cancellation' args: 'logistic.requisition.cancel.reason'
  • ce_count Integer
    compute='_count_cost_estimates' string='CE count'
  • company_id Many2one → res.company
    default=<expr> readonly=True args: 'res.company', 'Company'
  • consignee_id Many2one → res.partner
    domain=[('is_consignee', '=', True)] states=REQ_STATES args: 'res.partner', 'Consignee'
  • consignee_shipping_id Many2one → res.partner
    states=REQ_STATES args: 'res.partner', 'Delivery Address'
  • country_id Many2one → res.country
    select=True states=REQ_STATES string='Country' args: 'res.country'
  • currency_id Many2one → res.currency
    comodel_name='res.currency' readonly=True related='pricelist_id.currency_id' store=True string='Currency'
  • date Datetime
    default=fields.Datetime.now required=True states=REQ_STATES args: 'Requisition Date'
  • date_delivery Date
    required=True states=REQ_STATES args: 'Desired Delivery Date'
  • incoterm_address Char
    help='Incoterm Place of Delivery. International Commercial Terms are a series of predefined commercial terms used in international transactions.' states=REQ_STATES args: 'Incoterm Place'
  • incoterm_id Many2one → stock.incoterms
    help='International Commercial Terms are a series of predefined commercial terms used in international transactions.' states=REQ_STATES args: 'stock.incoterms', 'Incoterm'
  • line_ids One2many → logistic.requisition.line
    copy=True states={'done': [('readonly', True)]} string='Products to Purchase' args: 'logistic.requisition.line', 'requisition_id'
  • name Char
    copy=False default='/' readonly=True required=True args: 'Reference'
  • note Text
    states=REQ_STATES args: 'Remarks / Description'
  • partner_id Many2one → res.partner
    domain=[('customer', '=', True)] required=True states=REQ_STATES args: 'res.partner', 'Requestor'
  • po_count Integer
    compute='_count_purchase_orders' string='PO count'
  • pricelist_id Many2one → product.pricelist
    help='Pricelist that represents the currency for current logistics requisition.' required=True states=REQ_STATES args: 'product.pricelist', 'Pricelist'
  • requisition_type Selection
    default='standard' required=True selection=_get_requisition_type_selection states=REQ_STATES string='Type'
  • shipping_note Text
    states=REQ_STATES args: 'Delivery / Shipping Remarks'
  • source_document Char
    states=REQ_STATES args: 'Source Document'
  • sourced Float
    compute='_get_sourced' string='Sourced'
  • state Selection
    copy=False default='draft' readonly=True required=True string='State' args: [('draft', 'Draft'), ('confirmed', 'Confirmed'), ('done', 'Done'), ('cancel', 'Cancelled')]
  • user_id Many2one → res.users
    default=<expr> help='Mobilization Officer or Logistics Coordinator in charge of the Logistics Requisition' required=True states=REQ_STATES args: 'res.users', 'Business Unit Officer'
Public methods (13)
  • action_open_lr_cost_estimate(self)
    @api.multi
    Open cost estimates generated from this LR
  • action_open_lr_purchases(self)
    @api.multi
    Open Bids and Purchase order sourcing this LR
  • button_confirm(self)
    @api.multi
  • button_create_cost_estimate(self)
    @api.multi
  • button_reset(self)
    @api.multi
  • button_view_lines(self)
    @api.multi
    This function returns an action that display related lines.
  • button_view_source_lines(self)
    @api.multi
    This function returns an action that display related sourcing lines.
  • create(self, vals)
    @api.model
  • get_partner_requisition(self)
    @api.multi
  • get_requisition_type_selection(self)
    @api.model
    Extendable selection list
  • onchange_consignee_id_set_consignee_shipping_id(self)
    @api.onchange('consignee_id')
  • onchange_consignee_id_set_country_id(self)
    @api.onchange('consignee_id')
  • onchange_partner_id(self)
    @api.onchange('partner_id')
    We take the pricelist of the chosen partner

New fields (1)
  • reason_id Many2one → logistic.requisition.cancel.reason
    required=True string='Reason' args: 'logistic.requisition.cancel.reason'
Public methods (1)
  • confirm_cancel(self)
    @api.multi

New fields (1)
  • name Char
    required=True translate=True args: 'Reason'
Public methods (0)

No public methods.

New fields (3)
  • line_ids Many2many → logistic.requisition.line
    readonly=True string='Sourced Lines' args: 'logistic.requisition.line', 'requisition_cost_estimate_sourced_line', 'wizard_id', 'line_id'
  • requisition_id Many2one → logistic.requisition
    readonly=True required=True string='Logistics Requisition' args: 'logistic.requisition'
  • skipped_line_ids Many2many → logistic.requisition.line
    readonly=True string='Skipped Lines' args: 'logistic.requisition.line', 'requisition_cost_estimate_skipped_line', 'wizard_id', 'line_id'
Public methods (2)
  • cost_estimate(self)
    @api.multi
  • default_get(self, fields_list)
    @api.model

New fields (24)
  • account_id Many2one → account.account
    comodel_name='account.account' readonly=True related='product_id.property_account_income' string='Nominal Account'
  • amount_total Float
    compute='_get_total_cost' digits=dp.get_precision('Account') store=True string='Total Amount'
  • consignee_id Many2one
    co_model='res.partner' related='requisition_id.consignee_id' string='Consignee'
  • consignee_shipping_id Many2one
    co_model='res.partner' related='requisition_id.consignee_shipping_id' string='Delivery Address'
  • cost_estimate_id Many2one → sale.order
    copy=False readonly=True string='Cost Estimate' args: 'sale.order'
  • country_id Many2one → res.country
    comodel_name='res.country' readonly=True related='requisition_id.country_id' store=True string='Country'
  • currency_id Many2one → res.currency
    comodel_name='res.currency' readonly=True related='requisition_id.currency_id' store=True string='Currency'
  • date_delivery Date
    required=True states=REQUEST_STATES args: 'Desired Delivery Date'
  • description Text
    required=True states=REQUEST_STATES args: 'Description'
  • incoterm_address Char
    help='Incoterm Place of Delivery. International Commercial Terms are a series of predefined commercial terms used in international transactions.' related='requisition_id.incoterm_address' string='Incoterm Place'
  • incoterm_id Many2one
    co_model='stock.incoterms' help='International Commercial Terms are a series of predefined commercial terms used in international transactions.' related='requisition_id.incoterm_id' string='Incoterm'
  • logistic_user_id Many2one → res.users
    help='User in charge of the Logistics Requisition Line' states=REQUEST_STATES track_visibility='never' args: 'res.users', 'Assigned To'
  • name Char
    copy=False default='/' readonly=True args: 'Line No.'
  • note Text
    args: 'Remarks / Conditions'
  • product_id Many2one → product.product
    states=REQUEST_STATES args: 'product.product', 'Product'
  • requested_qty Float
    default=1.0 digits=dp.get_precision('Product UoM') states=REQUEST_STATES args: 'Quantity'
  • requested_uom_id Many2one → product.uom
    required=True states=REQUEST_STATES args: 'product.uom', 'Product UoM'
  • requestor_id Many2one
    co_model='res.partner' related='requisition_id.partner_id' string='Requestor'
  • requisition_id Many2one → logistic.requisition
    ondelete='cascade' readonly=True required=True args: 'logistic.requisition', 'Requisition'
  • requisition_type Selection
    readonly=True related='requisition_id.requisition_type' selection=LogisticsRequisition._get_requisition_type_selection string='Requisition Type'
  • shipping_note Text
    related='requisition_id.shipping_note' string='Delivery / Shipping Remarks'
  • source_ids One2many → logistic.requisition.source
    states={'sourced': [('readonly', True)], 'quoted': [('readonly', True)]} string='Source Lines' args: 'logistic.requisition.source', 'requisition_line_id'
  • state Selection
    copy=False default='draft' help='Draft: Created\nConfirmed: Requisition has been confirmed\nAssigned: Waiting the creation of a quote\nSourced: The line has been sourced from procurement or warehouse\nQuoted: Quotation made for the line\nCancelled: The requisition has been cancelled' readonly=True required=True string='State' args: STATES
  • stock_count Integer
    compute='_stock_count'
Public methods (11)
  • action_view_stock(self)
    @api.multi
  • button_cancel(self)
    @api.multi
  • button_create_cost_estimate(self)
    @api.multi
  • button_create_po_requisition(self)
    @api.multi
    Create a single purchase requisition for selected requisition lines Then open the created purchase requisition
  • button_open_cost_estimate(self)
    @api.multi
  • button_reset(self)
    @api.multi
  • button_sourced(self)
    @api.multi
  • create(self, vals)
    @api.model
  • name_get(self)
    @api.multi
    Returns a list of tupples containing id, name. result format: {[(id, name), (id, name), ...]}
  • onchange_product_id(self)
    @api.onchange('product_id')
    Changes UoM and name if product_id changes. @param name: Name of the field @param product_id: Changed product_id @return: Dictionary of changed values
  • write(self, vals)
    @api.multi
    Send a message to the user when it is assigned and move the state's line to assigned.

New fields (1)
  • logistic_user_id Many2one → res.users
    help='Logistics Specialist in charge of the Logistics Requisition Line' required=True args: 'res.users', 'Logistics Specialist'
Public methods (1)
  • assign(self)
    @api.multi

New fields (27)
  • consignee_shipping_id Many2one → res.partner
    comodel_name='res.partner' readonly=True related='requisition_line_id.requisition_id.consignee_shipping_id' string='Delivery Address'
  • currency_id Many2one → res.currency
    comodel_name='res.currency' readonly=True related='requisition_line_id.requisition_id.currency_id' string='Currency'
  • default_source_address Many2one → res.partner
    comodel_name='res.partner' compute='_default_source_address' readonly=True string='Default source'
  • dispatch_location_id Many2one → stock.location
    comodel_name='stock.location' readonly=True related='dispatch_warehouse_id.lot_stock_id' store=True string='Dispatch Location'
  • dispatch_warehouse_id Many2one → stock.warehouse
    states=SOURCED_STATES string='Dispatch From' args: 'stock.warehouse'
  • location_partner_id Many2one → res.partner
    comodel_name='res.partner' readonly=True related='dispatch_warehouse_id.partner_id' string='Location Address'
  • name Char
    copy=False default='/' readonly=True args: 'Source Name'
  • origin Char
    args: 'Origin'
  • po_requisition_id Many2one → purchase.requisition
    comodel_name='purchase.requisition' readonly=True related='purchase_requisition_line_id.requisition_id' string='Purchase Requisition'
  • price_is Selection
    help='When the price is an estimation, the final price may change. I.e. it is not based on a request for quotation.' required=True string='Price is' args: PRICE_IS_SELECTION
  • proposed_product_id Many2one → product.product
    required=True states=SOURCED_STATES string='Proposed Product' args: 'product.product'
  • proposed_qty Float
    default=1 digits=dp.get_precision('Product UoM') states=SOURCED_STATES args: 'Proposed Qty'
  • proposed_uom_id Many2one → product.uom
    states=SOURCED_STATES string='Proposed UoM' args: 'product.uom'
  • purchase_line_id Many2one → purchase.order.line
    comodel_name='purchase.order.line' compute='_get_purchase_line_id' readonly=True string='Purchase Order Line'
  • purchase_requisition_line_id Many2one → purchase.requisition.line
    copy=False ondelete='set null' readonly=True args: 'purchase.requisition.line', 'Purchase Requisition Line'
  • requisition_id Many2one → logistic.requisition
    comodel_name='logistic.requisition' readonly=True related='requisition_line_id.requisition_id' store=True string='Logistics Requisition'
  • requisition_line_id Many2one → logistic.requisition.line
    ondelete='cascade' readonly=True required=True string='Requisition Line' args: 'logistic.requisition.line'
  • selectable_bid_line_ids Many2many → purchase.requisition.line
    comodel_name='purchase.requisition.line' compute='_get_selectable_bid_line_ids'
  • selectable_purchase_req_ids Many2many → purchase.order
    comodel_name='purchase.order' compute='_get_selectable_purchase_req_ids'
  • selected_bid_id Many2one → purchase.order
    comodel_name='purchase.order' readonly=True related='selected_bid_line_id.order_id' string='Selected Bid'
  • selected_bid_line_id Many2one → purchase.order.line
    copy=False ondelete='restrict' readonly=True args: 'purchase.order.line', 'Bid Selected Line'
  • sourcing_method Selection
    default='other' oldname='procurement_method' required=True states=SOURCED_STATES string='Sourcing Method' args: [('procurement', 'Go to Tender'), ('reuse_bid', 'Use Existing Bid'), ('wh_dispatch', 'Warehouse Dispatch'), ('fw_agreement', 'Framework Agreement'), ('other', 'Other')]
  • state Selection
    readonly=True related='requisition_line_id.state' selection=LogisticsRequisitionLine.STATES string="Line's State"
  • stock_owner_id Many2one → res.partner
    comodel_name='res.partner' string='Stock owner'
  • supplier_partner_id Many2one → res.partner
    comodel_name='res.partner' readonly=True related='selected_bid_line_id.order_id.partner_id' string='Supplier Address'
  • total_cost Float
    compute='_get_total_cost' digits=dp.get_precision('Account') store=True string='Total Cost'
  • unit_cost Float
    digits=dp.get_precision('Account') states=SOURCED_STATES args: 'Unit Cost'
Public methods (9)
  • action_create_po_requisition(self)
    @api.multi
    Create a single purchase requisition for selected requisition sources Then open the created purchase requisition
  • action_open_po_requisition(self)
    @api.multi
    Method called from view
  • create(self, vals)
    @api.model
  • onchange_dispatch_warehouse_id(self)
    @api.onchange('dispatch_warehouse_id')
    Get the address of the warehouse and write it in the location_partner_id field, this field is a related read-only, so this change will never be submitted to the server. But it is necessary to set the default "from address" of the transport plan in the context.
  • onchange_po_requisition_id(self)
    @api.onchange('po_requisition_id')
    Empty selected_bid_line when po_requisition_id is manually changed
  • onchange_selected_bid_id(self)
    @api.onchange('selected_bid_id')
    Get the address of the supplier and write it in the supplier_partner_id field, this field is a related read-only, so this change will never be submitted to the server. But it is necessary to set the default "from address" of the transport plan in the context.
  • onchange_selected_bid_line_id(self)
    @api.onchange('selected_bid_line_id')
    Copy unit cost from bid line
  • onchange_sourcing_method(self)
    @api.onchange('sourcing_method')
    Set `price_is` to fixed when reusing a bid
  • open_po_requisition(self, purch_req=None)
    @api.multi

New fields (0)

No new fields.

Public methods (1)
  • action_po_assign(self)
    Called from the workflow to assign the purchase order to a procurement. Normally, it creates a purchase order for the procurement. Here, we check if it already exists and in such case, we just update the state and keep the assigned purchase order. A purchase order is already assigned to the procurement when a `sale.order` is created from a logistic requisition which has already a `purchase.order`.

New fields (3)
  • logistic_order_count Integer
    compute='_count_logistic_order'
  • transport_mode_id Many2one → transport.mode
    args: 'transport.mode', 'Transport Mode'
  • transport_vehicle_id Many2one → transport.vehicle
    args: 'transport.vehicle', 'Transport Vehicle'
Public methods (1)
  • action_open_logistic_orders(self)
    @api.multi

New fields (4)
  • from_bid_line_id Many2one → purchase.order.line
    readonly=True args: 'purchase.order.line', 'Generated from bid'
  • lo_line_ids One2many → sale.order.line
    comodel_name='sale.order.line' inverse_name='sourced_by'
  • lr_source_line_id Many2one → logistic.requisition.source
    ondelete='restrict' readonly=True args: 'logistic.requisition.source', 'Logistics Requisition Source'
  • po_line_from_bid_ids One2many → purchase.order.line
    readonly=True args: 'purchase.order.line', 'from_bid_line_id', 'Lines generated by the bid'
Public methods (3)
  • copy_data(self, cr, uid, res_id, default=None, context=None)
    When copying purchase order lines to reuse a bid Link them to logistic requisition lines
  • unlink(self)
    @api.multi
  • write(self, vals)
    @api.multi
    Here we implement something to allow the update of LRS when some information are changed in PO line. It should be possible to do it when: PO is still in draft LRL is not marked as sourced Once done, nobody should be able to change the PO line infos

New fields (2)
  • transport_mode_id Many2one → transport.mode
    args: 'transport.mode', 'Transport Mode'
  • transport_vehicle_id Many2one → transport.vehicle
    args: 'transport.vehicle', 'Transport Vehicle'
Public methods (1)
  • tender_closed(self)
    @api.multi
    We have to split the logistic requisition lines according to the selected lines after the selection of the lines, when we click on the 'Confirm selection of lines'.

New fields (1)
  • logistic_requisition_source_ids One2many → logistic.requisition.source
    readonly=True string='Logistics Requisition Source Lines' args: 'logistic.requisition.source', 'purchase_requisition_line_id'
Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (4)
  • lr_count Integer
    compute='_count_logistic_requisition'
  • lr_purchase_count Integer
    compute='_count_lr_purchase'
  • lr_source_count Integer
    compute='_count_lr_source'
  • requisition_id Many2one → logistic.requisition
    copy=False ondelete='restrict' args: 'logistic.requisition', 'Logistics Requisition'
Public methods (4)
  • action_accepted(self)
    @api.multi
    On acceptation of Cost Estimate, we generate PO for all line sourced by a tender Plus, we duplicate PO for reused bids
  • action_open_logistic_requisition(self)
    @api.multi
  • action_open_lr_purchases(self)
    @api.multi
    Open Bids and Purchase order sourcing this cost estimate
  • action_open_lr_sources(self)
    @api.multi

New fields (4)
  • lr_source_id Many2one → logistic.requisition.source
    readonly=True args: 'logistic.requisition.source', 'Logistics Requisition Source'
  • price_is Selection
    default='fixed' help='When the price is an estimation, the final price may change. I.e. it is not based on a request for quotation.' string='Price is' args: LogisticsRequisitionSource.PRICE_IS_SELECTION
  • sourced_by Many2one
    domain="[('product_id', '=', product_id), ('order_id.state', 'in', ['draftpo', 'confirmed'])]"
  • sourcing_method Selection
    related='lr_source_id.sourcing_method' selection=[('procurement', 'Go to Tender'), ('reuse_bid', 'Use Existing Bid'), ('wh_dispatch', 'Warehouse Dispatch'), ('fw_agreement', 'Framework Agreement'), ('other', 'Other')]
Public methods (1)
  • product_id_change_with_wh(self, cr, uid, ids, pricelist, product, qty=0, uom=False, qty_uos=0, uos=False, name='', partner_id=False, lang=False, update_tax=True, date_order=False, packaging=False, fiscal_position=False, flag=False, warehouse_id=False, context=None)

New fields (1)
  • po_line_id Many2one
    domain="[('product_id', '=', product_id), ('order_id.state', 'in', ['draftpo', 'confirmed'])]"
Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (2)
  • name_get(self, cr, user, ids, context=None)
    Returns a list of tupples containing id, name. result format: {[(id, name), (id, name), ...]} @param cr: A database cursor @param user: ID of the user currently logged in @param ids: list of ids for which name should be read @param context: context arguments, like lang, time zone @return: Returns a list of tupples containing id, name composed by code + name
  • name_search(self, name, args=None, operator='ilike', limit=100)
    @api.model
    Allows to search incoterms by code Show results by code on top as they are more accurate.

Loading…

Loading…

Loading…