From 90f676823b0514aa3e4ba3b1494558e98bcc98cd Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Mon, 11 Jan 2010 16:05:46 +0530 Subject: [PATCH 01/30] [FIX] Base_report_crearor :Models with _inherits made working lp bug: https://launchpad.net/bugs/503894 fixed bzr revid: jvo@tinyerp.com-20100111103546-9n5nikemxlvv9jb4 --- .../base_report_creator.py | 32 ++++++++++++++++--- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/addons/base_report_creator/base_report_creator.py b/addons/base_report_creator/base_report_creator.py index b4995435d23..34f3b549dae 100644 --- a/addons/base_report_creator/base_report_creator.py +++ b/addons/base_report_creator/base_report_creator.py @@ -226,9 +226,18 @@ class report_creator(osv.osv): from_list = [] where_list = [] filter_list = [] + +# def _add_inherits(obj): +# pool_model = self.pool.get(obj) +# if not model_dict.get(obj,False): +# model_dict[obj] = pool_model._table +# for record in pool_model._inherits.keys(): +# _add_inherits(record) + for model in models: model_dict[model.model] = self.pool.get(model.model)._table - +# _add_inherits(model.model) + model_list = model_dict.keys() reference_model_dict = {} for model in model_dict: @@ -237,10 +246,22 @@ class report_creator(osv.osv): rest_list.remove(model) model_pool = self.pool.get(model) fields_get = model_pool.fields_get(cr,uid) + model_columns = {} + + def _get_inherit_fields(obj): + pool_model = self.pool.get(obj) + #Adding the columns of the model itself + model_columns.update(pool_model._columns) + #Adding the columns of its _inherits + for record in pool_model._inherits.keys(): + _get_inherit_fields(record) + + _get_inherit_fields(model) + fields_filter = dict(filter(lambda x:x[1].get('relation',False) and x[1].get('relation') in rest_list and x[1].get('type')=='many2one' - and not (isinstance(model_pool._columns[x[0]],fields.function) or isinstance(model_pool._columns[x[0]],fields.related)), fields_get.items())) + and not (isinstance(model_columns[x[0]],fields.function) or isinstance(model_columns[x[0]],fields.related)), fields_get.items())) if fields_filter: model in model_list and model_list.remove(model) model_count = reference_model_dict.get(model,False) @@ -255,9 +276,9 @@ class report_creator(osv.osv): reference_model_dict[v.get('relation')] = relation_count+1 else: reference_model_dict[v.get('relation')]=1 - - str_where = model_dict.get(model)+"."+ k + "=" + model_dict.get(v.get('relation'))+'.id' - where_list.append(str_where) + if k in self.pool.get(model)._columns: + str_where = model_dict.get(model)+"."+ k + "=" + model_dict.get(v.get('relation'))+'.id' + where_list.append(str_where) if reference_model_dict: self.model_set_id = model_dict.get(reference_model_dict.keys()[reference_model_dict.values().index(min(reference_model_dict.values()))]) if model_list and not len(model_dict.keys()) == 1: @@ -280,6 +301,7 @@ class report_creator(osv.osv): if where_list: + where_list = list(set(where_list)) ret_str+="\n where \n"+" and\n".join(where_list) ret_str = ret_str.strip() if filter_list: From a4ca4cf7b4dce3f22cad1caf948b51375a3a0fbd Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Mon, 11 Jan 2010 19:05:13 +0530 Subject: [PATCH 02/30] [FIX] Stock : While removing the picking,moves should not call picking's write() lp bug: https://launchpad.net/bugs/499120 fixed bzr revid: jvo@tinyerp.com-20100111133513-0vcvrqelt4fqjdta --- addons/stock/stock.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index f3fbfe15950..1460957c4f9 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -791,6 +791,7 @@ class stock_picking(osv.osv): raise osv.except_osv(_('Error'), _('You cannot remove the picking which is in %s state !')%(pick.state,)) elif pick.state in ['confirmed','assigned']: ids2 = [move.id for move in pick.move_lines] + context.update({'call_unlink':True}) self.pool.get('stock.move').action_cancel(cr, uid, ids2, context) else: continue @@ -1213,14 +1214,14 @@ class stock_move(osv.osv): pickings[move.picking_id.id] = True if move.move_dest_id and move.move_dest_id.state == 'waiting': self.write(cr, uid, [move.move_dest_id.id], {'state': 'assigned'}) - if move.move_dest_id.picking_id: + if context.get('call_unlink',False) and move.move_dest_id.picking_id: wf_service = netsvc.LocalService("workflow") wf_service.trg_write(uid, 'stock.picking', move.move_dest_id.picking_id.id, cr) self.write(cr, uid, ids, {'state': 'cancel', 'move_dest_id': False}) - - for pick in self.pool.get('stock.picking').browse(cr, uid, pickings.keys()): - if all(move.state == 'cancel' for move in pick.move_lines): - self.pool.get('stock.picking').write(cr, uid, [pick.id], {'state': 'cancel'}) + if not context.get('call_unlink',False): + for pick in self.pool.get('stock.picking').browse(cr, uid, pickings.keys()): + if all(move.state == 'cancel' for move in pick.move_lines): + self.pool.get('stock.picking').write(cr, uid, [pick.id], {'state': 'cancel'}) wf_service = netsvc.LocalService("workflow") for id in ids: From 2036a7c651f00c88ea388e80756b7a10d79c531b Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Mon, 11 Jan 2010 19:45:30 +0530 Subject: [PATCH 03/30] [FIX] Purchase : Purchase/user was missing account.tax access rights lp bug: https://launchpad.net/bugs/503741 fixed bzr revid: jvo@tinyerp.com-20100111141530-0666oazti2dzju3x --- addons/purchase/security/ir.model.access.csv | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/purchase/security/ir.model.access.csv b/addons/purchase/security/ir.model.access.csv index 68be681fdf5..5fb968e6ce1 100644 --- a/addons/purchase/security/ir.model.access.csv +++ b/addons/purchase/security/ir.model.access.csv @@ -7,3 +7,4 @@ "access_stock_move_purchase_user","stock.move purchase_user","stock.model_stock_move","purchase.group_purchase_user",1,1,1,1 "access_purchase_order_stock_worker","purchase.order stock_worker","model_purchase_order","stock.group_stock_user",1,0,0,0 "access_purchase_order_line_stock_worker","purchase.order.line stock_worker","model_purchase_order_line","stock.group_stock_user",1,0,0,0 +"access_account_tax_purchase_user","account.tax purchase_user","account.model_account_tax","purchase.group_purchase_user",1,0,0,0 \ No newline at end of file From 05a76846f26e4915bba1ef2cd9bd51a1647e158d Mon Sep 17 00:00:00 2001 From: "VRA(OpenERP)" <> Date: Wed, 13 Jan 2010 17:01:10 +0530 Subject: [PATCH 04/30] [FIX] Analytic account report corrected bzr revid: jvo@tinyerp.com-20100113113110-1sl57vr454pi8w4j --- addons/hr_timesheet_invoice/report/cost_ledger.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_timesheet_invoice/report/cost_ledger.py b/addons/hr_timesheet_invoice/report/cost_ledger.py index 584ea3c6acd..a2f3044a190 100644 --- a/addons/hr_timesheet_invoice/report/cost_ledger.py +++ b/addons/hr_timesheet_invoice/report/cost_ledger.py @@ -88,7 +88,7 @@ class account_analytic_cost_ledger(report_sxw.rml_parse): revenue = 0.0 if lines[id].amount < 0 and lines[id].product_id and lines[id].product_uom_id and lines[id].account_id.pricelist_id: ctx = {'uom': lines[id].product_uom_id.id} - price = price_obj.price_get(self.cr, self.uid, [lines[id].pricelist_id.id], lines[id].product_id.id, lines[id].unit_amount, ctx)[lines[id].pricelist_id.id] + price = price_obj.price_get(self.cr, self.uid, [lines[id].account_id.pricelist_id.id], lines[id].product_id.id, lines[id].unit_amount, ctx)[lines[id].account_id.pricelist_id.id] revenue = round(price * lines[id].unit_amount, 2) r['revenue'] = revenue self.sum_revenue[account_id] += revenue From bbd1938bafd7a9002b7f639561f5eacd7c765ba0 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Wed, 13 Jan 2010 17:08:47 +0530 Subject: [PATCH 05/30] [FIX] l10n_chart_uk_minimal : Demo account.tax.code needed negative sign lp bug: https://launchpad.net/bugs/470815 fixed bzr revid: jvo@tinyerp.com-20100113113847-drrnpcf1tvbap1t4 --- addons/l10n_chart_uk_minimal/account_tax.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/l10n_chart_uk_minimal/account_tax.xml b/addons/l10n_chart_uk_minimal/account_tax.xml index a030925f8fa..42f214e5685 100755 --- a/addons/l10n_chart_uk_minimal/account_tax.xml +++ b/addons/l10n_chart_uk_minimal/account_tax.xml @@ -21,6 +21,7 @@ Input VAT + From b01c37956e666a6df4d6fadfd100705dc497f7b7 Mon Sep 17 00:00:00 2001 From: Quentin De Paoli Date: Wed, 13 Jan 2010 17:02:57 +0100 Subject: [PATCH 06/30] [FIX] l10n_be: fixed data of l10n_be module bzr revid: qdp@cyan-20100113160257-vdfjdx4mfczch12e --- addons/l10n_be/account_pcmn_belgium.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/l10n_be/account_pcmn_belgium.xml b/addons/l10n_be/account_pcmn_belgium.xml index e657d259e60..9281d3c45ac 100644 --- a/addons/l10n_be/account_pcmn_belgium.xml +++ b/addons/l10n_be/account_pcmn_belgium.xml @@ -7021,8 +7021,8 @@ VI 0 percent - - + + sale From 9683d25c9b17a7db402b29375e37ebe27e677100 Mon Sep 17 00:00:00 2001 From: Quentin De Paoli Date: Wed, 13 Jan 2010 17:30:28 +0100 Subject: [PATCH 07/30] [FIX] account: wizard of fiscal year closing fixed: the entries of all previous fiscal years have to be deffered, not only the last one bzr revid: qdp@cyan-20100113163028-13qolk6d2jv5on2s --- addons/account/wizard/wizard_fiscalyear_close.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/account/wizard/wizard_fiscalyear_close.py b/addons/account/wizard/wizard_fiscalyear_close.py index ac9518e006b..97ee5f51a73 100644 --- a/addons/account/wizard/wizard_fiscalyear_close.py +++ b/addons/account/wizard/wizard_fiscalyear_close.py @@ -80,10 +80,12 @@ def _data_save(self, cr, uid, data, context): if move_ids: raise wizard.except_wizard(_('UserError'), _('The opening journal must not have any entry in the new fiscal year !')) - - + query = "SELECT id FROM account_fiscalyear WHERE date_stop < '" + str(new_fyear.date_start) + "'" + cr.execute(query) + result = cr.dictfetchall() + fy_ids = ','.join([str(x['id']) for x in result]) query_line = pool.get('account.move.line')._query_get(cr, uid, - obj='account_move_line', context={'fiscalyear': fy_id}) + obj='account_move_line', context={'fiscalyear': fy_ids}) cr.execute('select id from account_account WHERE active') ids = map(lambda x: x[0], cr.fetchall()) for account in pool.get('account.account').browse(cr, uid, ids, From 70811ec5a199871196af5e024c6b1759dbfb5751 Mon Sep 17 00:00:00 2001 From: Launchpad Code Hosting Date: Wed, 20 Jan 2010 04:36:15 +0000 Subject: [PATCH 08/30] Launchpad automatic translations update. bzr revid: codehost@crowberry-20100120043615-dtrufoa9pj4bb0ak --- bin/addons/base/i18n/uk.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/addons/base/i18n/uk.po b/bin/addons/base/i18n/uk.po index 2ebaea1d630..a8710995501 100644 --- a/bin/addons/base/i18n/uk.po +++ b/bin/addons/base/i18n/uk.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.0\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2010-01-18 05:27+0000\n" +"PO-Revision-Date: 2010-01-19 05:18+0000\n" "Last-Translator: Fabien (Open ERP) \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-01-19 04:41+0000\n" +"X-Launchpad-Export-Date: 2010-01-20 04:36+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base From 95ea9b141becbf7ab7498f3e388e049db3f5fe14 Mon Sep 17 00:00:00 2001 From: "HDA (OpenERP)" Date: Wed, 20 Jan 2010 20:01:32 +0530 Subject: [PATCH 09/30] [IMP] group by functionality bzr revid: hda@tinyerp.com-20100120143132-oet7eoten9smy3m3 --- bin/osv/orm.py | 224 ++++++++++++++++++++++++++----------------------- 1 file changed, 119 insertions(+), 105 deletions(-) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index 134929fcefa..8ee4a6170db 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -348,111 +348,8 @@ class orm_template(object): CONCURRENCY_CHECK_FIELD = '__last_update' - def read_group(self, cr, user, ids, fields, groupby, context=None): - context = context or {} - if not ids:return - - if fields[groupby]['type'] not in ('many2one','date','datetime'): - raise Exception(_("Type Not supported for Group By: %s :Only many2one,date and datetime are supported ") %(fields[groupby]['type'],)) - - qu1 = ' where id in (' + ','.join([str(id) for id in ids]) + ')' - qu2 = '' - # construct a clause for the rules : - d1, d2, d3 = self.pool.get('ir.rule').domain_get(cr, user, self._name) - - if d1: - qu1 = qu1 and qu1+' and '+d1 or ' where '+d1 - qu2 += d2 - - float_int_fields = list(field_name for field_name,values in fields.items() if values['type'] in ('float','integer')) - sum = {} - - cr.execute('select '+groupby+' from ' + self._table +qu1+' group by '+groupby+qu2) - parent_res = cr.fetchall() - try: - parent_res = [(m[0],m[1]) for m in parent_res if m[0]] - except: - parent_res = [(m[0],) for m in parent_res if m[0]] - groupby_ids = map(lambda x:x[0],parent_res) - - groupby_name = {} - child_ids_dict = {} - - if fields[groupby]['type'] == 'many2one': - groupby_name = dict(self.pool.get(fields[groupby]['relation']).name_get(cr,user,groupby_ids,context)) - - chqu1 =' where id in (' + ','.join([str(id) for id in ids]) + ') and ' - - # get child ids - for parent_id in groupby_ids: - cr.execute('select id from '+self._table+chqu1 +groupby+" = '%s'"%(parent_id,)) - child_ids = cr.fetchall() - for val in child_ids: - if parent_id not in child_ids_dict: - child_ids_dict[parent_id] = [val[0]] - else: - child_ids_dict[parent_id].append(val[0]) - #create [{},{}] for parent ids i.e for group by field - - result = [] - if fields[groupby]['type'] in ('date','datetime'): - curr_date = datetime.date.today() - yesterday = (curr_date - datetime.timedelta(days=1)).strftime('%Y-%m-%d') - lastweek = (curr_date + datetime.timedelta(weeks=-1)).strftime('%Y-%m-%d') - date_result = {'Today':{'group_child':[]},'Yesterday':{'group_child':[]}, - 'LastWeek':{'group_child':[]},'Old':{'group_child':[]}} - for x in parent_res: - db_date = x[0][:10] - if db_date == curr_date.strftime('%Y-%m-%d'): - date_format = 'Today' - elif db_date == yesterday: - date_format = 'Yesterday' - elif (db_date < yesterday) and (db_date >= lastweek): - date_format = 'LastWeek' - else: - date_format = 'Old' - date_result[date_format].update({'id':None,groupby:date_format}) - date_result[date_format]['group_child'] += child_ids_dict[x[0]] - float_int_sum = self.read(cr, user, child_ids_dict[x[0]], float_int_fields, context) - for value in float_int_sum: - for field,val in value.items(): - if field == 'id':continue - if field not in sum: - sum[field] = 0.0 - sum[field] += val - for k,v in sum.items(): - date_result[date_format][k] = v - sum = {} - for key,val in date_result.items(): - if len(date_result[key]) == 1: - del date_result[key] - continue - for field in fields.keys(): - if field not in val: - val[field] = False - if key in ('Today','Yesterday') and len(result): - result.insert(0,val) - else: - result.insert(-1,val) - return result - else: - for x in parent_res: - parent_val_dict = {'id':str(x[0])+':Gpby',groupby:(x[0],groupby_name[x[0]]),'group_child':child_ids_dict[x[0]]} - float_int_sum = self.read(cr, user, child_ids_dict[x[0]], float_int_fields, context) - for value in float_int_sum: - for field,val in value.items(): - if field == 'id':continue - if field not in sum: - sum[field] = 0.0 - sum[field] += val - for k,v in sum.items(): - parent_val_dict[k] = v - sum = {} - for field in fields.keys(): - if field not in parent_val_dict: - parent_val_dict[field] = False - result.append(parent_val_dict) - return result + def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None): + raise _('The read_group method is not implemented on this object !') def _field_create(self, cr, context={}): cr.execute("SELECT id FROM ir_model WHERE model=%s", (self._name,)) @@ -1899,6 +1796,123 @@ class orm(orm_template): _table = None _protected = ['read','write','create','default_get','perm_read','unlink','fields_get','fields_view_get','search','name_get','distinct_field_get','name_search','copy','import_data','search_count', 'exists'] + def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None): + context = context or {} + + if fields[groupby]['type'] not in ('many2one','date','datetime'): + raise Exception(_("Type Not supported for Group By: %s :Only many2one,date and datetime are supported ") %(fields[groupby]['type'],)) + + self.pool.get('ir.model.access').check(cr, uid, self._name, 'read', context=context) + if not fields: + fields = self._columns.keys() + self._inherit_fields.keys() + + # compute the where, order by, limit and offset clauses + (qu1, qu2, tables) = self._where_calc(cr, uid, domain, context=context) + dom = self.pool.get('ir.rule').domain_get(cr, uid, self._name, context=context) + qu1 = qu1 + dom[0] + qu2 = qu2 + dom[1] + for t in dom[2]: + if t not in tables: + tables.append(t) + if len(qu1): + qu1 = ' where '+string.join(qu1, ' and ') + else: + qu1 = '' +# limit_str = limit and ' limit %d' % limit or '' +# offset_str = offset and ' offset %d' % offset or '' + + float_int_fields = list(field_name for field_name,values in fields.items() if values['type'] in ('float','integer')) + sum = {} + flist = groupby + for f in float_int_fields: + if f not in ['id','sequence']: + flist += ',sum('+f+') as '+f + + cr.execute('select '+flist+' from ' + self._table +qu1+' group by '+groupby,qu2) + parent_res = cr.fetchall() + try: + parent_res = [(m[0],m[1]) for m in parent_res if m[0]] + except: + parent_res = [(m[0],) for m in parent_res if m[0]] + groupby_ids = map(lambda x:x[0],parent_res) + + groupby_name = {} + child_ids_dict = {} + + if fields[groupby]['type'] == 'many2one': + groupby_name = dict(self.pool.get(fields[groupby]['relation']).name_get(cr,uid,groupby_ids,context)) + + # get child ids + for parent_id in groupby_ids: + cr.execute('select id from '+self._table+qu1 +' AND '+groupby+" = '%s'",qu2+[parent_id]) + child_ids = cr.fetchall() + for val in child_ids: + if parent_id not in child_ids_dict: + child_ids_dict[parent_id] = [val[0]] + else: + child_ids_dict[parent_id].append(val[0]) + #create [{},{}] for parent ids i.e for group by field + + result = [] + if fields[groupby]['type'] in ('date','datetime'): + curr_date = datetime.date.today() + yesterday = (curr_date - datetime.timedelta(days=1)).strftime('%Y-%m-%d') + lastweek = (curr_date + datetime.timedelta(weeks=-1)).strftime('%Y-%m-%d') + date_result = {'Today':{'group_child':[]},'Yesterday':{'group_child':[]}, + 'LastWeek':{'group_child':[]},'Old':{'group_child':[]}} + for x in parent_res: + db_date = x[0][:10] + if db_date == curr_date.strftime('%Y-%m-%d'): + date_format = 'Today' + elif db_date == yesterday: + date_format = 'Yesterday' + elif (db_date < yesterday) and (db_date >= lastweek): + date_format = 'LastWeek' + else: + date_format = 'Old' + date_result[date_format].update({'id':None,groupby:date_format}) + date_result[date_format]['group_child'] += child_ids_dict[x[0]] + float_int_sum = self.read(cr, uid, child_ids_dict[x[0]], float_int_fields, context) + for value in float_int_sum: + for field,val in value.items(): + if field in ['id','sequence']:continue + if field not in sum: + sum[field] = 0.0 + sum[field] += val + for k,v in sum.items(): + date_result[date_format][k] = v + sum = {} + for key,val in date_result.items(): + if len(date_result[key]) == 1: + del date_result[key] + continue + for field in fields.keys(): + if field not in val: + val[field] = False + if key in ('Today','Yesterday') and len(result): + result.insert(0,val) + else: + result.insert(-1,val) + return result + else: + for x in parent_res: + parent_val_dict = {'id':str(x[0])+':Gpby',groupby:(x[0],groupby_name[x[0]]),'group_child':child_ids_dict[x[0]]} + float_int_sum = self.read(cr, uid, child_ids_dict[x[0]], float_int_fields, context) + for value in float_int_sum: + for field,val in value.items(): + if field == 'id':continue + if field not in sum: + sum[field] = 0.0 + sum[field] += val + for k,v in sum.items(): + parent_val_dict[k] = v + sum = {} + for field in fields.keys(): + if field not in parent_val_dict: + parent_val_dict[field] = False + result.append(parent_val_dict) + return result + def _parent_store_compute(self, cr): logger = netsvc.Logger() logger.notifyChannel('orm', netsvc.LOG_INFO, 'Computing parent left and right for table %s...' % (self._table, )) From 43e9a9bb33751aeaf6790bc72b72b665a64d241a Mon Sep 17 00:00:00 2001 From: Launchpad Code Hosting Date: Thu, 21 Jan 2010 04:33:50 +0000 Subject: [PATCH 10/30] Launchpad automatic translations update. bzr revid: codehost@crowberry-20100121043350-q61rtullfbuh3wn1 --- bin/addons/base/i18n/fr.po | 10 +++++----- bin/addons/base/i18n/uk.po | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bin/addons/base/i18n/fr.po b/bin/addons/base/i18n/fr.po index 9ca7e1b6604..f8f51f05665 100644 --- a/bin/addons/base/i18n/fr.po +++ b/bin/addons/base/i18n/fr.po @@ -7,19 +7,19 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.4\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2009-12-25 06:29+0000\n" -"Last-Translator: Fabien (Open ERP) \n" +"PO-Revision-Date: 2010-01-20 09:53+0000\n" +"Last-Translator: Christophe Chauvet - http://www.syleam.fr/ \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-01-14 04:46+0000\n" +"X-Launchpad-Export-Date: 2010-01-21 04:33+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base #: model:res.country,name:base.sh msgid "Saint Helena" -msgstr "Sainte-Hélène" +msgstr "Île Sainte-Hélène" #. module: base #: wizard_view:res.partner.sms_send,init:0 @@ -2574,7 +2574,7 @@ msgstr "Type d'évènement" #: view:res.partner.bank:0 #: model:res.partner.bank.type,name:base.bank_normal msgid "Bank account" -msgstr "Compte banquaire" +msgstr "Compte bancaire" #. module: base #: view:ir.sequence.type:0 diff --git a/bin/addons/base/i18n/uk.po b/bin/addons/base/i18n/uk.po index a8710995501..2adeaba4363 100644 --- a/bin/addons/base/i18n/uk.po +++ b/bin/addons/base/i18n/uk.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: OpenERP Server 5.0.0\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2009-12-18 08:39+0000\n" -"PO-Revision-Date: 2010-01-19 05:18+0000\n" +"PO-Revision-Date: 2010-01-20 05:18+0000\n" "Last-Translator: Fabien (Open ERP) \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2010-01-20 04:36+0000\n" +"X-Launchpad-Export-Date: 2010-01-21 04:33+0000\n" "X-Generator: Launchpad (build Unknown)\n" #. module: base From e1fa59e1e24b12b33b250138b9389c8c068f6af6 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Thu, 21 Jan 2010 11:30:41 +0530 Subject: [PATCH 11/30] [IMP]:hr_evaluation:Set domain in Phase for particular plan and also improved the view of hr_evaluation. bzr revid: apa@tinyerp.com-20100121060041-k7131au9ve6l6ocp --- addons/hr_evaluation/hr_evaluation.py | 2 +- addons/hr_evaluation/hr_evaluation_view.xml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/hr_evaluation/hr_evaluation.py b/addons/hr_evaluation/hr_evaluation.py index df24164e497..41056d70dbc 100644 --- a/addons/hr_evaluation/hr_evaluation.py +++ b/addons/hr_evaluation/hr_evaluation.py @@ -52,7 +52,7 @@ class hr_evaluation_plan_phase(osv.osv): ('bottom-up','Bottom-Up Appraisal Requests'), ('self','Self Appraisal Requests'), ('final','Final Interview')], 'Action', required=True), - 'survey_id': fields.many2one('survey','Appraisal Form'), + 'survey_id': fields.many2one('survey','Appraisal Form',required=True), 'send_answer_manager': fields.boolean('All Answers', help="Send all answers to the manager"), 'send_answer_employee': fields.boolean('All Answers', diff --git a/addons/hr_evaluation/hr_evaluation_view.xml b/addons/hr_evaluation/hr_evaluation_view.xml index 451763fde0c..58aa5f4a3fc 100644 --- a/addons/hr_evaluation/hr_evaluation_view.xml +++ b/addons/hr_evaluation/hr_evaluation_view.xml @@ -54,6 +54,7 @@ form
+ @@ -124,7 +125,7 @@ - + From eb4909afcde7a0afa216d659cb1ea65a1bc6163d Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Thu, 21 Jan 2010 11:57:03 +0530 Subject: [PATCH 12/30] [FIX] Stock : Translations added for Shipping address bzr revid: jvo@tinyerp.com-20100121062703-5nf1c7dl72wr43v0 --- addons/stock/i18n/de.po | 5 +++++ addons/stock/i18n/fr.po | 5 +++++ addons/stock/i18n/stock.pot | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/addons/stock/i18n/de.po b/addons/stock/i18n/de.po index 8ba706c49be..61e055a1404 100644 --- a/addons/stock/i18n/de.po +++ b/addons/stock/i18n/de.po @@ -658,6 +658,11 @@ msgstr "Erledigt am" msgid "Expected Shipping Date" msgstr "Erwartete Auslieferung" +#. module: stock +#: rml:stock.picking.list:0 +msgid "Shipping Address :" +msgstr "Lieferanschrift:" + #. module: stock #: view:stock.tracking:0 msgid "Tracking/Serial" diff --git a/addons/stock/i18n/fr.po b/addons/stock/i18n/fr.po index 5210b7e2f92..22bca72c8ca 100644 --- a/addons/stock/i18n/fr.po +++ b/addons/stock/i18n/fr.po @@ -673,6 +673,11 @@ msgstr "Date de fin" msgid "Expected Shipping Date" msgstr "Date d'envoi prévue" +#. module: stock +#: rml:stock.picking.list:0 +msgid "Shipping Address :" +msgstr "Adresse de livraison :" + #. module: stock #: view:stock.tracking:0 msgid "Tracking/Serial" diff --git a/addons/stock/i18n/stock.pot b/addons/stock/i18n/stock.pot index 0cb2bb5dc63..2d4c615b7c1 100644 --- a/addons/stock/i18n/stock.pot +++ b/addons/stock/i18n/stock.pot @@ -646,6 +646,11 @@ msgstr "" msgid "Expected Shipping Date" msgstr "" +#. module: stock +#: rml:stock.picking.list:0 +msgid "Shipping Address :" +msgstr "" + #. module: stock #: view:stock.tracking:0 msgid "Tracking/Serial" From 5108ec7da5fc62a70b080157a125cb745617dfc4 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Thu, 21 Jan 2010 12:01:36 +0530 Subject: [PATCH 13/30] [IMP]:crm_hr:Improved menu view in report_crm_hr_view.xml.(Ref.VIR). bzr revid: apa@tinyerp.com-20100121063136-l7czu1d03n4d9tb0 --- addons/crm_hr/report_crm_hr_view.xml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/addons/crm_hr/report_crm_hr_view.xml b/addons/crm_hr/report_crm_hr_view.xml index d2ce5854d0f..7359b6ecade 100644 --- a/addons/crm_hr/report_crm_hr_view.xml +++ b/addons/crm_hr/report_crm_hr_view.xml @@ -35,7 +35,7 @@ - + report.crm.job.user.graph report.crm.job.user @@ -59,7 +59,7 @@ - + Jobs by User and Section report.crm.job.user @@ -68,9 +68,14 @@ + - + @@ -137,7 +142,7 @@ - + @@ -187,6 +192,6 @@ - + From be9a863b07aea8f30fa4a0dc1c18586c279cb04a Mon Sep 17 00:00:00 2001 From: "HDA (OpenERP)" Date: Thu, 21 Jan 2010 12:54:32 +0530 Subject: [PATCH 14/30] Improve read_group bzr revid: hda@tinyerp.com-20100121072432-0vrjmmcwwi6jzskg --- bin/osv/orm.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index 8ee4a6170db..df771db4000 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -1818,8 +1818,8 @@ class orm(orm_template): qu1 = ' where '+string.join(qu1, ' and ') else: qu1 = '' -# limit_str = limit and ' limit %d' % limit or '' -# offset_str = offset and ' offset %d' % offset or '' + limit_str = limit and ' limit %d' % limit or '' + offset_str = offset and ' offset %d' % offset or '' float_int_fields = list(field_name for field_name,values in fields.items() if values['type'] in ('float','integer')) sum = {} @@ -1828,7 +1828,7 @@ class orm(orm_template): if f not in ['id','sequence']: flist += ',sum('+f+') as '+f - cr.execute('select '+flist+' from ' + self._table +qu1+' group by '+groupby,qu2) + cr.execute('select '+flist+' from ' + self._table +qu1+' group by '+ groupby + limit_str + offset_str,qu2) parent_res = cr.fetchall() try: parent_res = [(m[0],m[1]) for m in parent_res if m[0]] From bd97359ad9088ef4107b635ab20bf459deba5aae Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Thu, 21 Jan 2010 13:08:43 +0530 Subject: [PATCH 15/30] [IMP]:Survey:-improved survey.request view and browse report of the survey module.(Ref.YSA). bzr revid: apa@tinyerp.com-20100121073843-e2eq3p78f54qgwu6 --- .../survey/report/survey_browse_response.py | 12 ++++++-- addons/survey/survey.py | 29 +++++++++++++++++-- addons/survey/survey_view.xml | 17 +++++++---- 3 files changed, 47 insertions(+), 11 deletions(-) diff --git a/addons/survey/report/survey_browse_response.py b/addons/survey/report/survey_browse_response.py index ab1e4027905..f6f5600cbb6 100644 --- a/addons/survey/report/survey_browse_response.py +++ b/addons/survey/report/survey_browse_response.py @@ -145,7 +145,11 @@ class survey_browse_response(report_rml): """ answer = surv_resp_line_obj.browse(cr,uid, surv_resp_line_obj.search(cr, uid, [('question_id','=',que.id),('response_id','=',response.id)])) - if que.type in ['table']: + if que.type in ['descriptive_text']: + rml +=""" + """ + to_xml(que.descriptive_text) + """ + """ + elif que.type in ['table']: if len(answer) and answer[0].state == "done": col_heading = pooler.get_pool(cr.dbname).get('survey.tbl.column.heading') cols_widhts = [] @@ -262,7 +266,7 @@ class survey_browse_response(report_rml): value = """""" for res_ans in answer[0].response_answer_ids: if res_ans.answer_id.id == ans.id and res_ans.answer == matrix_ans[mat_col]: - comment_value = """""" + to_xml(tools.ustr(res_ans.comment_field)) + """""" + comment_value = to_xml(tools.ustr(res_ans.comment_field)) if que.type in ['matrix_of_drop_down_menus']: value = """""" + to_xml(tools.ustr(res_ans.value_choice)) + """""" elif que.type in ['matrix_of_choices_only_one_ans','rating_scale']: @@ -292,7 +296,9 @@ class survey_browse_response(report_rml): """ rml+= """""" + value + """""" if que.comment_column: - rml+= """""" + comment_value + """""" + if comment_value=='False': + comment_value = '' + rml+= """"""+ comment_value + """""" rml+=""" """ if que.comment_field_type: rml+=""" diff --git a/addons/survey/survey.py b/addons/survey/survey.py index 774721b26a8..53d57efd59b 100644 --- a/addons/survey/survey.py +++ b/addons/survey/survey.py @@ -29,6 +29,7 @@ from tools.translate import _ from lxml import etree from tools import to_xml import tools +from mx.DateTime import * class survey(osv.osv): _name = 'survey' @@ -735,7 +736,8 @@ class survey_question_wiz(osv.osv_memory): etree.SubElement(xml_group, 'field', {'name': tools.ustr(que) + "_" + tools.ustr(ans['id'])}) fields[tools.ustr(que) + "_" + tools.ustr(ans['id'])] = {'type':'datetime', 'string':ans['answer']} elif que_rec['type'] == 'descriptive_text': - etree.SubElement(xml_group, 'label', {'string': to_xml(tools.ustr(que_rec['descriptive_text']))}) + for que_test in que_rec['descriptive_text'].split('\n'): + etree.SubElement(xml_group, 'label', {'string': to_xml(tools.ustr(que_test)), 'align':"0.0"}) elif que_rec['type'] == 'single_textbox': etree.SubElement(xml_group, 'field', {'name': tools.ustr(que) + "_single", 'nolabel':"1" ,'colspan':"4"}) fields[tools.ustr(que) + "_single"] = {'type':'char', 'size' : 255, 'string':"single_textbox", 'views':{}} @@ -1341,14 +1343,37 @@ res_users() class survey_request(osv.osv): _name = "survey.request" _order = 'date_deadline' + _rec_name = 'date_deadline' _columns = { 'date_deadline' : fields.date("Deadline date"), 'user_id' : fields.many2one("res.users", "User"), 'email' : fields.char("E-mail", size=64), 'survey_id' : fields.many2one("survey", "Survey", required=1), 'answer_ids' : fields.one2many('survey.answer', 'question_id', 'Answer'), - 'state' : fields.selection([('waitin_answer', 'Wating Answer'),('done', 'Done'),('cancelled', 'Cancelled')], 'State') + 'state' : fields.selection([('waiting_answer', 'Wating Answer'),('done', 'Done'),('cancel', 'Cancelled')], 'State', readonly=1) } + _defaults = { + 'state' : lambda * a: 'waiting_answer', + 'date_deadline' : lambda * a : (now() + RelativeDateTime(months=+1)).strftime("%Y-%m-%d %H:%M:%S") + } + def survey_req_waiting_answer(self, cr, uid, ids, arg): + self.write(cr, uid, ids, { 'state' : 'waiting_answer'}) + return True + + def survey_req_done(self, cr, uid, ids, arg): + self.write(cr, uid, ids, { 'state' : 'done'}) + return True + + def survey_req_cancel(self, cr, uid, ids, arg): + self.write(cr, uid, ids, { 'state' : 'cancel'}) + return True + + def on_change_user(self, cr, uid, ids, user_id, context=None): + if user_id: + user_obj = self.pool.get('res.users') + user = user_obj.browse(cr, uid, user_id) + return {'value': {'email': user.address_id.email}} + return {} survey_request() diff --git a/addons/survey/survey_view.xml b/addons/survey/survey_view.xml index d68cf5bca7b..443a43701e0 100644 --- a/addons/survey/survey_view.xml +++ b/addons/survey/survey_view.xml @@ -12,9 +12,9 @@ - + id="base.menu_lunch_survey_root" groups="group_survey_manager" sequence="5"/> + @@ -958,10 +958,15 @@ + - - - + + + +