Review: Needs Fixing
1) what is the purpose of this change?:
8 - _name = 'account.analytic.Journal.report'
9 +# _name = 'account.analytic.Journal.report'
2) def set_date, def get_ids_of_same_group, def get_next_id_in_timeline, def
get_previous_id_in_timeline
don't directly pass context like context={'temporal_mode': False}, it will
miss to pass other keys of original context
3) def set_date
+ for record in obj.browse(cr, uid, ids, context=context):
there is no any reference of any field of record as "record.fieldname"
except id, so use of browse is worth
just loop over the ids
4) def create
165 + res_id = super(orm_temporal, self).create(cr, uid, vals,
context=context)
166 + if not vals.get('temporal_parent_id'):
167 + self.write(cr, uid, res_id, {'temporal_parent_id': res_id},
context={'temporal_mode': False})
why called create first and then write?
you can update vals for "temporal_parent_id" and call create directly for that
updated vals
5) def shallow_copy
to be improved and move to server (as said by qdp)
6) def write
it allows to write on history record, its because following code, it skips
the id in for loop(line 221) but still writes that id in line222
219 + for record in self.browse(cr, uid, ids, context=context):
220 + if not((not record.temporal_date_from or
record.temporal_date_from <= cr.timenow) and (not record.temporal_date_to or
cr.timenow < record.temporal_date_to)):
221 + continue
222 + return super(orm_temporal, self).write(cr, uid, ids, vals,
context=context)
7) def read
I don't understand the else part of read,
the search criteria must have something for temporal_date, I think you can
directly call the search with temporal mode = false to find all records of
given id
8) the yml test cases fails, the code is needed to be improved/cleaned in yml
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-temporal-db-branch-ksa/+merge/62871
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/trunk-temporal-db.
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp