|
77 | 77 | </group> |
78 | 78 | <group> |
79 | 79 | <field name="company_id" groups="base.group_multi_company" /> |
80 | | - <field name="budget_commitment_id" required="1" /> |
81 | | - <field name="source_analytic_id" readonly="1" options="{'no_create': True, 'no_open': True}" /> |
82 | | - <field name="department_analytic_id" readonly="1" options="{'no_create': True, 'no_open': True}" /> |
83 | | - <field name="fund_analytic_id" readonly="1" options="{'no_create': True, 'no_open': True}" /> |
84 | | - <field name="activity_analytic_id" readonly="1" options="{'no_create': True, 'no_open': True}" /> |
85 | | - <field name="budget_account_id" readonly="1" required="1" options="{'no_create': True, 'no_open': True}" /> |
86 | | - <field name="budget_account_id" readonly="0" invisible="1"/> |
| 80 | + <field name="budget_commitment_id" /> |
| 81 | + <field name="source_analytic_id" required="1" options="{'no_create': True, 'no_open': True}" attrs="{'readonly': ['|', ('budget_commitment_id', '!=', False), ('state', 'in', ['submitted', 'validated', 'cancel'])]}" /> |
| 82 | + <field name="department_analytic_id" required="1" options="{'no_create': True, 'no_open': True}" attrs="{'readonly': ['|', ('budget_commitment_id', '!=', False), ('state', 'in', ['submitted', 'validated', 'cancel'])]}" /> |
| 83 | + <field name="fund_analytic_id" required="1" options="{'no_create': True, 'no_open': True}" attrs="{'readonly': ['|', ('budget_commitment_id', '!=', False), ('state', 'in', ['submitted', 'validated', 'cancel'])]}" /> |
| 84 | + <field name="activity_analytic_id" required="1" options="{'no_create': True, 'no_open': True}" attrs="{'readonly': ['|', ('budget_commitment_id', '!=', False), ('state', 'in', ['submitted', 'validated', 'cancel'])]}" /> |
| 85 | + <field name="budget_account_id" required="1" options="{'no_create': True, 'no_open': True}" attrs="{'readonly': ['|', ('budget_commitment_id', '!=', False), ('state', 'in', ['submitted', 'validated', 'cancel'])]}" /> |
87 | 86 | <field name="analytic_distribution" invisible="1"/> |
88 | 87 | </group> |
89 | 88 | </group> |
|
99 | 98 | <field name="tax_ids" widget="many2many_tags" /> |
100 | 99 | <field name="wht_tax_id" optional="show"/> |
101 | 100 | <field name="account_id" /> |
102 | | - <field name="analytic_distribution" widget="analytic_distribution" groups="analytic.group_analytic_accounting" /> |
| 101 | + <field name="analytic_distribution" widget="analytic_distribution" groups="analytic.group_analytic_accounting" readonly="1" /> |
103 | 102 | <field name="price_subtotal" /> |
104 | 103 | <field name="price_tax" optional="hide" /> |
105 | 104 | <field name="price_total" /> |
|
0 commit comments