From d3b14e953abd86593d201bf6d21f0fa95c11bb78 Mon Sep 17 00:00:00 2001 From: "Ajay Chauhan (OpenERP)" Date: Mon, 18 Mar 2013 14:15:47 +0530 Subject: [PATCH 1/3] [IMP] POS: added field currency_id to have currency symbol at pos total bzr revid: cha@tinyerp.com-20130318084547-42fwyv84jqqfi03h --- addons/point_of_sale/point_of_sale.py | 16 +++++++++++++++- addons/point_of_sale/point_of_sale_view.xml | 12 +++++++----- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 8627ff4bb99..c0043eaf496 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -45,6 +45,18 @@ class pos_config(osv.osv): ('deprecated', 'Deprecated') ] + def _get_currency(self, cr, uid, ids, fieldnames, args, context=None): + result = {} + currency_id = False + user = self.pool.get('res.users') + for pos_config in self.browse(cr, uid, ids, context=context): + if pos_config.journal_id: + currency_id = pos_config.journal_id.currency.id or pos_config.journal_id.company_id.currency_id.id + else: + currency_id = user.browse(cr, uid, pos_config.id, context=context).company_id.currency_id.id + result[pos_config.id] = currency_id + return result + _columns = { 'name' : fields.char('Point of Sale Name', size=32, select=1, required=True, help="An internal identification of the point of sale"), @@ -56,6 +68,7 @@ class pos_config(osv.osv): 'journal_id' : fields.many2one('account.journal', 'Sale Journal', domain=[('type', '=', 'sale')], help="Accounting journal used to post sales entries."), + 'currency_id' : fields.function(_get_currency, type="many2one", string="Currency", relation="res.currency"), 'iface_self_checkout' : fields.boolean('Self Checkout Mode', help="Check this if this point of sale should open by default in a self checkout mode. If unchecked, OpenERP uses the normal cashier mode by default."), 'iface_cashdrawer' : fields.boolean('Cashdrawer Interface'), @@ -198,7 +211,8 @@ class pos_session(osv.osv): 'state' : fields.selection(POS_SESSION_STATE, 'Status', required=True, readonly=True, select=1), - + + 'currency_id' : fields.related('config_id', 'currency_id', type="many2one", relation='res.currency', string="Currnecy"), 'cash_control' : fields.function(_compute_cash_all, multi='cash', type='boolean', string='Has Cash Control'), diff --git a/addons/point_of_sale/point_of_sale_view.xml b/addons/point_of_sale/point_of_sale_view.xml index e6e96f1aa14..c970f8b5870 100644 --- a/addons/point_of_sale/point_of_sale_view.xml +++ b/addons/point_of_sale/point_of_sale_view.xml @@ -772,6 +772,7 @@ + @@ -894,6 +895,7 @@ + @@ -922,9 +924,9 @@
- - - + + +
@@ -938,8 +940,8 @@ - - + + From 3c9a40ff84ef5b80bd8dd7fc4d1111ef0246d2b5 Mon Sep 17 00:00:00 2001 From: "Ajay Chauhan (OpenERP)" Date: Mon, 18 Mar 2013 14:37:47 +0530 Subject: [PATCH 2/3] [IMP] POS: made currency_id field invisible bzr revid: cha@tinyerp.com-20130318090747-4413l0il1pk7slww --- addons/point_of_sale/point_of_sale.py | 2 +- addons/point_of_sale/point_of_sale_view.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index c0043eaf496..19cace48d4d 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -205,6 +205,7 @@ class pos_session(osv.osv): readonly=True, states={'opening_control' : [('readonly', False)]} ), + 'currency_id' : fields.related('config_id', 'currency_id', type="many2one", relation='res.currency', string="Currnecy"), 'start_at' : fields.datetime('Opening Date', readonly=True), 'stop_at' : fields.datetime('Closing Date', readonly=True), @@ -212,7 +213,6 @@ class pos_session(osv.osv): required=True, readonly=True, select=1), - 'currency_id' : fields.related('config_id', 'currency_id', type="many2one", relation='res.currency', string="Currnecy"), 'cash_control' : fields.function(_compute_cash_all, multi='cash', type='boolean', string='Has Cash Control'), diff --git a/addons/point_of_sale/point_of_sale_view.xml b/addons/point_of_sale/point_of_sale_view.xml index c970f8b5870..22ee6abf5a3 100644 --- a/addons/point_of_sale/point_of_sale_view.xml +++ b/addons/point_of_sale/point_of_sale_view.xml @@ -772,7 +772,7 @@ - + @@ -895,7 +895,7 @@ - + From cbc2fc05c8ce64eb5e14cbf8f3058af478034073 Mon Sep 17 00:00:00 2001 From: "Ajay Chauhan (OpenERP)" Date: Mon, 18 Mar 2013 15:29:52 +0530 Subject: [PATCH 3/3] [IMP] POS: made changes to have POS total well aligned bzr revid: cha@tinyerp.com-20130318095952-wynm8qf0nmuq7uc5 --- addons/point_of_sale/point_of_sale_view.xml | 9 ++++++--- addons/point_of_sale/static/src/css/pos.css | 12 ++++++++++++ 2 files changed, 18 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 22ee6abf5a3..db113738620 100644 --- a/addons/point_of_sale/point_of_sale_view.xml +++ b/addons/point_of_sale/point_of_sale_view.xml @@ -925,8 +925,10 @@
- - +
@@ -941,7 +943,8 @@ - + diff --git a/addons/point_of_sale/static/src/css/pos.css b/addons/point_of_sale/static/src/css/pos.css index d9a4d6d00a9..847e4799e97 100644 --- a/addons/point_of_sale/static/src/css/pos.css +++ b/addons/point_of_sale/static/src/css/pos.css @@ -1431,3 +1431,15 @@ box-shadow: 0px 3px 38px rgba(0,0,0,0.3); border-radius: 3px; } +.openerp .oe_force_bold { + font-weight: bold !important; +} +.openerp .oe_pos_opening_total { + margin-right: -14px; +} +.openerp .oe_pos_ening_total { + margin-right: -7px; +} +.openerp .oe_pos_total { + margin-left: -2px; +} \ No newline at end of file