[IMP] account_chart_update: Include field selection

With this option, you can select which fields do you want to compare for updating.

Use case: you have specific accounts in taxes, and you don't want to lose them,
but you want to update their groups through the wizard. Before this, the update
was all or nothing. Now, you have total control!
This commit is contained in:
Pedro M. Baeza
2018-09-22 03:28:30 +02:00
committed by Reyes4711
parent 94f013e6ce
commit ea78ba2884
7 changed files with 187 additions and 25 deletions

View File

@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Copyright 2018 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models
class IrModelFields(models.Model):
_inherit = 'ir.model.fields'
def name_get(self):
"""Return special label when showing fields in chart update wizard."""
if self.env.context.get('account_chart_update'):
res = []
for record in self:
res.append((record.id, "%s (%s)" % (
record.field_description, record.name,
)))
return res
return super(IrModelFields, self).name_get()