From ca9c79727541fbf87f316906887e920e79b9550c Mon Sep 17 00:00:00 2001 From: Amit Parik Date: Wed, 5 Sep 2012 17:03:13 +0530 Subject: [PATCH 01/24] [FIX]:project_timesheet impossible to edit task work bzr revid: pja@tinyerp.com-20120905113313-c2cbi37xqr6mnvrc --- addons/project_timesheet/project_timesheet.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/project_timesheet/project_timesheet.py b/addons/project_timesheet/project_timesheet.py index 1e50848201c..12d1eedbeb2 100644 --- a/addons/project_timesheet/project_timesheet.py +++ b/addons/project_timesheet/project_timesheet.py @@ -166,10 +166,7 @@ class project_work(osv.osv): vals_line['name'] = '%s: %s' % (tools.ustr(task.task_id.name), tools.ustr(vals['name']) or '/') if 'user_id' in vals: vals_line['user_id'] = vals['user_id'] - result = self.get_user_related_details(cr, uid, vals.get('user_id', task.user_id.id)) - for fld in ('product_id', 'general_account_id', 'journal_id', 'product_uom_id'): - if result.get(fld, False): - vals_line[fld] = result[fld] + if 'date' in vals: vals_line['date'] = vals['date'][:10] @@ -177,7 +174,10 @@ class project_work(osv.osv): default_uom = self.pool.get('res.users').browse(cr, uid, uid).company_id.project_time_mode_id.id vals_line['unit_amount'] = vals['hours'] prod_id = vals_line.get('product_id', line_id.product_id.id) # False may be set - + result = self.get_user_related_details(cr, uid, vals.get('user_id', task.user_id.id)) + for fld in ('product_id', 'general_account_id', 'journal_id', 'product_uom_id'): + if result.get(fld, False): + vals_line[fld] = result[fld] if result.get('product_uom_id',False) and (not result['product_uom_id'] == default_uom): vals_line['unit_amount'] = uom_obj._compute_qty(cr, uid, default_uom, vals['hours'], result['product_uom_id']) From f0a883e6d6b942fc54dea0db0bcb8f3f33170098 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Mon, 24 Sep 2012 12:26:13 +0200 Subject: [PATCH 02/24] [FIX] point_of_sale: Show the opening_control & closing_control bzr revid: stw@openerp.com-20120924102613-twii7ba34wctx6c6 --- addons/point_of_sale/point_of_sale_view.xml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/addons/point_of_sale/point_of_sale_view.xml b/addons/point_of_sale/point_of_sale_view.xml index 9c92145ed89..d88e1f73cc2 100644 --- a/addons/point_of_sale/point_of_sale_view.xml +++ b/addons/point_of_sale/point_of_sale_view.xml @@ -896,8 +896,11 @@ - + + + @@ -917,7 +920,7 @@ -
+
From 24a4e57171fd0ce371260370226f4c90607f390b Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Mon, 24 Sep 2012 13:53:20 +0200 Subject: [PATCH 03/24] [FIX] point_of_sale: show the opening cash control bzr revid: stw@openerp.com-20120924115320-nkbfhfnyab4bhxrc --- addons/point_of_sale/point_of_sale_view.xml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/addons/point_of_sale/point_of_sale_view.xml b/addons/point_of_sale/point_of_sale_view.xml index d88e1f73cc2..131909a1fd3 100644 --- a/addons/point_of_sale/point_of_sale_view.xml +++ b/addons/point_of_sale/point_of_sale_view.xml @@ -896,11 +896,7 @@ - - - + From 4f74d0aee15da72d386b03ba721b8ac67c4ea5a5 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Thu, 27 Sep 2012 14:19:54 +0200 Subject: [PATCH 04/24] [FIX] point_of_sale: show the cash_register_balance when we are in closing_control bzr revid: stw@openerp.com-20120927121954-1safkpgurh4nu9kc --- addons/point_of_sale/point_of_sale_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/point_of_sale_view.xml b/addons/point_of_sale/point_of_sale_view.xml index c08695ee993..5b30ced93dd 100644 --- a/addons/point_of_sale/point_of_sale_view.xml +++ b/addons/point_of_sale/point_of_sale_view.xml @@ -934,7 +934,7 @@
- + From ff211c375a2bc589082d6dd05484fd01c2068d6e Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Thu, 27 Sep 2012 14:20:22 +0200 Subject: [PATCH 05/24] [FIX] point_of_sale: return the session id in the context for the call of the pos.ui bzr revid: stw@openerp.com-20120927122022-fy2gx1z1xtkk14xt --- addons/point_of_sale/point_of_sale.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 590718b48f0..920e70b7b7d 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -439,10 +439,10 @@ class pos_session(osv.osv): context = {} if not ids: return {} - context.update({'session_id' : ids[0]}) + context.update({'active_id': ids[0]}) return { 'type' : 'ir.actions.client', - 'name' : 'Start Point Of Sale', + 'name' : _('Start Point Of Sale'), 'tag' : 'pos.ui', 'context' : context, } From 3bd0b43e8103193bb1461bbf1877eeaaf405a9f1 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Mon, 1 Oct 2012 11:52:54 +0200 Subject: [PATCH 06/24] [FIX] point_of_sale: We use a callback for the 'Validate & Open Session' button, because we want to open the PoS UI. [FIX] point_of_sale: Hide/Show the opening/closing cash control bzr revid: stw@openerp.com-20121001095254-bcteq9amp0eurn3g --- addons/point_of_sale/point_of_sale.py | 23 +++++++++++++++++++++ addons/point_of_sale/point_of_sale_view.xml | 13 ++++++------ 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 920e70b7b7d..dfd0d73ad55 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -348,6 +348,29 @@ class pos_session(osv.osv): statement.unlink(context=context) return True + + def open_cb(self, cr, uid, ids, context=None): + """ + call the Point Of Sale interface and set the pos.session to 'opened' (in progress) + """ + if context is None: + context = dict() + + if isinstance(ids, (int, long)): + ids = [ids] + + this_record = self.browse(cr, uid, ids[0], context=context) + this_record._workflow_signal('open') + + context.update(active_id=this_record.id) + + return { + 'type' : 'ir.actions.client', + 'name' : _('Start Point Of Sale'), + 'tag' : 'pos.ui', + 'context' : context, + } + def wkf_action_open(self, cr, uid, ids, context=None): # second browse because we need to refetch the data from the DB for cash_register_id for record in self.browse(cr, uid, ids, context=context): diff --git a/addons/point_of_sale/point_of_sale_view.xml b/addons/point_of_sale/point_of_sale_view.xml index 5b30ced93dd..66b7e3b6eb5 100644 --- a/addons/point_of_sale/point_of_sale_view.xml +++ b/addons/point_of_sale/point_of_sale_view.xml @@ -862,7 +862,7 @@
-