[FIX] account: Bring back the 'Invoice' stat button on partner form
It has accidentally disappeared in saas-15.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from ast import literal_eval
|
||||
from operator import itemgetter
|
||||
import time
|
||||
|
||||
@@ -436,3 +437,11 @@ class ResPartner(models.Model):
|
||||
return super(ResPartner, self)._commercial_fields() + \
|
||||
['debit_limit', 'property_account_payable_id', 'property_account_receivable_id', 'property_account_position_id',
|
||||
'property_payment_term_id', 'property_supplier_payment_term_id', 'last_time_entries_checked']
|
||||
|
||||
@api.multi
|
||||
def action_view_partner_invoices(self):
|
||||
self.ensure_one()
|
||||
action = self.env.ref('account.action_invoice_refund_out_tree').read()[0]
|
||||
action['domain'] = literal_eval(action['domain'])
|
||||
action['domain'].append(('partner_id', 'child_of', self.id))
|
||||
return action
|
||||
|
||||
@@ -95,6 +95,17 @@
|
||||
<field name="priority" eval="20"/>
|
||||
<field name="groups_id" eval="[(4, ref('account.group_account_invoice'))]"/>
|
||||
<field name="arch" type="xml">
|
||||
<div name="button_box" position="inside">
|
||||
<button type="object" class="oe_stat_button" icon="fa-pencil-square-o" name="action_view_partner_invoices"
|
||||
attrs="{'invisible': [('customer', '=', False)]}">
|
||||
<div class="o_form_field o_stat_info">
|
||||
<span class="o_stat_value">
|
||||
<field name="total_invoiced" widget='monetary' options="{'currency_field': 'currency_id'}"/>
|
||||
</span>
|
||||
<span class="o_stat_text">Invoiced</span>
|
||||
</div>
|
||||
</button>
|
||||
</div>
|
||||
<group name="container_row_2" position="inside">
|
||||
<group string="Payments" name="banks">
|
||||
<field name="currency_id" invisible="1"/>
|
||||
|
||||
Reference in New Issue
Block a user