summaryrefslogtreecommitdiff
path: root/addons/purchase/views
diff options
context:
space:
mode:
authoryhu-odoo <yhu@odoo.com>2020-01-29 13:52:34 +0000
committeryhu-odoo <yhu@odoo.com>2020-03-27 09:33:21 +0000
commitd0455ae64ba3800c8a13c60c6b68a5638ed5d552 (patch)
treeacc5c8b130cfa7f6489eaf778c60d2908568add7 /addons/purchase/views
parent3c0809194068756c98473fc922f1bc37b42f86b3 (diff)
[IMP] purchase: make billing consitent with sale invoicing
======== Purpose ======== Currently, purchase missing some billing functions that we have in sale invoicing: - Create credit note when necessary - Create vendor bill in batch in list view ======== Spec ======== - In case of retures, when create a bill for a purchase order, we check the total amount we want to bill to decide whether it's a vendor bill or a credit note. - In the list view, add a new action to create vendor bill/credit note for all selected order. ======== Links ======== Task 2170715 PR #44210 Related: odoo/upgrade#919 Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
Diffstat (limited to 'addons/purchase/views')
-rw-r--r--addons/purchase/views/purchase_views.xml16
1 files changed, 14 insertions, 2 deletions
diff --git a/addons/purchase/views/purchase_views.xml b/addons/purchase/views/purchase_views.xml
index 273d3fe4360..de63c1550c4 100644
--- a/addons/purchase/views/purchase_views.xml
+++ b/addons/purchase/views/purchase_views.xml
@@ -127,12 +127,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', 'done')), ('invoice_status', 'in', ('no', 'invoiced'))]}"/>
+ <button name="action_create_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', 'done')), ('invoice_status', 'not in', ('no', 'invoiced')), ('order_line', '=', [])]}"/>
+ <button name="action_create_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"/>
@@ -652,4 +652,16 @@
</search>
</field>
</record>
+
+ <record id="action_purchase_batch_bills" model="ir.actions.server">
+ <field name="name">Create Vendor Bills</field>
+ <field name="model_id" ref="purchase.model_purchase_order"/>
+ <field name="binding_model_id" ref="purchase.model_purchase_order"/>
+ <field name='groups_id' eval="[(4, ref('account.group_account_invoice'))]"/>
+ <field name="state">code</field>
+ <field name="code">
+ if records:
+ action = records.action_create_invoice()
+ </field>
+ </record>
</odoo>