Better name field in account.move.line for move generated from customer invoice (WARNING : migration script included)

This commit is contained in:
Alexis de Lattre
2016-09-14 16:52:46 +02:00
parent 618ad6d6d6
commit 7def6a85e4
3 changed files with 32 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
# -*- coding: utf-8 -*-
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
def migrate(cr, version):
if not version:
return
# cf the inherit of action_number() of account.invoice
# in account_usability/account.py
cr.execute(
"UPDATE account_move_line SET name=ref WHERE name='/' "
"AND ref is not null AND journal_id in "
"(SELECT id FROM account_journal WHERE type in ('sale', 'sale_refund'))")