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.

23 lines
616 B

  1. # Copyright 2019 Camptocamp SA
  2. # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)
  3. from odoo import fields
  4. class Many2manyCustom(fields.Many2many):
  5. """ Many2manyCustom field is intended to customize Many2many properties.
  6. :param create_table: defines if the relational table must be created
  7. at the initialization of the field (boolean)
  8. """
  9. _slots = {
  10. 'create_table': True
  11. }
  12. def update_db(self, model, columns):
  13. if not self.create_table:
  14. return
  15. return super().update_db(model, columns)
  16. fields.Many2manyCustom = Many2manyCustom