pos.py 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # -*- coding: utf-8 -*-
  2. ##############################################################################
  3. #
  4. # OpenERP, Open Source Management Solution
  5. # Copyright (C) 2016 ePillars Systems (<http://epillars.com>).
  6. #
  7. # This program is free software: you can redistribute it and/or modify
  8. # it under the terms of the GNU Affero General Public License as
  9. # published by the Free Software Foundation, either version 3 of the
  10. # License, or (at your option) any later version.
  11. #
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU Affero General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU Affero General Public License
  18. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. #
  20. ##############################################################################
  21. from openerp.osv import fields, osv
  22. class pos_config(osv.osv):
  23. _inherit="pos.config"
  24. _columns={
  25. 'multi_currency_enable':fields.boolean('Enable Multi-Currency',
  26. help='Select this to enable Multi-currency options in POS'),
  27. 'display_conversion':fields.boolean('Display Conversion on POS',
  28. help='Check this to display the conversion factor on the POS terminal'),
  29. 'fetch_master':fields.boolean('Fetch Currency Master',
  30. help='Check this if you would like to fetch all conversion factors and currencies from the master table'),
  31. 'currency_lines':fields.one2many('pos.currency.line','pos_config_id','POS Currency Lines'),
  32. }
  33. _defaults={
  34. 'multi_currency_enable':True,
  35. 'display_conversion':True,
  36. 'fetch_master':True,
  37. }
  38. class pos_currency_line(osv.osv):
  39. _name="pos.currency.line"
  40. _description="POS Currency Lines"
  41. _columns={
  42. 'pos_config_id':fields.many2one('pos.config','POS Config'),
  43. 'currency_id':fields.many2one('res.currency','Currency'),
  44. 'rate_silent':fields.float('Conversion Factor', digits=(12,6)),
  45. }