Purchase Return

purchase_return
REPOSITORY
REPOSITORYOCA/purchase-workflow
GIT
GIThttps://github.com/OCA/purchase-workflow.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/purchase-workflow/tree/16.0/purchase_return
VERSION
VERSION 1.0.4
CATEGORY
CATEGORYPurchases
LICENSE
LICENSELGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), ForgeFlow
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), ForgeFlow
COMMITTERS
COMMITTERSWeblate, OCA-git-bot, oca-ci, AlexPForgeFlow, PauBForgeFlow, ChanGuaZzz
WEBSITE
WEBSITEhttps://github.com/OCA/purchase-workflow
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:53:55
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - purchase
    - account
    - base_setup
    - base
    - web
    - product
    - mail
    - bus
    - web_tour
    - uom
    - analytic
    - portal
    - web_editor
    - http_routing
    - auth_signup
    - digest
    - resource
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (19)
XML IDNameModelTypeStatus
product_template_form_view product.template.form.inherit product.template group Inherits account.product_template_form_view
purchase_return_order_form purchase.return.order.form purchase.return.order form New
purchase_return_order_graph purchase.return.order.graph purchase.return.order graph New
purchase_return_order_line_form2 purchase.return.order.line.form2 purchase.return.order.line form New
purchase_return_order_line_search purchase.return.order.line.search purchase.return.order.line search New
purchase_return_order_line_tree purchase.return.order.line.tree purchase.return.order.line tree New
purchase_return_order_pivot purchase.return.order.pivot purchase.return.order pivot New
purchase_return_order_tree purchase.return.order.tree purchase.return.order tree New
purchase_return_order_view_activity purchase.return.order.activity purchase.return.order activity New
purchase_return_order_view_search purchase.return.order.select purchase.return.order search New
purchase_return_order_view_tree purchase.return.order.view.tree purchase.return.order tree New
report_purchasereturnorder report_purchasereturnorder ir.ui.view qweb New
report_purchasereturnorder_document report_purchasereturnorder_document ir.ui.view qweb New
track_po_line_qty_received_template track_po_line_qty_received_template ir.ui.view qweb New
track_po_line_template track_po_line_template ir.ui.view qweb New
view_category_property_form product.category.property.form.inherit product.category field Inherits account.view_category_property_form
view_move_form_inherit_repair_vendor_refund account.move.inherit.repair.vendor.refund account.move field Inherits account.view_move_form
view_purchase_return_order_filter purchase.return.draft.select purchase.return.order search New
view_purchase_return_order_kanban purchase.return.order.kanban purchase.return.order kanban New
Models touched (6)

New fields (1)
  • purchase_return_id Many2one → purchase.return.order
    copy=False help='Auto-complete from a past purchase return order.' readonly=True states={'draft': [('readonly', False)]} store=False string='Purchase Return Order' args: 'purchase.return.order'
Public methods (2)
  • create(self, vals_list)
    @api.model_create_multi
  • write(self, vals)

New fields (2)
  • purchase_return_line_id Many2one → purchase.return.order.line
    copy=False index=True ondelete='set null' args: 'purchase.return.order.line', 'Purchase Return Order Line'
  • purchase_return_order_id Many2one → purchase.return.order
    copy=False readonly=True related='purchase_return_line_id.order_id' args: 'purchase.return.order', 'Purchase Return Order'
Public methods (0)

No public methods.

New fields (1)
  • property_account_vendor_return_categ_id Many2one → account.account
    company_dependent=True domain=ACCOUNT_DOMAIN help='Keep this field empty to use the default value from the product category.' string='Purchase Returns Account' args: 'account.account'
Public methods (0)

No public methods.

New fields (1)
  • property_account_vendor_return_id Many2one → account.account
    company_dependent=True domain=ACCOUNT_DOMAIN help='Keep this field empty to use the default value from the product category.' string='Purchase Returns Account' args: 'account.account'
Public methods (0)

No public methods.

