diff options
| author | Olivier Dony <odo@odoo.com> | 2018-04-06 08:51:49 +0200 |
|---|---|---|
| committer | Olivier Dony <odo@odoo.com> | 2018-04-06 08:51:54 +0200 |
| commit | 3f975f97693dfe046dba0d88aaf2bbf2bafa62b6 (patch) | |
| tree | 43c2d7c5dca807b27960d8010b004626b213736a | |
| parent | f5b00c11dd817a7949e15cad85a70df2e473f3fc (diff) | |
[FIX] account_payment: make partner_id required only when draft
When not draft, the partner_id field is readonly and cannot be modified
anyway, but it makes the form invalid, so form buttons cannot be used,
e.g. to access the journal items, etc.
| -rw-r--r-- | addons/account/views/account_payment_view.xml | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/account/views/account_payment_view.xml b/addons/account/views/account_payment_view.xml index e4dfd90dd77..9528a20787a 100644 --- a/addons/account/views/account_payment_view.xml +++ b/addons/account/views/account_payment_view.xml @@ -145,7 +145,7 @@ <group> <field name="payment_type" widget="radio" attrs="{'readonly': [('state', '!=', 'draft')]}"/> <field name="partner_type" widget="selection" attrs="{'required': [('payment_type', 'in', ('inbound', 'outbound'))], 'invisible': [('payment_type', 'not in', ('inbound', 'outbound'))], 'readonly': [('state', '!=', 'draft')]}"/> - <field name="partner_id" attrs="{'required': [('payment_type', 'in', ('inbound', 'outbound'))], 'invisible': [('payment_type', 'not in', ('inbound', 'outbound'))], 'readonly': [('state', '!=', 'draft')]}" context="{'default_is_company': True, 'default_supplier': payment_type == 'outbound', 'default_customer': payment_type == 'inbound'}"/> + <field name="partner_id" attrs="{'required': [('state', '=', 'draft'), ('payment_type', 'in', ('inbound', 'outbound'))], 'invisible': [('payment_type', 'not in', ('inbound', 'outbound'))], 'readonly': [('state', '!=', 'draft')]}" context="{'default_is_company': True, 'default_supplier': payment_type == 'outbound', 'default_customer': payment_type == 'inbound'}"/> <label for="amount"/> <div name="amount_div" class="o_row"> <field name="amount" attrs="{'readonly': [('state', '!=', 'draft')]}"/> |
