Error on installing sales module

I get Error when I try to install the sales module:

This sounds an error when creating the “Sales” group which is created by default by the sale module.

The name of the name of the group must be unique on the system so probably this is caused because you already have a group named “Sales” on the database and this triggers the error.

Thats all I can guess with your given information. In case that does not solve the problem please click the Details button on your error and paste the content of the error details here so we can know a little bit more about your problem. It will be great to also let us know which version of the modules are you using.

Please copy paste the detail.

Always prefer copy/paste of text over screenshot because it can be indexed and it is accessible.

Thanks. Here are the details:

Traceback (most recent call last):
  File "usrlocallibpython3.11dist-packagestrytondmodelmodelsql.py", line 907, in db_insert
    cursor.execute(\*table.insert(
  File "usrlocallibpython3.11dist-packagestrytondbackendpostgresqldatabase.py", line 78, in execute
    cursor.execute(self, sql, args)
psycopg2.errors.UniqueViolation: duplicate key value violates unique constraint "res_group_name_uniq"
DETAIL:  Key (name)=(Sales) already exists.


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

Traceback (most recent call last):
  File "usrlocallibpython3.11dist-packagestrytondconvert.py", line 414, in parse_xmlstream
    self.sax_parser.parse(source)
  File "usrlibpython3.11xmlsaxexpatreader.py", line 111, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "usrlibpython3.11xmlsaxxmlreader.py", line 125, in parse
    self.feed(buffer)
  File "usrlibpython3.11xmlsaxexpatreader.py", line 217, in feed
    self.\_parser.Parse(data, isFinal)
  File "..Modulespyexpat.c", line 468, in EndElement
  File "usrlibpython3.11xmlsaxexpatreader.py", line 336, in end_element
    self.\_cont_handler.endElement(name)
  File "usrlocallibpython3.11dist-packagestrytondconvert.py", line 468, in endElement
    self.taghandler = self.taghandler.endElement(name)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "usrlocallibpython3.11dist-packagestrytondconvert.py", line 318, in endElement
    self.mh.import_record(
  File "usrlocallibpython3.11dist-packagestrytondconvert.py", line 556, in import_record
    self.create_records(model, \[values\], \[fs_id\])
  File "usrlocallibpython3.11dist-packagestrytondconvert.py", line 560, in create_records
    records = Model.create(vlist)
              ^^^^^^^^^^^^^^^^^^^
  File "usrlocallibpython3.11dist-packagestrytondmodelmodelsql.py", line 277, in wrapper
    return func(cls, \*args, \*\*kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "usrlocallibpython3.11dist-packagestrytondmodelmodelsql.py", line 998, in create
    new_ids.extend(db_insert(
  File "usrlocallibpython3.11dist-packagestrytondmodelmodelsql.py", line 934, in db_insert
    raise_func(
  File "usrlocallibpython3.11dist-packagestrytondtransaction.py", line 63, in wrapper
    return func(\*args, \*\*kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "usrlocallibpython3.11dist-packagestrytondmodelmodelsql.py", line 615, in \__raise_integrity_error
    raise SQLConstraintError(gettext(error)) from exception
trytond.model.modelsql.SQLConstraintError: The name of the group must be unique! - 

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

Traceback (most recent call last):
  File "usrlocallibpython3.11dist-packagestrytondwsgi.py", line 97, in dispatch_request
    return endpoint(request, \*\*request.view_args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "usrlocallibpython3.11dist-packagestrytondprotocolsdispatcher.py", line 44, in rpc
    return methods.get(request.rpc_method, \_dispatch)(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "usrlocallibpython3.11dist-packagestrytondwsgi.py", line 77, in wrapper
    return func(request, \*args, \*\*kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "usrlocallibpython3.11dist-packagestrytondprotocolswrappers.py", line 206, in wrapper
    result = func(request, pool, \*args, \*\*kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "usrlocallibpython3.11dist-packagestrytondprotocolsdispatcher.py", line 216, in \_dispatch
    result = rpc.result(meth(\*c_args, \*\*c_kwargs))
                        ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "usrlocallibpython3.11dist-packagestrytondwizardwizard.py", line 347, in execute
    result = wizard.\_execute(state_name)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "usrlocallibpython3.11dist-packagestrytondwizardwizard.py", line 387, in \_execute
    result = self.\_execute(transition())
                           ^^^^^^^^^^^^
  File "usrlocallibpython3.11dist-packagestrytondirmodule.py", line 488, in transition_upgrade
    pool.init(update=update, lang=lang)
  File "usrlocallibpython3.11dist-packagestrytondpool.py", line 143, in init
    restart = not load_modules(
                  ^^^^^^^^^^^^^
  File "usrlocallibpython3.11dist-packagestrytondmodules__init_\_.py", line 430, in load_modules
    \_load_modules(update)
  File "usrlocallibpython3.11dist-packagestrytondmodules__init_\_.py", line 395, in \_load_modules
    load_module_graph(graph, pool, update, lang, indexes)
  File "usrlocallibpython3.11dist-packagestrytondmodules__init_\_.py", line 238, in load_module_graph
    tryton_parser.parse_xmlstream(fp)
  File "usrlocallibpython3.11dist-packagestrytondconvert.py", line 416, in parse_xmlstream
    raise ParsingError("in %s" % self.current_state()) from e
trytond.convert.ParsingError: in record 'sale.group_sale'

It seems you have already a group named “Sales” in your setup (from a custom module or you created it manually).
So the sale module activation can not create its own “Sales” group because there is a unique constraint on the name.

But the sales does not show up in my menu, nor in the modules list as activated.

I’m talking about the “Sales” group.

But I am trying to install the Sales module. Shall I delete the group Sales from the groups then? And how?

I do not know from where it comes so I can not advise on it.
A possible solution is just to change the name.

Ok. Thanks for bearing with me. I am making a conscious transition from Odoo so getting a bit lost. but believe that this patience will pay out. My goal is to use gnuhealth for a Hospital Management, but I need to get my head around Tryton first. Could you recommend a step by step instruction for setting up a complete Tryton system. I found one German one from the Tryton Buch Tryton-Buch: Grundlagen - Tryton DACH - das OpenSource-ERP-System auf deutsch and tried to search youtube also but the information is very scant.

Changed the name and worked. Thanks.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.