Also avoid to have '/' on move line label of supplier invoices

This commit is contained in:
Alexis de Lattre
2016-09-21 17:23:05 +02:00
parent b814ec11bf
commit 7c5f04a39e
3 changed files with 23 additions and 8 deletions

View File

@@ -0,0 +1,16 @@
# -*- 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=account_move.name "
"FROM account_move WHERE account_move_line.move_id = account_move.id "
"AND account_move_line.name='/' "
"AND account_move_line.journal_id in "
"(SELECT id FROM account_journal WHERE type in ('purchase', 'purchase_refund'))")