From 01b074b94974b65e23672f9ca0d9bd1b0a6fef85 Mon Sep 17 00:00:00 2001 From: Naresh Choksy Date: Mon, 1 Sep 2008 14:05:16 +0530 Subject: [PATCH 01/35] Added Calendar view on mrp.operation bzr revid: nch@tinyerp.com-20080901083516-cdoofu030jidojpn --- addons/mrp_operations/mrp_operations.py | 15 +++++++++++++ addons/mrp_operations/mrp_operations_view.xml | 21 +++++++++++++++++-- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/addons/mrp_operations/mrp_operations.py b/addons/mrp_operations/mrp_operations.py index d654e337e67..ff01528d5f7 100644 --- a/addons/mrp_operations/mrp_operations.py +++ b/addons/mrp_operations/mrp_operations.py @@ -133,6 +133,18 @@ mrp_operations_operation_code() class mrp_operations_operation(osv.osv): _name="mrp_operations.operation" + + def _order_date_search_production(self,cr,uid,ids): + operation_ids=self.pool.get('mrp_operations.operation').search(cr,uid,[('production_id','=',ids[0])]) + return operation_ids + + def _get_order_date(self, cr, uid, ids, field_name, arg, context): + res={} + operation_obj=self.browse(cr, uid, ids, context=context) + for operation in operation_obj: + res[operation.id]=operation.production_id.date_planned + return res + def create(self, cr, uid, vals, context=None): wf_service = netsvc.LocalService('workflow') code_ids=self.pool.get('mrp_operations.operation.code').search(cr,uid,[('id','=',vals['code_id'])]) @@ -154,6 +166,9 @@ class mrp_operations_operation(osv.osv): 'production_id':fields.many2one('mrp.production','Production',required=True), 'workcenter_id':fields.many2one('mrp.workcenter','Workcenter',required=True), 'code_id':fields.many2one('mrp_operations.operation.code','Code',required=True), + 'date_start': fields.datetime('Start Date'), + 'date_finished': fields.datetime('End Date'), + 'order_date': fields.function(_get_order_date,method=True,string='Order Date',type='date',store={'mrp.production':(['date_planned'],_order_date_search_production)}), } mrp_operations_operation() diff --git a/addons/mrp_operations/mrp_operations_view.xml b/addons/mrp_operations/mrp_operations_view.xml index 9cd3ae93053..d1aade98cbb 100644 --- a/addons/mrp_operations/mrp_operations_view.xml +++ b/addons/mrp_operations/mrp_operations_view.xml @@ -145,6 +145,9 @@ + + + @@ -167,11 +170,25 @@ ir.actions.act_window mrp_operations.operation form + tree,calendar,form - - + + + mrp.perations.calendar + mrp_operations.operation + calendar + + + + + + + + + + From b0c241ef3b7daa08370800a2cf1734bad2de3edd Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Tue, 23 Sep 2008 08:00:56 +0200 Subject: [PATCH 02/35] bugfix bzr revid: fp@tinyerp.com-20080923060056-451wx2kq2rl5rqcm --- addons/account/account_analytic_line.py | 8 ++++++++ addons/account/project/project_view.xml | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/addons/account/account_analytic_line.py b/addons/account/account_analytic_line.py index 68559fd48b1..c55d49a418f 100644 --- a/addons/account/account_analytic_line.py +++ b/addons/account/account_analytic_line.py @@ -89,6 +89,14 @@ class account_analytic_line(osv.osv): }} return {} + def view_header_get(self, cr, user, view_id, view_type, context): + if context.get('account_id', False): + cr.execute('select name from account_analytic_account where id=%d', (context['account_id'],)) + res = cr.fetchone() + res = _('Entries: ')+ (res[0] or '') + return res + return False + account_analytic_line() diff --git a/addons/account/project/project_view.xml b/addons/account/project/project_view.xml index e62eeb7d3d7..5178b07eea8 100644 --- a/addons/account/project/project_view.xml +++ b/addons/account/project/project_view.xml @@ -154,11 +154,12 @@ - action.account.tree1 + account.analytic.line form tree,form [('account_id','=', active_id)] + {'account_id':active_id} From d5d4fbf98246d15dd5f557891ebe80c30d082c7e Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Tue, 23 Sep 2008 08:04:26 +0200 Subject: [PATCH 03/35] view improvement bzr revid: fp@tinyerp.com-20080923060426-nxjtg5pb2hcptjln --- addons/project/project_view.xml | 58 ++++++++++++++++----------------- 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index fad26416d78..bfb85802320 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -21,20 +21,20 @@ - - - + + + - +