[IMP] point_of_sale: Stat button to invoice on pos_order view
Purpose: In POS order form view the 'Re-Print' button is placed improperly. There should be a way where invoice can be linked to POS without this button.. Removed the reprint button from the form view of POS order. And add the invoice state button so invoice can be linked to POS.
This commit is contained in:
committed by
Yannick Tivisse
parent
47e9e6918e
commit
4656186472
@@ -411,6 +411,18 @@ class PosOrder(models.Model):
|
||||
def action_invoice_state(self):
|
||||
self.write({'state': 'invoiced'})
|
||||
|
||||
@api.multi
|
||||
def action_view_invoice(self):
|
||||
return {
|
||||
'name': _('Customer Invoice'),
|
||||
'view_mode': 'form',
|
||||
'view_id': self.env.ref('account.invoice_form').id,
|
||||
'res_model': 'account.invoice',
|
||||
'context': "{'type':'out_invoice'}",
|
||||
'type': 'ir.actions.act_window',
|
||||
'res_id': self.invoice_id.id,
|
||||
}
|
||||
|
||||
@api.multi
|
||||
def action_invoice(self):
|
||||
Invoice = self.env['account.invoice']
|
||||
|
||||
@@ -13,6 +13,15 @@
|
||||
<field name="state" widget="statusbar" statusbar_visible="draft,paid,done" statusbar_colors='{"cancel":"red"}'/>
|
||||
</header>
|
||||
<sheet>
|
||||
<div class="oe_button_box" name="button_box">
|
||||
<button name="action_view_invoice"
|
||||
string="Invoice"
|
||||
type="object"
|
||||
class="oe_stat_button"
|
||||
icon="fa-pencil-square-o"
|
||||
attrs="{'invisible':[('state','!=','invoiced')]}">
|
||||
</button>
|
||||
</div>
|
||||
<group col="4" colspan="4" name="order_fields">
|
||||
<field name="name"/>
|
||||
<field name="date_order"/>
|
||||
@@ -78,15 +87,9 @@
|
||||
<group string="Accounting Information">
|
||||
<group>
|
||||
<field name="sale_journal" domain="[('type','=','sale')]"/>
|
||||
<field name="invoice_id" readonly="1"
|
||||
attrs="{'invisible':[('state','<>','invoiced')]}"/>
|
||||
<field name="account_move" readonly="1"
|
||||
attrs="{'invisible':[('state','<>','done')]}"/>
|
||||
</group>
|
||||
<group>
|
||||
<button name="%(pos_invoice_report)d" string="Re-Print"
|
||||
icon="gtk-print" type="action" attrs="{'invisible':[('state','<>','invoiced')]}"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Notes" >
|
||||
@@ -125,7 +128,6 @@
|
||||
<field name="partner_id"/>
|
||||
<field name="date_order"/>
|
||||
<field name="user_id"/>
|
||||
<field name="invoice_id"/>
|
||||
<field name="amount_total" sum="Amount total" widget="monetary"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
<field name="state"/>
|
||||
|
||||
Reference in New Issue
Block a user