You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
619 B

  1. # Copyright (C) 2020 - Today: GRAP (http://www.grap.coop)
  2. # @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  4. from odoo import api, fields, models
  5. class ProductTemplate(models.Model):
  6. _inherit = 'product.template'
  7. meal_voucher_ok = fields.Boolean(
  8. string="Meal Voucher",
  9. help="Check this box if the product can be paid with meal vouchers."
  10. )
  11. @api.onchange("categ_id")
  12. def onchange_categ_id(self):
  13. for template in self:
  14. template.meal_voucher_ok = template.categ_id.meal_voucher_ok