diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 2688c19cf33..4e7e1d0ea84 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'), @@ -192,13 +205,14 @@ 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), 'state' : fields.selection(POS_SESSION_STATE, 'Status', required=True, readonly=True, select=1), - + '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 19bf3cf2b0c..db113738620 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,11 @@
- - - + +
@@ -938,8 +942,9 @@ - - + + 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