Retail:Developers Guide/Terminal properties
Contents |
Introduction
When accessing Web POS it is needed to indicate the terminal in the URL. for example: http://<your-openbravo-server>/openbravo/web/org.openbravo.retail.posterminal/?terminal=POS-1 where POS-1 is the Search key value of the POS Terminal window where are defined all the configuration parameters for the terminal. All these configuration properties and other general properties are available in javascript from the global Backbone model OB.POS.modelterminal
Attributes included in the terminal model
The OB.POS.modelterminal model is defined in the javascript file: org.openbravo.retail.posterminal/web/org.openbravo.retail.posterminal/js/model/terminal.js, All these attributes are loaded/set when the terminal loads.
The attributes are:
- terminal: it contains global attributes (business partner id, currency, document type, client, organization, ...)
- payments: it contains the payment methods available
- context: it contains full information about the "role" and the "user"
- permissions: it contains some specific actions permission status (change price, apply discounts, use card/cash/voucher, point of sale/cash management/cash up access, ...)
- businesspartner: it contains full information about the business partner (id, name, payment method/terms, tax category, ...)
- location: it contains full information about the organization location (country, city, address, postal code, region, ...)
- pricelist: it contains full information about the current set price list
- pricelistversion: it contains the price list version for the current price list
- currency: it contains full information about the currency (description, iso code, symbol, ...)
These attributes can be accessed using javascript by:
OB.POS.modelterminal.get('theAttribute')
Security
The OB.POS.modelterminal model is also responsible of checking the security of actions and windows defined as Role preferences. To check if the logged user has permissions to certain action or window you can call the following function checks whether the user has permission to change the price of an order line or not:
OB.POS.modelterminal.hasPermission('OBPOS_order.changePrice')
Add properties through module
Since RMP24, the properties loaded in terminal model can be extended by a module thanks to 'Properties loader'.
Back to Concepts