[FIX] account: fix manual reconciliation widget
- set journal_id, tax_ids, analytic_account_id, analytic_tag_ids & force_tax_included as optional hide
- fix _get_write_off_move_lines_dict to make clicking a reconciliation model button have the same result as doing the operation manually :
- add journal_id parameter
- use reco line label in new aml name
closes odoo/odoo#80176
Task: 2611348
X-original-commit: 4514f0ec4a1eebb4652c34c4926d0cd1ff336e17
Related: odoo/enterprise#22435
Signed-off-by: Florian Gilbert <flg@odoo.com>
Signed-off-by: Laurent Smet <las@openerp.com>
This commit is contained in:
@@ -330,10 +330,10 @@ class AccountReconcileModel(models.Model):
|
||||
for tax_res in res['taxes']:
|
||||
tax = self.env['account.tax'].browse(tax_res['id'])
|
||||
balance = tax_res['amount']
|
||||
|
||||
name = ' '.join([x for x in [base_line_dict.get('name', ''), tax_res['name']] if x])
|
||||
new_aml_dicts.append({
|
||||
'account_id': tax_res['account_id'] or base_line_dict['account_id'],
|
||||
'name': tax_res['name'],
|
||||
'name': name,
|
||||
'partner_id': base_line_dict.get('partner_id'),
|
||||
'balance': balance,
|
||||
'debit': balance > 0 and balance or 0,
|
||||
@@ -416,6 +416,7 @@ class AccountReconcileModel(models.Model):
|
||||
'analytic_account_id': line.analytic_account_id.id,
|
||||
'analytic_tag_ids': [(6, 0, line.analytic_tag_ids.ids)],
|
||||
'reconcile_model_id': self.id,
|
||||
'journal_id': line.journal_id.id,
|
||||
}
|
||||
lines_vals_list.append(writeoff_line)
|
||||
|
||||
|
||||
@@ -238,18 +238,23 @@
|
||||
<field name="account_id"/>
|
||||
<field name="amount_type"/>
|
||||
<field name="journal_id"
|
||||
attrs="{'column_invisible': [('parent.rule_type', '!=', 'writeoff_button')]}"/>
|
||||
attrs="{'column_invisible': [('parent.rule_type', '!=', 'writeoff_button')]}"
|
||||
optional="hide"/>
|
||||
<field name="amount_string"/>
|
||||
<field name="tax_ids"
|
||||
widget="many2many_tags"/>
|
||||
widget="many2many_tags"
|
||||
optional="hide"/>
|
||||
<field name="analytic_account_id"
|
||||
groups="analytic.group_analytic_accounting"/>
|
||||
groups="analytic.group_analytic_accounting"
|
||||
optional="hide"/>
|
||||
<field name="analytic_tag_ids"
|
||||
widget="many2many_tags"
|
||||
groups="analytic.group_analytic_tags"/>
|
||||
groups="analytic.group_analytic_tags"
|
||||
optional="hide"/>
|
||||
<field name="force_tax_included"
|
||||
widget="boolean_toggle"
|
||||
attrs="{'invisible': [('show_force_tax_included', '=', False)]}"/>
|
||||
attrs="{'invisible': [('show_force_tax_included', '=', False)]}"
|
||||
optional="hide"/>
|
||||
<field name="label"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
||||
Reference in New Issue
Block a user