New fields (25)
  • amount_tax Monetary
    compute='_compute_amount_all' readonly=True store=True string='Taxes'
  • amount_total Monetary
    compute='_compute_amount_all' readonly=True store=True string='Total'
  • amount_untaxed Monetary
    compute='_compute_amount_all' readonly=True store=True string='Untaxed Amount' tracking=True
  • company_id Many2one → res.company
    default=<expr> index=True required=True states=READONLY_STATES args: 'res.company', 'Company'
  • currency_id Many2one → res.currency
    default=<expr> required=True states=READONLY_STATES args: 'res.currency', 'Currency'
  • currency_rate Float
    compute='_compute_currency_rate' compute_sudo=True help='Ratio between the purchase order currency and the company currency' readonly=True store=True args: 'Rate Currency'
  • date_approve Datetime
    copy=False index=True readonly=1 args: 'Confirmation Date'
  • date_order Datetime
    copy=False default=fields.Datetime.now help='Depicts the date within which the Quotation should be confirmed and converted into a purchase order.' index=True required=True states=READONLY_STATES args: 'Order Deadline'
  • date_planned Datetime
    compute='_compute_date_planned' copy=False help='Delivery date to return to the vendor. This date is used to determine expected shipment of products.' index=True readonly=False store=True string='Issue Date'
  • dest_address_id Many2one → res.partner
    domain="['|', ('company_id', '=', False), ('company_id', '=', company_id)]" help='Put an address if you want to return directly from the customer to the vendor. Otherwise, keep empty to deliver from your own company.' states=READONLY_STATES string='Drop Ship Address' args: 'res.partner'
  • fiscal_position_id Many2one → account.fiscal.position
    domain="['|', ('company_id', '=', False), ('company_id', '=', company_id)]" string='Fiscal Position' args: 'account.fiscal.position'
  • incoterm_id Many2one → account.incoterms
    help='International Commercial Terms are a series of predefined commercial terms used in international transactions.' states={'done': [('readonly', True)]} args: 'account.incoterms', 'Incoterm'
  • invoice_count Integer
    compute='_compute_invoice' copy=False default=0 store=True string='Bill Count'
  • invoice_ids Many2many → account.move
    compute='_compute_invoice' copy=False store=True string='Bills' args: 'account.move'
  • invoice_status Selection
    compute='_compute_get_invoiced' copy=False default='no' readonly=True store=True string='Billing Status' args: [('no', 'Nothing to Refund'), ('to invoice', 'Waiting Refunds'), ('invoiced', 'Fully Refunded')]
  • name Char
    copy=False default='New' index=True required=True args: 'Order Reference'
  • notes Text
    args: 'Terms and Conditions'
  • order_line One2many → purchase.return.order.line
    copy=True states={'cancel': [('readonly', True)], 'done': [('readonly', True)]} string='Order Lines' args: 'purchase.return.order.line', 'order_id'
  • origin Char
    copy=False help='Reference of the document that generated this purchase order request (e.g. a sales order)' args: 'Source Document'
  • partner_id Many2one → res.partner
    change_default=True domain="['|', ('company_id', '=', False), ('company_id', '=', company_id)]" help='You can find a vendor by its Name, TIN, Email or Internal Reference.' required=True states=READONLY_STATES string='Vendor' tracking=True args: 'res.partner'
  • partner_ref Char
    copy=False help="Reference of the sales order or bid sent by the vendor. It's used to do the matching when you receive the products as this reference is usually written on the delivery order sent by your vendor." args: 'Vendor Reference'
  • payment_term_id Many2one → account.payment.term
    domain="['|', ('company_id', '=', False), ('company_id', '=', company_id)]" args: 'account.payment.term', 'Payment Terms'
  • product_id Many2one → product.product
    readonly=False related='order_line.product_id' string='Product' args: 'product.product'
  • state Selection
    copy=False default='draft' index=True readonly=True string='Status' tracking=True args: [('draft', 'Draft'), ('sent', 'Sent'), ('to approve', 'To Approve'), ('purchase', 'Purchase Order Return'), ('done', 'Locked'), ('cancel', 'Cancelled')]
  • user_id Many2one → res.users
    check_company=True default=<expr> index=True string='Purchase Representative' tracking=True args: 'res.users'
