Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
2790 Vistas

Hi all,


I tried to install POS. First time I had an error while installing, but it somehow finished the install. Then the POS module couldn't be opened, because of some error pertaining to hr.employee.

Now I uninstalled the module, and I can't reinstall it at all.

I get the following error:

  File "/home/viktor/odoo/odoo/fields.py", line 866, in update_db_notnull
    model._init_column(self.name)
  File "/home/viktor/odoo/odoo/models.py", line 2523, in _init_column
    value = field.default(self)
  File "/home/viktor/odoo/addons/point_of_sale/models/pos_config.py", line 80, in _default_picking_type_id
    return self.env['stock.warehouse'].search([('company_id', '=', self.env.company.id)], limit=1).pos_type_id.id
  File "/home/viktor/odoo/odoo/fields.py", line 2483, in __get__
    return super().__get__(records, owner)
  File "/home/viktor/odoo/odoo/fields.py", line 996, in __get__
    recs._fetch_field(self)
  File "/home/viktor/odoo/odoo/models.py", line 3069, in _fetch_field
    self._read(fnames)
  File "/home/viktor/odoo/odoo/models.py", line 3136, in _read
    cr.execute(query_str, params + [sub_ids])
  File "", line 2, in execute
  File "/home/viktor/odoo/odoo/sql_db.py", line 101, in check
    return f(self, *args, **kwargs)
  File "/home/viktor/odoo/odoo/sql_db.py", line 298, in execute
    res = self._obj.execute(query, params)
Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/viktor/odoo/odoo/http.py", line 639, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/viktor/odoo/odoo/http.py", line 315, in _handle_exception
    raise exception.with_traceback(None) from new_cause
psycopg2.errors.UndefinedColumn: column stock_warehouse.pos_type_id does not exist
LINE 1: SELECT "stock_warehouse"."id" as "id", "stock_warehouse"."po...
                                               ^
HINT:  Perhaps you meant to reference the column "stock_warehouse.pbm_type_id".

So I gather it's trying to get the pos_type_id, but it doesn't exist in the database.
The pos_type_id is defined in the point_of_sale module, which I can't install however.

Any tip on how to solve this?

Avatar
Descartar
Autor Mejor respuesta

I can't comment yet, so I'll post here.

I tried restarting postgres, that didn't help, then defining the model did change something, but I got to the next error, which was alleviated by installing pos_hr (or hr_pos, can't remember). now it works again, thanks for your help.

Avatar
Descartar
Mejor respuesta

Hi Viktor,

Restart postgres server and then try to install the module.If error still remains,then define that field again in the 'stock.warehouse' model and try to install.

class Warehouse(models.Model):
_inherit = "stock.warehouse"

pos_type_id = fields.Many2one('stock.picking.type', string="Point of Sale Operation Type")

Hope it will help you.

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
3
may 19
2785
1
jul 25
1725
3
jul 25
1962
3
may 25
3421
4
jul 25
2933