diff options
| author | Christophe Simonis <chs@odoo.com> | 2017-07-07 14:18:07 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2017-07-07 14:18:07 +0200 |
| commit | 0f2b2c4e2b99df8d68456016a4bea86e26c1c80e (patch) | |
| tree | 37ecc505ddb81ec1cd048dba9655e03e3176c546 /addons/account | |
| parent | 5241d479b222bc11ebd1c0ff41c38872a3fea8fd (diff) | |
| parent | 514a1a76d81de3943f752ceaa5e487a2d25b9bb7 (diff) | |
[MERGE] forward port branch saas-15 up to 514a1a76d81
Diffstat (limited to 'addons/account')
| -rw-r--r-- | addons/account/models/partner.py | 9 | ||||
| -rw-r--r-- | addons/account/models/res_config.py | 4 | ||||
| -rw-r--r-- | addons/account/views/partner_view.xml | 11 |
3 files changed, 22 insertions, 2 deletions
diff --git a/addons/account/models/partner.py b/addons/account/models/partner.py index e826524eb57..a4bc99b8e7d 100644 --- a/addons/account/models/partner.py +++ b/addons/account/models/partner.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- +from ast import literal_eval from operator import itemgetter import time @@ -427,3 +428,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 diff --git a/addons/account/models/res_config.py b/addons/account/models/res_config.py index eedcbe2b7a7..97362c5f41c 100644 --- a/addons/account/models/res_config.py +++ b/addons/account/models/res_config.py @@ -135,6 +135,6 @@ class AccountConfigSettings(models.TransientModel): company = self.env['res.company'].browse(values.get('company_id')) if company.currency_id.id == values.get('currency_id'): values.pop('currency_id') - if company.accounts_code_digits == vals.get('code_digits'): - vals.pop('code_digits') + if company.accounts_code_digits == values.get('code_digits'): + values.pop('code_digits') return super(AccountConfigSettings, self).create(values) diff --git a/addons/account/views/partner_view.xml b/addons/account/views/partner_view.xml index 84607ad971d..2f028d6f1c2 100644 --- a/addons/account/views/partner_view.xml +++ b/addons/account/views/partner_view.xml @@ -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"/> |
