sale_product.py 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # -*- coding: utf-8 -*-
  2. ##############################################################################
  3. #
  4. # OpenERP, Open Source Management Solution
  5. # Copyright (C) 2012-Today Serpent Consulting Services Pvt. Ltd.
  6. # (<http://www.serpentcs.com>)
  7. #
  8. # This program is free software: you can redistribute it and/or modify
  9. # it under the terms of the GNU General Public License as published by
  10. # the Free Software Foundation, either version 3 of the License, or
  11. # (at your option) any later version.
  12. #
  13. # This program is distributed in the hope that it will be useful,
  14. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. # GNU General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU General Public License
  19. # along with this program. If not, see <http://www.gnu.org/licenses/>
  20. #
  21. ##############################################################################
  22. from openerp import models, fields
  23. class sale_order(models.Model):
  24. _inherit = 'sale.order'
  25. print_image = fields.Boolean('Print Image', help="""If ticked, you can see
  26. the product image in report of sale order/quotation""")
  27. image_sizes = fields.Selection([('image', 'Big sized Image'),
  28. ('image_medium', 'Medium Sized Image'),
  29. ('image_small', 'Small Sized Image')],
  30. 'Image Sizes',
  31. default="image_small",
  32. help="Image size to be displayed in report")
  33. class sale_order_line(models.Model):
  34. _inherit = 'sale.order.line'
  35. image_medium = fields.Binary('Product Image',
  36. related='product_id.image_medium')