classKkitSappl(models.Model):
_inherit = 'product.template'
_name = "kkit.sappl" _description = "Produit kit"
lu = fields.Char('LU')
send_number = fields.Char('Send No')
ckd_pnr = fields.Char('CKD-PNR')
ckd_modele = fields.Char('CKD Prod No')
comm_nos = fields.Char('Commission No')
lot_number = fields.Char('Lot No')
vin = fields.Char('Vehicule Ident Number')
Odoo Server Error
Traceback (most recent call last): File "/opt/odoo14/odoo/odoo/addons/base/models/ir_http.py", line 237, in _dispatch result = request.dispatch() File "/opt/odoo14/odoo/odoo/http.py", line 685, in dispatch result = self._call_function(**self.params) File "/opt/odoo14/odoo/odoo/http.py", line 361, in _call_function return checked_call(self.db, *args, **kwargs) File "/opt/odoo14/odoo/odoo/service/model.py", line 94, in wrapper return f(dbname, *args, **kwargs) File "/opt/odoo14/odoo/odoo/http.py", line 349, in checked_call result = self.endpoint(*a, **kw) File "/opt/odoo14/odoo/odoo/http.py", line 908, in __call__ return self.method(*args, **kw) File "/opt/odoo14/odoo/odoo/http.py", line 533, in response_wrap response = f(*args, **kw) File "/opt/odoo14/odoo/addons/web/controllers/main.py", line 1376, in call_button action = self._call_kw(model, method, args, kwargs) File "/opt/odoo14/odoo/addons/web/controllers/main.py", line 1364, in _call_kw return call_kw(request.env[model], method, args, kwargs) File "/opt/odoo14/odoo/odoo/api.py", line 399, in call_kw result = _call_kw_multi(method, model, args, kwargs) File "/opt/odoo14/odoo/odoo/api.py", line 386, in _call_kw_multi result = method(recs, *args, **kwargs) File "", line 2, in button_immediate_install File "/opt/odoo14/odoo/odoo/addons/base/models/ir_module.py", line 74, in check_and_log return method(self, *args, **kwargs) File "/opt/odoo14/odoo/odoo/addons/base/models/ir_module.py", line 478, in button_immediate_install return self._button_immediate_function(type(self).button_install) File "/opt/odoo14/odoo/odoo/addons/base/models/ir_module.py", line 596, in _button_immediate_function modules.registry.Registry.new(self._cr.dbname, update_module=True) File "/opt/odoo14/odoo/odoo/modules/registry.py", line 89, in new odoo.modules.load_modules(registry._db, force_demo, status, update_module) File "/opt/odoo14/odoo/odoo/modules/loading.py", line 459, in load_modules processed_modules += load_marked_modules(cr, graph, File "/opt/odoo14/odoo/odoo/modules/loading.py", line 347, in load_marked_modules loaded, processed = load_module_graph( File "/opt/odoo14/odoo/odoo/modules/loading.py", line 198, in load_module_graph registry.setup_models(cr) File "/opt/odoo14/odoo/odoo/modules/registry.py", line 276, in setup_models model._setup_fields() File "/opt/odoo14/odoo/odoo/models.py", line 2845, in _setup_fields field.setup_full(self) File "/opt/odoo14/odoo/odoo/fields.py", line 399, in setup_full self._setup_regular_full(model) File "/opt/odoo14/odoo/odoo/fields.py", line 3475, in _setup_regular_full raise TypeError(msg % (self, field)) Exception The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/opt/odoo14/odoo/odoo/http.py", line 641, in _handle_exception return super(JsonRequest, self)._handle_exception(exception) File "/opt/odoo14/odoo/odoo/http.py", line 317, in _handle_exception raise exception.with_traceback(None) from new_cause TypeError: Many2many fields kkit.sappl.taxes_id and product.template.taxes_id use the same table and columns
I want to create another model which inherit from product.template somme information to manage our product with custom fields.
So i don't undestant how to create anoter model with taxes_id with a new relational table name for the many2many field.
Can you please give me more details
Thanks a lot
see the updated answer
taxes_id = fields.Many2many('account.tax', 'kkit_sappl_taxes_rel', 'prod_id', 'tax_id', help="Default taxes used when selling the product.", string='Customer Taxes',
domain=[('type_tax_use', '=', 'sale')], default=lambda self: self.env.company.account_sale_tax_id)
Hi,
thank you a lot for your response, after i used the definition given in my model i had another msg error.
Thanks in advance
see the changes i have done for taxed_id field and similarly apply for new fields
Hi all
Unfortunately i still have the same error message when applying the requested changes.
did you redefine the supplier_taxes_id field in your model ?