Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions object_merger/models/res_config_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ def create(self, vals):
'''
'''
vals2 = copy.deepcopy(vals)
#TODO : revisar la llamada al super 'object_merger_settings'
#result = super(object_merger_settings, self).create(vals2)
result = super(ResConfigSettings, self).create(vals2)
self.update_field(vals)
return result
Expand Down
22 changes: 11 additions & 11 deletions object_merger/wizard/object_merger.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.

from odoo import _, api, fields as odoo_fields, models, SUPERUSER_ID
#TODO :Ver con que se sustituyó esto en laversión 10
from openerp.tools import ustr
from odoo.exceptions import ValidationError

Expand Down Expand Up @@ -48,17 +47,19 @@ def action_merge(self):
object_ids = self.env.context.get('active_ids', [])
field_to_read = self.env.context.get('field_to_read')
fields = field_to_read and [field_to_read] or []
#TODO: Este caso queda por probar, como puedo configurar el
#TODO: ecua_fiscal_positions_core
if self.env.context.get('origin', False) != 'ecua_fiscal_positions_core':

if self.env.context.get('origin', False) \
!= 'ecua_fiscal_positions_core':
object = self.read(fields)
object = object[0]
else:
fiscal_position = model_pool.browse(ids[0])
object.update({'id': self.id, fields[0]: (self.id, fiscal_position.name)})
#TODO: nos queda por probar!, nunca entra aquí
if self.env.context.get('to_invoke'):
object.update({field_to_read: [self.env.context.get('object_to_preserve_id')]})
object.update({'id': self.id, fields[0]: (self.id,
fiscal_position.name)})
if self.env.context.get('to_invoke', False):
object.update({field_to_read: [self.env.context.get(
'object_to_preserve_id', False)]})

if object and fields and object[field_to_read]:
object_id = object[field_to_read][0]
else:
Expand All @@ -68,9 +69,8 @@ def action_merge(self):
"relation=%s and ttype not in ('many2many', 'one2many');",
(active_model,))
for name, model_raw in self.env.cr.fetchall():
#TODO: todo lo relacionado con fiscal_position y account_position,
# necesitamos explicación
if name == 'property_account_position' and model_raw == 'res.partner':
if name == 'property_account_position' and \
model_raw == 'res.partner':
for id in object_ids:
property_ids.extend(property_obj.
search([('name','=','property_account_position'),
Expand Down