product.py 507 B

123456789101112131415
  1. # -*- coding: utf-8 -*-
  2. # Part of Odoo. See LICENSE file for full copyright and licensing details.
  3. from odoo import models
  4. from odoo.tools import populate
  5. class ProductProduct(models.Model):
  6. _inherit = "product.product"
  7. def _populate_get_product_factories(self):
  8. """Populate the invoice_policy of product.product & product.template models."""
  9. return super()._populate_get_product_factories() + [
  10. ("invoice_policy", populate.randomize(['order', 'delivery'], [5, 5]))]