diff --git a/addons/account/models/account.py b/addons/account/models/account.py index 42f87861428..e8900d9df93 100644 --- a/addons/account/models/account.py +++ b/addons/account/models/account.py @@ -882,6 +882,11 @@ class AccountTax(models.Model): if self.amount_type in ('percent', 'division') and self.amount != 0.0 and not self.description: self.description = "{0:.4g}%".format(self.amount) + @api.onchange('amount_type') + def onchange_amount_type(self): + if self.amount_type is not 'group': + self.children_tax_ids = [(5,)] + @api.onchange('account_id') def onchange_account_id(self): self.refund_account_id = self.account_id diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index 1b7cc78269b..e534ab89eb5 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -129,7 +129,12 @@ class AccountInvoice(models.Model): def _get_outstanding_info_JSON(self): self.outstanding_credits_debits_widget = json.dumps(False) if self.state == 'open': - domain = [('account_id', '=', self.account_id.id), ('partner_id', '=', self.env['res.partner']._find_accounting_partner(self.partner_id).id), ('reconciled', '=', False), '|', ('amount_residual', '!=', 0.0), ('amount_residual_currency', '!=', 0.0)] + domain = [('account_id', '=', self.account_id.id), + ('partner_id', '=', self.env['res.partner']._find_accounting_partner(self.partner_id).id), + ('reconciled', '=', False), + '|', + '&', ('amount_residual_currency', '!=', 0.0), ('currency_id','!=', None), + '&', ('amount_residual_currency', '=', 0.0), '&', ('currency_id','=', None), ('amount_residual', '!=', 0.0)] if self.type in ('out_invoice', 'in_refund'): domain.extend([('credit', '>', 0), ('debit', '=', 0)]) type_payment = _('Outstanding credits') diff --git a/addons/account/static/src/js/reconciliation/reconciliation_renderer.js b/addons/account/static/src/js/reconciliation/reconciliation_renderer.js index bdb26830e3d..15864a60d3c 100644 --- a/addons/account/static/src/js/reconciliation/reconciliation_renderer.js +++ b/addons/account/static/src/js/reconciliation/reconciliation_renderer.js @@ -506,7 +506,7 @@ var LineRenderer = Widget.extend(FieldManagerMixin, { } return this.model.makeRecord('account.bank.statement.line', [field], { partner_id: { - domain: [["parent_id", "=", false], "|", ["customer", "=", true], ["supplier", "=", true]], + domain: ["|", ["is_company", "=", true], ["parent_id", "=", false], "|", ["customer", "=", true], ["supplier", "=", true]], options: { no_open: true } diff --git a/addons/account/static/tests/reconciliation_tests.js b/addons/account/static/tests/reconciliation_tests.js index 60222b9c237..9ff1854c3af 100644 --- a/addons/account/static/tests/reconciliation_tests.js +++ b/addons/account/static/tests/reconciliation_tests.js @@ -29,6 +29,7 @@ var db = { customer: {string: "customer", type: 'boolean'}, supplier: {string: "supplier", type: 'boolean'}, parent_id: {string: "Parent", type: 'boolean'}, + is_company: {string: "Is company", type: 'boolean'}, property_account_receivable_id: {string: 'Account receivable', type: 'many2one', relation: 'account.account'}, property_account_payable_id: {string: 'Account payable', type: 'many2one', relation: 'account.account'}, }, diff --git a/addons/base_address_city/models/res_partner.py b/addons/base_address_city/models/res_partner.py index 7591299f3e2..f8f01119e7d 100644 --- a/addons/base_address_city/models/res_partner.py +++ b/addons/base_address_city/models/res_partner.py @@ -15,9 +15,10 @@ class Partner(models.Model): @api.onchange('city_id') def _onchange_city_id(self): - self.city = self.city_id.name - self.zip = self.city_id.zipcode - self.state_id = self.city_id.state_id + if self.city_id: + self.city = self.city_id.name + self.zip = self.city_id.zipcode + self.state_id = self.city_id.state_id @api.model def _fields_view_get_address(self, arch): @@ -37,7 +38,10 @@ class Partner(models.Model): }" />