Public methods (18)
  • action_create_refund(self)
    Create the refund associated to the PO.
  • action_draft_send(self)
    This function opens a window to compose an email, with the edi purchase template message loaded by default
  • action_view_invoice(self, invoices=False)
    This function returns an action that display existing vendor bills of given purchase order ids. When only one found, show the vendor bill immediately.
  • button_approve(self, force=False)
  • button_cancel(self)
  • button_confirm(self)
  • button_done(self)
  • button_draft(self)
  • button_unlock(self)
  • copy(self, default=None)
  • create(self, vals)
    @api.model
  • message_post(self, **kwargs)
    @api.returns('mail.message', <expr>)
  • name_get(self)
    @api.depends('name', 'partner_ref')
  • onchange(self, values, field_name, field_onchange)
    Override onchange to NOT to update all date_planned on PO lines when date_planned on PO is updated by the change of date_planned on PO lines.
  • onchange_date_planned(self)
    @api.onchange('date_planned')
  • onchange_partner_id(self)
    @api.onchange('partner_id', 'company_id')
  • print_return(self)
  • unlink(self)

New fields (26)
  • account_analytic_id Many2one → account.analytic.account
    readonly=False store=True string='Analytic Account' args: 'account.analytic.account'
  • company_id Many2one → res.company
    readonly=True related='order_id.company_id' store=True string='Company' args: 'res.company'
  • currency_id Many2one
    readonly=True related='order_id.currency_id' store=True string='Currency'
  • date_order Datetime
    readonly=True related='order_id.date_order' string='Order Date'
  • date_planned Datetime
    help="Delivery date expected from vendor. This date respectively defaults to vendor pricelist lead time then today's date." string='Delivery Date'
  • display_type Selection
    default=False help='Technical field for UX purpose.' args: [('line_section', 'Section'), ('line_note', 'Note')]
  • invoice_lines One2many → account.move.line
    copy=False readonly=True string='Bill Lines' args: 'account.move.line', 'purchase_return_line_id'
  • name Text
    required=True string='Description'
  • order_id Many2one → purchase.return.order
    index=True ondelete='cascade' required=True string='Order Reference' args: 'purchase.return.order'
  • partner_id Many2one → res.partner
    readonly=True related='order_id.partner_id' store=True string='Partner' args: 'res.partner'
  • price_subtotal Monetary
    compute='_compute_amount' store=True string='Subtotal'
  • price_tax Float
    compute='_compute_amount' store=True string='Tax'
  • price_total Monetary
    compute='_compute_amount' store=True string='Total'
  • price_unit Float
    digits='Product Price' required=True string='Unit Price'
  • product_id Many2one → product.product
    change_default=True domain=[('purchase_ok', '=', True)] string='Product' args: 'product.product'
  • product_qty Float
    digits='Product Unit of Measure' required=True string='Quantity'
  • product_type Selection
    readonly=True related='product_id.type'
  • product_uom Many2one → uom.uom
    domain="[('category_id', '=', product_uom_category_id)]" string='Unit of Measure' args: 'uom.uom'
  • product_uom_category_id Many2one
    related='product_id.uom_id.category_id'
  • product_uom_qty Float
    compute='_compute_product_uom_qty' store=True string='Total Quantity'
  • qty_invoiced Float
    compute='_compute_qty_invoiced' digits='Product Unit of Measure' store=True string='Refunded Qty'
  • qty_to_invoice Float
    compute='_compute_qty_invoiced' digits='Product Unit of Measure' readonly=True store=True string='To Invoice Quantity'
  • refund_only Boolean
    string='Refund only'
  • sequence Integer
    default=10 string='Sequence Line'
  • state Selection
    readonly=False related='order_id.state' store=True
  • taxes_id Many2many → account.tax
    domain=['|', ('active', '=', False), ('active', '=', True)] string='Taxes' args: 'account.tax'
Public methods (5)
  • create(self, vals_list)
    @api.model_create_multi
  • onchange_product_id(self)
    @api.onchange('product_id')
  • onchange_product_id_warning(self)
    @api.onchange('product_id')
  • unlink(self)
  • write(self, values)
STATUS
STATUSOpen migration PR - not merged yet for this version
REPOSITORY
REPOSITORYOCA/purchase-workflow
PULL REQUEST
PULL REQUEST[18.0][MIG] purchase_return: Migration to 18.0 (#2902)