Hello, I am created a module to automatically create a mrp production order, create a bill of materials for it if it still doesn't exists and the convert a product to another when I receive it. Everything was working fine, the module was deployed and it is working perfectly on production.
However, I am having problems trying to run the module on local after dumping the database.
The code that creates the bill of material for a given product_id is the following:
return bom_id
When I try to run it locally, I get the following error:
Erro:
Odoo Server Error
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/http.py", line 650, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 310, in _handle_exception
raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
File "/usr/lib/python3/dist-packages/odoo/tools/pycompat.py", line 87, in reraise
raise value
File "/usr/lib/python3/dist-packages/odoo/http.py", line 692, in dispatch
result = self._call_function(**self.params)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 342, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/service/model.py", line 97, in wrapper
return f(dbname, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 335, in checked_call
result = self.endpoint(*a, **kw)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 936, in __call__
return self.method(*args, **kw)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 515, in response_wrap
response = f(*args, **kw)
File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 938, in call_button
action = self._call_kw(model, method, args, {})
File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 926, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/usr/lib/python3/dist-packages/odoo/api.py", line 689, in call_kw
return call_kw_multi(method, model, args, kwargs)
File "/usr/lib/python3/dist-packages/odoo/api.py", line 680, in call_kw_multi
result = method(recs, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/addons/stock/wizard/stock_immediate_transfer.py", line 34, in process
pick_to_do.action_done()
File "/home/arthur/theVelopment/raizs/raizs/vtex_connector/models/connector_picking.py", line 70, in action_done
self.env['mrp.production'].transform_products(self)
File "/home/arthur/theVelopment/raizs/raizs/vtex_connector/models/raizs_mrp.py", line 103, in transform_products
self.transform_source_product(move_line_id.product_id, move_line_id.qty_done, lot_id = move_line_id.lot_id)
File "/home/arthur/theVelopment/raizs/raizs/vtex_connector/models/raizs_mrp.py", line 109, in transform_source_product
self.produce_product(transform_id, quantity_done, lot_id)
File "/home/arthur/theVelopment/raizs/raizs/vtex_connector/models/raizs_mrp.py", line 224, in produce_product
production_order = self.simulate_order(transformation_id.product_id, quantity_to_produce, lot_id)
File "/home/arthur/theVelopment/raizs/raizs/vtex_connector/models/raizs_mrp.py", line 176, in simulate_order
bom_id = self.env['mrp.bom'].get_product_bom(product_id)
File "/home/arthur/theVelopment/raizs/raizs/vtex_connector/models/raizs_mrp.py", line 65, in get_product_bom
bom_id = self.create_bom_for_product(product_id)
File "/home/arthur/theVelopment/raizs/raizs/vtex_connector/models/raizs_mrp.py", line 74, in create_bom_for_product
'product_qty': 1,
File "/usr/lib/python3/dist-packages/odoo/addons/mail/models/mail_thread.py", line 236, in create
thread = super(MailThread, self).create(values)
File "/usr/lib/python3/dist-packages/odoo/models.py", line 3372, in create
record = self.browse(self._create(old_vals))
File "/usr/lib/python3/dist-packages/odoo/models.py", line 3465, in _create
cr.execute(query, tuple(u[2] for u in updates if len(u) > 2))
File "/usr/lib/python3/dist-packages/odoo/sql_db.py", line 155, in wrapper
return f(self, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/sql_db.py", line 232, in execute
res = self._obj.execute(query, params)
psycopg2.ProgrammingError: relation "mrp_bom_id_seq" does not exist
LINE 1: ...uid", "create_date", "write_date") VALUES(nextval('mrp_bom_i...
Can anyone point out what I might be doing wrong?