[FIX] account: fix invoices/bills resequence with same name

- Create 2 invoices (or 2 bills) but let them in draft
- In invoices list view, select all invoices
- Execute Action > Resequence
Resequence wizard will not show.

It comes from a template in resequence renderer using account move name as t-key
that silently crashes because both draft invoices have the same name ("/").

opw-2590273

closes odoo/odoo#73724

X-original-commit: 3e6b7dfd4854069724dde2df43ab2eb7d850e9b5
Signed-off-by: William André (wan) <wan@odoo.com>
This commit is contained in:
Anh Thao Pham (pta)
2021-07-14 13:43:20 +00:00
parent 1e4dcbbd10
commit 892087c71b
2 changed files with 2 additions and 1 deletions
@@ -8,7 +8,7 @@
<th>Before</th>
<th>After</th>
</tr></thead>
<tbody t-foreach="data.changeLines" t-as="changeLine" t-key="changeLine.current_name">
<tbody t-foreach="data.changeLines" t-as="changeLine" t-key="changeLine.id">
<ChangeLine changeLine="changeLine" ordering="data.ordering"/>
</tbody>
</table>
@@ -105,6 +105,7 @@ class ReSequenceWizard(models.TransientModel):
# compute the new values period by period
for move in period_recs:
new_values[move.id] = {
'id': move.id,
'current_name': move.name,
'state': move.state,
'date': format_date(self.env, move.date),