Skip to content
Extraits de code Groupes Projets
Sélectionner une révision Git
  • f9b32668bf76c2d984f285b39ae02ab36f0b3dc1
  • 14.0 par défaut protégée
  • 14.0-ahp12 protégée
  • 14.0-double-paillage protégée
  • 14.0-accessory protégée
5 résultats

product_template.py

Blame
  • product_template.py 1,75 Kio
    # -*- coding: utf-8 -*-
    # Part of Odoo. See LICENSE file for full copyright and licensing details.
    
    import itertools
    import logging
    from collections import defaultdict
    
    from odoo import api, fields, models, tools, _, SUPERUSER_ID
    from odoo.exceptions import ValidationError, RedirectWarning, UserError
    from odoo.osv import expression
    
    _logger = logging.getLogger(__name__)
    
    
    class ProductTemplate(models.Model):
        _inherit = "product.template"
    
        # ------------------------------------------------------
        # Fields declaration
        # ------------------------------------------------------
        nb_accesories = fields.Float("Nombre d'accéssoires")
        accessory_label = fields.Char(
            related="categ_id.accessory_label", readonly=True
        )
    
        # ------------------------------------------------------
        # SQL Constraints
        # ------------------------------------------------------
    
        # ------------------------------------------------------
        # Default methods
        # ------------------------------------------------------
    
        # ------------------------------------------------------
        # Computed fields / Search Fields
        # ------------------------------------------------------
    
        # ------------------------------------------------------
        # Onchange / Constraints
        # ------------------------------------------------------
    
        # ------------------------------------------------------
        # CRUD methods (ORM overrides)
        # ------------------------------------------------------
    
        # ------------------------------------------------------
        # Actions
        # ------------------------------------------------------
    
        # ------------------------------------------------------
        # Business methods
        # ------------------------------------------------------