Files
enterprise/documents_product/models/product_template.py
T
2024-04-28 11:43:49 +08:00

22 lines
685 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import models
class ProductTemplate(models.Model):
_name = 'product.template'
_inherit = ['product.template', 'documents.mixin']
def _get_document_tags(self):
company = self.company_id or self.env.company
return company.product_tags
def _get_document_folder(self):
company = self.company_id or self.env.company
return company.product_folder
def _check_create_documents(self):
company = self.company_id or self.env.company
return company.documents_product_settings and super()._check_create_documents()