Skip to content
Permalink
Browse files

[FIX] purchase: locked purchase orders are billable

Before this commit, when the PO was locked:
- the button create bill did not appear on the form view
- on the invoice form view, the field autocomplete did not mention the PO

After this commit, the button create bill is present, and the PO appears in
the auto-complete field of the Vendor bill

OPW 1970537

closes #32794

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
  • Loading branch information...
kebeclibre committed Apr 18, 2019
1 parent a73206c commit b130b35f048c6fbe9dd0ee1b076541e47b5788ad
Showing with 3 additions and 3 deletions.
  1. +1 −1 addons/purchase/report/purchase_bill.py
  2. +2 −2 addons/purchase/views/purchase_views.xml
@@ -37,7 +37,7 @@ def init(self):
NULL as vendor_bill_id, id as purchase_order_id
FROM purchase_order
WHERE
state = 'purchase' AND
state in ('purchase', 'done') AND
invoice_status in ('to invoice', 'no')
)""")

@@ -135,12 +135,12 @@
<button name="print_quotation" string="Print RFQ" type="object" states="draft" class="oe_highlight" groups="base.group_user"/>
<button name="button_confirm" type="object" states="sent" string="Confirm Order" class="oe_highlight" id="bid_confirm"/>
<button name="button_approve" type="object" states='to approve' string="Approve Order" class="oe_highlight" groups="purchase.group_purchase_manager"/>
<button name="action_view_invoice" string="Create Bill" type="object" class="oe_highlight" context="{'create_bill':True}" attrs="{'invisible': ['|', ('state', 'not in', ('purchase')), ('invoice_status', 'in', ('no', 'invoiced'))]}"/>
<button name="action_view_invoice" string="Create Bill" type="object" class="oe_highlight" context="{'create_bill':True}" attrs="{'invisible': ['|', ('state', 'not in', ('purchase', 'done')), ('invoice_status', 'in', ('no', 'invoiced'))]}"/>
<button name="action_rfq_send" states="sent" string="Re-Send by Email" type="object" context="{'send_rfq':True}"/>
<button name="print_quotation" string="Print RFQ" type="object" states="sent" groups="base.group_user"/>
<button name="button_confirm" type="object" states="draft" string="Confirm Order" id="draft_confirm"/>
<button name="action_rfq_send" states="purchase" string="Send PO by Email" type="object" context="{'send_rfq':False}"/>
<button name="action_view_invoice" string="Create Bill" type="object" context="{'create_bill':True}" attrs="{'invisible': ['|', '|', ('state', 'not in', ('purchase')), ('invoice_status', 'not in', ('no', 'invoiced')), ('order_line', '=', [])]}"/>
<button name="action_view_invoice" string="Create Bill" type="object" context="{'create_bill':True}" attrs="{'invisible': ['|', '|', ('state', 'not in', ('purchase', 'done')), ('invoice_status', 'not in', ('no', 'invoiced')), ('order_line', '=', [])]}"/>
<button name="button_draft" states="cancel" string="Set to Draft" type="object" />
<button name="button_cancel" states="draft,to approve,sent,purchase" string="Cancel" type="object" />
<button name="button_done" type="object" string="Lock" states="purchase"/>

0 comments on commit b130b35

Please sign in to comment.
You can’t perform that action at this time.