summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-02-07 16:10:04 +0100
committerChristophe Simonis <chs@odoo.com>2017-02-07 16:10:04 +0100
commit6aec563b98acb84c2b50eb6b8abf8d714f7dc2c3 (patch)
tree0036171e04db89f34db4c8bcfa8ca65ceec4f870
parent63b7db377ecd13eb91e6e3dfe80260f492dd4eb0 (diff)
parent51cf2852d8738586ccefa00e9156d9e0ab7cd26d (diff)
[MERGE] forward port branch 8.0 up to 51cf2852d87
-rw-r--r--addons/account/account_invoice.py8
-rw-r--r--addons/point_of_sale/static/src/xml/pos.xml2
-rw-r--r--doc/cla/individual/hurrinico.md11
3 files changed, 17 insertions, 4 deletions
diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py
index ad146334b33..cf17bfdf775 100644
--- a/addons/account/account_invoice.py
+++ b/addons/account/account_invoice.py
@@ -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:
diff --git a/addons/point_of_sale/static/src/xml/pos.xml b/addons/point_of_sale/static/src/xml/pos.xml
index 2baad59b8e6..0159e4d4911 100644
--- a/addons/point_of_sale/static/src/xml/pos.xml
+++ b/addons/point_of_sale/static/src/xml/pos.xml
@@ -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">
diff --git a/doc/cla/individual/hurrinico.md b/doc/cla/individual/hurrinico.md
new file mode 100644
index 00000000000..6113259c270
--- /dev/null
+++ b/doc/cla/individual/hurrinico.md
@@ -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