('raw', 'raw'),
('sxw', 'sxw'),
('odt', 'odt'),
- ('html2html','Html from html'),
+ ('mako2html','Mako from HTML'),
], string='Type', required=True),
'groups_id': fields.many2many('res.groups', 'res_groups_report_rel', 'uid', 'gid', 'Groups'),
'attachment': fields.char('Save As Attachment Prefix', size=128, help='This is the filename of the attachment used to store the printing result. Keep empty to not save the printed reports. You can use a python expression with the object and time variables.'),
_name = 'ir.actions.act_window'
_table = 'ir_act_window'
_sequence = 'ir_actions_id_seq'
+
def _check_model(self, cr, uid, ids, context={}):
for action in self.browse(cr, uid, ids, context):
if not self.pool.get(action.res_model):
datas = self._table.read(self._cr, self._uid, ids, fffields, context=self._context, load="_classic_write")
if self._fields_process:
lang = self._context.get('lang', 'en_US') or 'en_US'
- lang_obj = self.pool.get('res.lang').browse(self._cr, self._uid,self.pool.get('res.lang').search(self._cr, self._uid,[('code','=',lang)])[0])
-
+ lang_obj_ids = self.pool.get('res.lang').search(self._cr, self._uid,[('code','=',lang)])
+ if not lang_obj_ids:
+ raise Exception(_('Language with code "%s" is not defined in your system !\nDefine it through the Administration menu.') % (lang,))
+ lang_obj = self.pool.get('res.lang').browse(self._cr, self._uid,lang_obj_ids[0])
+
for n, f in ffields:
if f._type in self._fields_process:
for d in datas:
newfd = relation_obj.fields_get(
cr, uid, context=context)
res = process_liness(self, datas, prefix + [field], current_module, relation_obj._name, newfd, position)
- (newrow, max2, w2, translate2, data_id2, data_res_id2) = res
+ (newrow, max2, w2, translate2, data_id2, data_res_id2) = res
nbrmax = max(nbrmax, max2)
warning = warning + w2
reduce(lambda x, y: x and y, newrow)
#try:
(res, other, warning, translate, data_id, res_id) = \
process_liness(self, datas, [], current_module, self._name, fields_def)
- if warning:
+ if len(warning):
cr.rollback()
return (-1, res, 'Line ' + str(counter) +' : ' + '!\n'.join(warning), '')
if c[0].startswith('default_'):
del rel_context[c[0]]
+ result = []
for field in upd_todo:
- self._columns[field].set(cr, self, id_new, field, vals[field], user, rel_context)
+ result += self._columns[field].set(cr, self, id_new, field, vals[field], user, rel_context) or []
self._validate(cr, user, [id_new], context)
-
- result = self._store_get_values(cr, user, [id_new], vals.keys(), context)
- for order, object, ids, fields in result:
- self.pool.get(object)._store_set_values(cr, user, ids, fields, context)
+ if not context.get('no_store_function', False):
+ result += self._store_get_values(cr, user, [id_new], vals.keys(), context)
+ result.sort()
+ done = []
+ for order, object, ids, fields2 in result:
+ if not (object, ids, fields2) in done:
+ self.pool.get(object)._store_set_values(cr, user, ids, fields2, context)
+ done.append((object, ids, fields2))
wf_service = netsvc.LocalService("workflow")
wf_service.trg_create(user, self._name, id_new, cr)