From 1aba414a21bb8537b347cc1a82d263fc4c900269 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Mon, 30 Mar 2009 19:01:17 +0530 Subject: [PATCH 1/9] Added form view for report_sale bzr revid: jvo@tinyerp.com-20090330133117-vyicn9i85l1js69i --- .../hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py | 2 +- addons/report_sale/report_sale_view.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py index 7ff1967c63a..d706a3eb25d 100644 --- a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py +++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py @@ -95,7 +95,7 @@ class invoice_create(wizard.interface): for product_id,factor_id,qty in cr.fetchall(): product = pool.get('product.product').browse(cr, uid, product_id, context2) if not product: - raise wizard.except_wizard(_('Error'), _('At least on line have no product !')) + raise wizard.except_wizard(_('Error'), _('At least one line has no product !')) factor_name = '' factor = pool.get('hr_timesheet_invoice.factor').browse(cr, uid, factor_id, context2) if factor.customer_name: diff --git a/addons/report_sale/report_sale_view.xml b/addons/report_sale/report_sale_view.xml index cbf6d2fa270..a4dbdad6b2a 100644 --- a/addons/report_sale/report_sale_view.xml +++ b/addons/report_sale/report_sale_view.xml @@ -166,7 +166,7 @@ Sales by State sale.order form - graph,tree + graph,tree,form [('state','<>','done')] From 0f89e23954fe0597e8e745bea2f6818d186737c8 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Tue, 31 Mar 2009 01:10:59 +0200 Subject: [PATCH 2/9] merge bzr revid: fp@tinyerp.com-20090330231059-axmtdiszz5kpbfpe --- addons/document/document.py | 12 ++++++------ addons/project_gtd/project_gtd.py | 3 +-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/addons/document/document.py b/addons/document/document.py index e86d90e4643..fcd60619a97 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -492,11 +492,11 @@ class document_file(osv.osv): result = {} cr.execute('select id,store_fname,link from ir_attachment where id in ('+','.join(map(str,ids))+')') for id,r,l in cr.fetchall(): - try: - value = file(os.path.join(self._get_filestore(cr), r), 'rb').read() - result[id] = base64.encodestring(value) - except: - result[id]='' + try: + value = file(os.path.join(self._get_filestore(cr), r), 'rb').read() + result[id] = base64.encodestring(value) + except: + result[id]='' if context.get('bin_size', False): result[id] = tools.human_size(len(result[id])) @@ -581,7 +581,7 @@ class document_file(osv.osv): res_id=file.res_id and file.res_id or 0 res=self.search(cr,uid,[('id','<>',file.id),('name','=',name),('parent_id','=',parent_id),('res_model','=',res_model),('res_id','=',res_id)]) if len(res): - return False + return False if op=='create': res=self.search(cr,uid,[('name','=',name),('parent_id','=',parent_id),('res_id','=',res_id),('res_model','=',res_model)]) if len(res): diff --git a/addons/project_gtd/project_gtd.py b/addons/project_gtd/project_gtd.py index 8d855149e3f..1767965c59c 100644 --- a/addons/project_gtd/project_gtd.py +++ b/addons/project_gtd/project_gtd.py @@ -125,14 +125,13 @@ class project_gtd_timebox(osv.osv): if rec.col_planned_hours: res['arch'] += '\n' if rec.col_effective_hours: - res['arch'] += '\n' + res['arch'] += '\n' % (_('Eff. Hours'),) res['arch'] += """ """ - res['arch']+=""" From b563f23652c9dbc74e61cb4facfce4e6c07d4b66 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Tue, 31 Mar 2009 15:07:59 +0530 Subject: [PATCH 3/9] [FIX]Bug 352191 : Corrected hr_attendance creation for timesheet when date=last date of timesheet bzr revid: jvo@tinyerp.com-20090331093759-lyethfo210xu2591 --- .../hr_timesheet_sheet/hr_timesheet_sheet.py | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py index 5c4f6def59f..237d0f6c9c3 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py @@ -437,23 +437,21 @@ class hr_attendance(osv.osv): def _sheet(self, cursor, user, ids, name, args, context): sheet_obj = self.pool.get('hr_timesheet_sheet.sheet') - - cursor.execute('SELECT a.id, COALESCE(MAX(s.id), 0) \ + cursor.execute("SELECT a.id, COALESCE(MAX(s.id), 0) \ FROM hr_timesheet_sheet_sheet s \ LEFT JOIN (hr_attendance a \ LEFT JOIN hr_employee e \ ON (a.employee_id = e.id)) \ - ON (s.date_to >= a.name \ - AND s.date_from <= a.name \ + ON (s.date_to >= to_date(to_char(a.name, 'YYYY-MM-dd'),'YYYY-MM-dd') \ + AND s.date_from <= to_date(to_char(a.name, 'YYYY-MM-dd'),'YYYY-MM-dd') \ AND s.user_id = e.user_id) \ - WHERE a.id in (' + ','.join([str(x) for x in ids]) + ') \ - GROUP BY a.id') + WHERE a.id in (" + ",".join([str(x) for x in ids]) + ") \ + GROUP BY a.id") res = dict(cursor.fetchall()) sheet_names = {} for sheet_id, name in sheet_obj.name_get(cursor, user, res.values(), context=context): sheet_names[sheet_id] = name - for line_id in {}.fromkeys(ids): sheet_id = res.get(line_id, False) if sheet_id: @@ -527,11 +525,11 @@ class hr_attendance(osv.osv): if 'sheet_id' in context: ts = self.pool.get('hr_timesheet_sheet.sheet').browse(cr, uid, context['sheet_id']) if ts.state not in ('draft', 'new'): - raise osv.except_osv(_('Error !'), _('You can not modify an entry in a confirmed timesheet !')) + raise osv.except_osv(_('Error !'), _('You cannot modify an entry in a confirmed timesheet !')) res = super(hr_attendance,self).create(cr, uid, vals, context=context) if 'sheet_id' in context: - if context['sheet_id'] != self.browse(cr, uid, res, context=context).sheet_id.id: - raise osv.except_osv(_('UserError'), _('You can not enter an attendance ' \ + if context['sheet_id'] != vals['sheet_id']: + raise osv.except_osv(_('UserError'), _('You cannot enter an attendance ' \ 'date outside the current timesheet dates!')) return res @@ -545,14 +543,14 @@ class hr_attendance(osv.osv): if 'sheet_id' in context: for attendance in self.browse(cr, uid, ids, context=context): if context['sheet_id'] != attendance.sheet_id.id: - raise osv.except_osv(_('UserError'), _('You can not enter an attendance ' \ + raise osv.except_osv(_('UserError'), _('You cannot enter an attendance ' \ 'date outside the current timesheet dates!')) return res def _check(self, cr, uid, ids): for att in self.browse(cr, uid, ids): if att.sheet_id and att.sheet_id.state not in ('draft', 'new'): - raise osv.except_osv(_('Error !'), _('You can not modify an entry in a confirmed timesheet !')) + raise osv.except_osv(_('Error !'), _('You cannot modify an entry in a confirmed timesheet !')) return True hr_attendance() From 7cb4ab3da793b3691d4233ecf50bbb50a147b248 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Tue, 31 Mar 2009 17:03:51 +0530 Subject: [PATCH 4/9] [FIX]Bug 352191 : Corrected bzr revid: jvo@tinyerp.com-20090331113351-3bcrryo6ws3asnv3 --- addons/hr_timesheet_sheet/hr_timesheet_sheet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py index 237d0f6c9c3..1aa4673ce8a 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py @@ -528,7 +528,7 @@ class hr_attendance(osv.osv): raise osv.except_osv(_('Error !'), _('You cannot modify an entry in a confirmed timesheet !')) res = super(hr_attendance,self).create(cr, uid, vals, context=context) if 'sheet_id' in context: - if context['sheet_id'] != vals['sheet_id']: + if context['sheet_id'] != self.browse(cr, uid, res, context=context).sheet_id.id: raise osv.except_osv(_('UserError'), _('You cannot enter an attendance ' \ 'date outside the current timesheet dates!')) return res From 2f64129f27fcda4209229cfc962a6d25849f78c3 Mon Sep 17 00:00:00 2001 From: husen daudi Date: Tue, 31 Mar 2009 17:41:03 +0530 Subject: [PATCH 5/9] bugfix for encoding problem lp bug: https://launchpad.net/bugs/352262 fixed bzr revid: hda@hda-20090331121103-c0ee32enjnz2ywpy --- addons/project_timesheet/project_timesheet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/project_timesheet/project_timesheet.py b/addons/project_timesheet/project_timesheet.py index b785e9d9d7b..536cd0a5b09 100644 --- a/addons/project_timesheet/project_timesheet.py +++ b/addons/project_timesheet/project_timesheet.py @@ -80,7 +80,7 @@ class project_work(osv.osv): if line_id in list_avail_ids: obj = self.pool.get('hr.analytic.timesheet') if 'name' in vals: - vals_line['name'] = '%s: %s' % (task.name, vals['name'] or '/') + vals_line['name'] = '%s: %s' % (tools.ustr(task.name), tools.ustr(vals['name']) or '/') if 'user_id' in vals: vals_line['user_id'] = vals['user_id'] if 'date' in vals: From 5ed84b03ac953e012a419487b95799dbc9f91f8e Mon Sep 17 00:00:00 2001 From: qdp Date: Tue, 31 Mar 2009 14:15:39 +0200 Subject: [PATCH 6/9] [IMP] improved the access rights: sale /manager can now delete sale order lines and sale orders bzr revid: qdp@tinyerp.com-20090331121539-cn4qa7bjq1p9f3u6 --- addons/sale/security/ir.model.access.csv | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/sale/security/ir.model.access.csv b/addons/sale/security/ir.model.access.csv index d1d440185f9..6f3e7ac5bf0 100644 --- a/addons/sale/security/ir.model.access.csv +++ b/addons/sale/security/ir.model.access.csv @@ -17,3 +17,5 @@ "access_sale_order_line_mrp_user","sale.order.line mrp worker","model_sale_order_line","mrp.group_mrp_user",1,0,0,0 "access_sale_order_stock_worker","sale.order stock worker","model_sale_order","stock.group_stock_user",1,0,0,0 "access_sale_order_line_stock_worker","sale.order.line stock worker","model_sale_order_line","stock.group_stock_user",1,0,0,0 +"access_sale_order_manager","sale.order.manager","model_sale_order","group_sale_manager",1,1,1,1 +"access_sale_order_line_manager","sale.order.line.manager","model_sale_order_line","group_sale_manager",1,1,1,1 From 46e91ab45c65c351a3b5b02ec76ed7effc0f964a Mon Sep 17 00:00:00 2001 From: qdp Date: Tue, 31 Mar 2009 14:17:20 +0200 Subject: [PATCH 7/9] [IMP] added a sequence and an 'order by' on stages of the crm bzr revid: qdp@tinyerp.com-20090331121720-gp3os0tip3usjo50 --- addons/crm_configuration/crm_config.py | 5 +++++ addons/crm_configuration/crm_config_view.xml | 2 ++ 2 files changed, 7 insertions(+) diff --git a/addons/crm_configuration/crm_config.py b/addons/crm_configuration/crm_config.py index 8091fe3d4a4..697a82d19c3 100644 --- a/addons/crm_configuration/crm_config.py +++ b/addons/crm_configuration/crm_config.py @@ -49,9 +49,14 @@ class crm_case_stage(osv.osv): _name = "crm.case.stage" _description = "Stage of case" _rec_name = 'name' + _order = "sequence" _columns = { 'name': fields.char('Stage Name', size=64, required=True, translate=True), 'section_id': fields.many2one('crm.case.section', 'Case Section'), + 'sequence': fields.integer('Sequence'), + } + _defaults = { + 'sequence': lambda *args: 1 } crm_case_stage() diff --git a/addons/crm_configuration/crm_config_view.xml b/addons/crm_configuration/crm_config_view.xml index 93a74249d08..03b70146083 100644 --- a/addons/crm_configuration/crm_config_view.xml +++ b/addons/crm_configuration/crm_config_view.xml @@ -72,6 +72,7 @@ tree + @@ -85,6 +86,7 @@
+ From b51351a411dafa534754b822a39b0018f92d5c1d Mon Sep 17 00:00:00 2001 From: husen daudi Date: Tue, 31 Mar 2009 19:09:17 +0530 Subject: [PATCH 8/9] Improved invoice tax compute lp bug: https://launchpad.net/bugs/351696 fixed bzr revid: hda@hda-20090331133917-f4mjmn40qsfs0691 --- .../hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py index d706a3eb25d..74968a2baec 100644 --- a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py +++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py @@ -158,6 +158,7 @@ class invoice_create(wizard.interface): pool.get('account.invoice.line').create(cr, uid, curr_line) strids = ','.join(map(str, data['ids'])) cr.execute("update account_analytic_line set invoice_id=%%s WHERE account_id = %%s and id IN (%s)" % strids, (last_invoice,account.id,)) + pool.get('account.invoice').button_reset_taxes(cr, uid, [last_invoice], context) return { 'domain': "[('id','in', ["+','.join(map(str,invoices))+"])]", From 5b190b0572e11aaeacc875f224b908a75e159340 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Tue, 31 Mar 2009 19:31:06 +0200 Subject: [PATCH 9/9] modifs bzr revid: fp@tinyerp.com-20090331173106-diqmxh2q30da95tn --- addons/stock/stock.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 6a9665bf882..9c67482f9fe 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -756,15 +756,6 @@ stock_picking() class stock_production_lot(osv.osv): - - def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False): - if context is None: - context = {} - res = super(stock_production_lot, self).search(cr, uid, args, offset, limit, order, context=context, count=count) - if res: - return [k for k,v in self._get_stock(cr, uid, res, 'stock_available', None, context).items() if v] - return res - def name_get(self, cr, uid, ids, context={}): if not ids: return []