product.py 2.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. # -*- encoding: utf-8 -*-
  2. ###############################################################################
  3. # #
  4. # product_brand for Odoo #
  5. # Copyright (C) 2009 NetAndCo (<http://www.netandco.net>). #
  6. # Copyright (C) 2011 Akretion Benoît Guillot <benoit.guillot@akretion.com> #
  7. # Copyright (C) 2014 prisnet.ch Seraphine Lantible <s.lantible@gmail.com> #
  8. # Copyright (C) 2015 Leonardo Donelli #
  9. # Contributors #
  10. # Mathieu Lemercier, mathieu@netandco.net #
  11. # Franck Bret, franck@netandco.net #
  12. # Seraphine Lantible, s.lantible@gmail.com, http://www.prisnet.ch #
  13. # Leonardo Donelli, donelli@webmonks.it, http://www.wearemonk.com #
  14. # #
  15. # This program is free software: you can redistribute it and/or modify #
  16. # it under the terms of the GNU Affero General Public License as #
  17. # published by the Free Software Foundation, either version 3 of the #
  18. # License, or (at your option) any later version. #
  19. # #
  20. # This program is distributed in the hope that it will be useful, #
  21. # but WITHOUT ANY WARRANTY; without even the implied warranty of #
  22. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
  23. # GNU Affero General Public License for more details. #
  24. # #
  25. # You should have received a copy of the GNU Affero General Public License #
  26. # along with this program. If not, see <http://www.gnu.org/licenses/>. #
  27. # #
  28. ###############################################################################
  29. from openerp.osv import fields, osv
  30. class product_template(osv.osv):
  31. _inherit = 'product.template'
  32. _columns = {
  33. 'default_code': fields.related('product_variant_ids', 'default_code', type='char', string='Internal Reference', store=True),
  34. }