Add 'Print Order' on PO (there was already a 'Print RFQ button'...)

This commit is contained in:
Alexis de Lattre
2017-12-07 18:25:55 +01:00
parent 54bd62d2d9
commit 034f01287b
2 changed files with 8 additions and 17 deletions

View File

@@ -49,6 +49,11 @@ class PurchaseOrder(models.Model):
})
return res
def print_order(self):
action = self.env['report'].get_action(
self, 'purchase.report_purchaseorder')
return action
class StockPicking(models.Model):
_inherit = 'stock.picking'

View File

@@ -11,25 +11,11 @@
<record id="purchase_order_form" model="ir.ui.view">
<field name="name">usability.purchase.order.form</field>
<field name="model">purchase.order</field>
<!-- high priority because we change the string of a page
and other modules inherit the page using the original string -->
<field name="priority">1000</field>
<field name="inherit_id" ref="purchase.purchase_order_form"/>
<field name="arch" type="xml">
<!-- So far, I consider the shortcut icon are enough
<notebook position="inside">
<page string="Deliveries" states="approved,except_picking,except_invoice,done">
<field name="picking_ids" nolabel="1"/>
</page>
<page string="Invoices" states="approved,except_picking,except_invoice,done">
<field name="invoice_ids" nolabel="1" context="{'form_view_ref': 'account.invoice_supplier_form'}"/>
</page>
</notebook>
-->
<!--
<page string="Deliveries &amp; Invoices" position="attributes">
<attribute name="string">Other Information</attribute>
</page> -->
<button name="action_rfq_send" states="purchase" position="after">
<button name="print_order" states="purchase" string="Print Order" type="object" groups="base.group_user"/>
</button>
<field name="fiscal_position_id" position="attributes">
<attribute name="widget">selection</attribute>
</field>