restaurant.py 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. # -*- coding: utf-8 -*-
  2. ##############################################################################
  3. #
  4. # OpenERP, Open Source Management Solution
  5. # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
  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. import logging
  22. import openerp
  23. from openerp import tools
  24. from openerp.osv import fields, osv
  25. from openerp.tools.translate import _
  26. _logger = logging.getLogger(__name__)
  27. class restaurant_printer(osv.osv):
  28. _name = 'restaurant.printer'
  29. _columns = {
  30. 'name' : fields.char('Printer Name', size=32, required=True, help='An internal identification of the printer'),
  31. 'proxy_ip': fields.char('Proxy IP Address', size=32, help="The IP Address or hostname of the Printer's hardware proxy"),
  32. 'product_categories_ids': fields.many2many('pos.category','printer_category_rel', 'printer_id','category_id',string='Printed Product Categories'),
  33. }
  34. _defaults = {
  35. 'name' : 'Printer',
  36. }
  37. class pos_config(osv.osv):
  38. _inherit = 'pos.config'
  39. _columns = {
  40. 'iface_splitbill': fields.boolean('Bill Splitting', help='Enables Bill Splitting in the Point of Sale'),
  41. 'iface_printbill': fields.boolean('Bill Printing', help='Allows to print the Bill before payment'),
  42. 'printer_ids': fields.many2many('restaurant.printer','pos_config_printer_rel', 'config_id','printer_id',string='Order Printers'),
  43. }
  44. _defaults = {
  45. 'iface_splitbill': False,
  46. 'iface_printbill': False,
  47. }