[MERGE] forward port branch 8.0 up to 51cf2852d8
This commit is contained in:
@@ -435,8 +435,8 @@ class account_invoice(models.Model):
|
||||
fiscal_position = False
|
||||
bank_id = False
|
||||
|
||||
p = self.env['res.partner'].browse(partner_id or False)
|
||||
if partner_id:
|
||||
p = self.env['res.partner'].browse(partner_id)
|
||||
rec_account = p.property_account_receivable
|
||||
pay_account = p.property_account_payable
|
||||
if company_id:
|
||||
@@ -464,7 +464,6 @@ class account_invoice(models.Model):
|
||||
account_id = pay_account.id
|
||||
payment_term_id = p.property_supplier_payment_term.id
|
||||
fiscal_position = p.property_account_position.id
|
||||
bank_id = p.bank_ids and p.bank_ids[0].id or False
|
||||
|
||||
result = {'value': {
|
||||
'account_id': account_id,
|
||||
@@ -472,8 +471,11 @@ class account_invoice(models.Model):
|
||||
'fiscal_position': fiscal_position,
|
||||
}}
|
||||
|
||||
if type in ('in_invoice', 'in_refund'):
|
||||
if type in ('in_invoice', 'out_refund'):
|
||||
bank_ids = p.commercial_partner_id.bank_ids
|
||||
bank_id = bank_ids[0].id if bank_ids else False
|
||||
result['value']['partner_bank_id'] = bank_id
|
||||
result['domain'] = {'partner_bank_id': [('id', 'in', bank_ids.ids)]}
|
||||
|
||||
if payment_term != payment_term_id:
|
||||
if payment_term_id:
|
||||
|
||||
@@ -311,7 +311,7 @@
|
||||
</div>
|
||||
<div class='client-detail'>
|
||||
<span class='label'>Country</span>
|
||||
<select class='detail client-address-country' name='country_id'>
|
||||
<select class='detail client-address-country needsclick' name='country_id'>
|
||||
<option value=''>None</option>
|
||||
<t t-foreach='widget.pos.countries' t-as='country'>
|
||||
<option t-att-value='country.id' t-att-selected="partner.country_id ? ((country.id === partner.country_id[0]) ? true : undefined) : undefined">
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
Italy, 2017-02-03
|
||||
|
||||
I hereby agree to the terms of the Odoo Individual Contributor License
|
||||
Agreement v1.0.
|
||||
|
||||
I declare that I am authorized and able to make this agreement and sign this
|
||||
declaration.
|
||||
|
||||
Signed,
|
||||
|
||||
Nicola Malcontenti nicola.malcontenti@agilebg.com https://github.com/hurrinico
|
||||
Reference in New Issue
Block a user