[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 Luis J. Salvatierra
parent e206a37bdd
commit 9e63f90527
8 changed files with 238 additions and 41 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()