[FIX] account: Fix 'partner_id' field in account.move view

- partner_id must not be required for receipt.
- context.get('type') is not the way to pass a default value.

closes odoo/odoo#37260

Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
This commit is contained in:
Laurent Smet
2019-09-23 10:20:56 +00:00
parent c2ff5075ae
commit 4d31bebff5
+2 -2
View File
@@ -594,12 +594,12 @@
</div>
<field name="partner_id" widget="res_partner_many2one" nolabel="1"
context="{
'res_partner_search_mode': (context.get('type', 'entry') in ('out_invoice', 'out_refund', 'out_receipt') and 'customer') or (context.get('type', 'entry') in ('in_invoice', 'in_refund', 'in_receipt') and 'supplier') or False,
'res_partner_search_mode': (context.get('default_type', 'entry') in ('out_invoice', 'out_refund', 'out_receipt') and 'customer') or (context.get('default_type', 'entry') in ('in_invoice', 'in_refund', 'in_receipt') and 'supplier') or False,
'show_address': 1, 'default_is_company': True, 'show_vat': True}"
options='{"always_reload": True, "no_quick_create": True}'
attrs="{
'invisible': [('type', 'not in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund', 'out_receipt', 'in_receipt'))],
'required': [('type', 'in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund', 'out_receipt', 'in_receipt'))]
'required': [('type', 'in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund'))]
}"/>
<field name="ref"