qdp (OpenERP) has proposed merging
lp:~openerp-dev/openobject-server/trunk-temporal-db into lp:openobject-server.
Requested reviews:
OpenERP Core Team (openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-server/trunk-temporal-db/+merge/75276
this branch contains:
*one [FIX]: on deletion of a record, we must also recompute the stored field of
same objects linked to the deleted record (there is no reason not to do so)
*one [IMP]: adding of the transaction_datestart on the cursor. It will be used
by temporal objects but can legitimately be in the core because it's an useful
information.
--
https://code.launchpad.net/~openerp-dev/openobject-server/trunk-temporal-db/+merge/75276
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-server/trunk-temporal-db.
=== modified file 'openerp/osv/orm.py'
--- openerp/osv/orm.py 2011-09-13 14:47:02 +0000
+++ openerp/osv/orm.py 2011-09-13 22:52:37 +0000
@@ -3778,12 +3778,11 @@
ir_values_obj.unlink(cr, uid, ir_value_ids, context=context)
for order, object, store_ids, fields in result_store:
- if object != self._name:
- obj = self.pool.get(object)
- cr.execute('select id from '+obj._table+' where id IN %s', (tuple(store_ids),))
- rids = map(lambda x: x[0], cr.fetchall())
- if rids:
- obj._store_set_values(cr, uid, rids, fields, context)
+ obj = self.pool.get(object)
+ cr.execute('select id from '+obj._table+' where id IN %s', (tuple(store_ids),))
+ rids = map(lambda x: x[0], cr.fetchall())
+ if rids:
+ obj._store_set_values(cr, uid, rids, fields, context)
return True
@@ -4727,6 +4726,29 @@
self.copy_translations(cr, uid, id, new_id, context)
return new_id
+ def shallow_copy(self, cr, uid, id, default=None, context=None):
+ """
+ This method Duplicates record of given id without copying many2many and one2many fields related to that record
+
+ :param cr: database cursor
+ :param uid: current user id
+ :param id: id of the record to copy
+ :param default: dictionary of field values to override in the original values of the copied record, e.g: ``{'field_name': overriden_value, ...}``
+ :type default: dictionary
+ :param context: context arguments, like lang, time zone
+ :type context: dictionary
+ :return: True
+ """
+ if context is None:
+ context = {}
+ if default is None:
+ default = {}
+ for field in self._columns:
+ if self._columns[field]._type in ('one2many', 'many2many'):
+ # If type of the field is o2m or m2m, assign blank values in default
+ default.update({field: []})
+ return self.copy(cr, uid, id, default=default, context=context)
+
def exists(self, cr, uid, ids, context=None):
if type(ids) in (int, long):
ids = [ids]
=== modified file 'openerp/sql_db.py'
--- openerp/sql_db.py 2011-09-13 14:34:44 +0000
+++ openerp/sql_db.py 2011-09-13 22:52:37 +0000
@@ -68,6 +68,7 @@
import tools
from tools.func import wraps, frame_codeinfo
+import time
from datetime import datetime as mdt
from datetime import timedelta
import threading
@@ -167,6 +168,7 @@
self.__closed = True # avoid the call of close() (by __del__) if an exception
# is raised by any of the following initialisations
self._pool = pool
+ self.transaction_datestart = time.strftime('%Y-%m-%d %H:%M:%S')
self.dbname = dbname
# Whether to enable snapshot isolation level for this cursor.
@@ -325,8 +327,12 @@
@check
def commit(self):
+<<<<<<< TREE
""" Perform an SQL `COMMIT`
"""
+=======
+ self.transaction_datestart = time.strftime('%Y-%m-%d %H:%M:%S')
+>>>>>>> MERGE-SOURCE
return self._cnx.commit()
@check
_______________________________________________
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