Skip to Content
Menu

Sync From MSSQL/MS SQL SERVER

by
Odoo

32.01

v 17.0 Third Party 14
Availability
Odoo Online
Odoo.sh
On Premise
Lines of code 481
Technical Name sync_from_mssql
LicenseOPL-1
Versions 16.0 17.0
You bought this module and need support? Click here!
Availability
Odoo Online
Odoo.sh
On Premise
Lines of code 481
Technical Name sync_from_mssql
LicenseOPL-1
Versions 16.0 17.0

Sync From MSSQL

Connect to MS SQL Server and sync data into Odoo Model (Field to Field)

build relation

build the many2one relation between parent and child models based on the relation of the source data.

Schedule Sync

Arbitrarily set the timing(month,weeks,days,hours,minutes) to execute synchronization

Installation

pip install pyodbc
install this module
configure in Settings > Technical > Database Structure > Sync from mssql

Odoo Proprietary License v1.0

This software and associated files (the "Software") may only be used (executed,
modified, executed after modifications) if you have purchased a valid license
from the authors, typically via Odoo Apps, or if you have received a written
agreement from the authors of the Software (see the COPYRIGHT file).

You may develop Odoo modules that use the Software as a library (typically
by depending on it, importing it and using its resources), but without copying
any source code or material from the Software. You may distribute those
modules under the license of your choice, provided that this license is
compatible with the terms of the Odoo Proprietary License (For example:
LGPL, MIT, or proprietary licenses similar to this one).

It is forbidden to publish, distribute, sublicense, or sell copies of the Software
or modified copies of the Software.

The above copyright notice and this permission notice must be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author or have a question related to your purchase, please use the support page.
There are no ratings yet!
Does this module work on Odoo.sh?
by
Damian Ratuś
on 4/12/25, 4:23 PM



Some issue
by
Luis Contreras
on 9/7/24, 5:43 PM Confirmed Purchase

Hi, 

I connect to SQL Server without any issue, but after mapping all fields, and trying to run manually, I get the following error

Traceback (most recent call last):
  File "/opt/odoo/odoo/odoo/http.py", line 1764, in _serve_db
    return service_model.retrying(self._serve_ir_http, self.env)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/odoo/odoo/odoo/service/model.py", line 133, in retrying
    result = func()
             ^^^^^^
  File "/opt/odoo/odoo/odoo/http.py", line 1791, in _serve_ir_http
    response = self.dispatcher.dispatch(rule.endpoint, args)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/odoo/odoo/odoo/http.py", line 1995, in dispatch
    result = self.request.registry['ir.http']._dispatch(endpoint)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/odoo/odoo/addons/website/models/ir_http.py", line 235, in _dispatch
    response = super()._dispatch(endpoint)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/odoo/odoo/odoo/addons/base/models/ir_http.py", line 222, in _dispatch
    result = endpoint(**request.params)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/odoo/odoo/odoo/http.py", line 741, in route_wrapper
    result = endpoint(self, *args, **params_ok)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/odoo/odoo/addons/web/controllers/dataset.py", line 28, in call_button
    action = self._call_kw(model, method, args, kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/odoo/odoo/addons/web/controllers/dataset.py", line 20, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/odoo/odoo/odoo/api.py", line 468, in call_kw
    result = _call_kw_multi(method, model, args, kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/odoo/odoo/odoo/api.py", line 453, in _call_kw_multi
    result = method(recs, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/odoo/addons/sync_from_mssql/models/db_sync.py", line 361, in process_sync
    sync_to_model(table,rowset)
  File "/opt/odoo/addons/sync_from_mssql/models/db_sync.py", line 306, in sync_to_model
    tmpmodel.create(values)
  File "", line 2, in create
  File "/opt/odoo/odoo/odoo/api.py", line 414, in _model_create_multi
    return create(self, [arg])
           ^^^^^^^^^^^^^^^^^^^
  File "/opt/odoo/odoo/addons/hr_recruitment/models/hr_employee.py", line 14, in create
    employees = super().create(vals_list)
                ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "", line 2, in create
  File "/opt/odoo/odoo/odoo/api.py", line 415, in _model_create_multi
    return create(self, arg)
           ^^^^^^^^^^^^^^^^^
  File "/opt/odoo/addons/sh_hr_extension/models/hr_employee_inherit.py", line 99, in create
    self.concatenate_fullname_create(rec)
  File "/opt/odoo/addons/sh_hr_extension/models/hr_employee_inherit.py", line 120, in concatenate_fullname_create
    return super().write(vals)
           ^^^^^^^^^^^^^^^^^^^
  File "/opt/odoo/odoo/addons/hr_skills/models/hr_employee.py", line 38, in write
    res = super().write(vals)
          ^^^^^^^^^^^^^^^^^^^
  File "/opt/odoo/odoo/addons/hr_fleet/models/employee.py", line 64, in write
    res = super().write(vals)
          ^^^^^^^^^^^^^^^^^^^
  File "/opt/odoo/odoo/addons/hr_contract/models/hr_employee.py", line 229, in write
    res = super().write(vals)
          ^^^^^^^^^^^^^^^^^^^
  File "/opt/odoo/odoo/addons/hr_attendance/models/hr_employee.py", line 74, in write
    res = super(HrEmployee, self).write(values)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/odoo/odoo/addons/hr/models/hr_employee.py", line 447, in write
    self.env['discuss.channel'].sudo().search([
  File "/opt/odoo/odoo/odoo/models.py", line 1614, in search
    return self.search_fetch(domain, [], offset=offset, limit=limit, order=order)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/odoo/odoo/odoo/models.py", line 1637, in search_fetch
    query = self._search(domain, offset=offset, limit=limit, order=order or self._order)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/odoo/odoo/odoo/models.py", line 5412, in _search
    query = self._where_calc(domain)
            ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/odoo/odoo/odoo/models.py", line 5123, in _where_calc
    return expression.expression(domain, self).query
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/odoo/odoo/odoo/osv/expression.py", line 794, in __init__
    self.parse()
  File "/opt/odoo/odoo/odoo/osv/expression.py", line 1269, in parse
    ids2 = comodel._name_search(right, domain or [], op2)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/odoo/odoo/odoo/models.py", line 1762, in _name_search
    return self._search(domain, limit=limit, order=order)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/odoo/odoo/odoo/models.py", line 5412, in _search
    query = self._where_calc(domain)
            ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/odoo/odoo/odoo/models.py", line 5123, in _where_calc
    return expression.expression(domain, self).query
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/odoo/odoo/odoo/osv/expression.py", line 794, in __init__
    self.parse()
  File "/opt/odoo/odoo/odoo/osv/expression.py", line 1464, in parse
    push_result(self.__leaf_to_sql(leaf, model, alias))
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/odoo/odoo/odoo/osv/expression.py", line 1551, in __leaf_to_sql
    raise ValueError(f"Invalid domain term {leaf!r}")
ValueError: Invalid domain term ('complete_name', 'in', 'HR')

The above server error caused the following client error:
RPC_ERROR: Odoo Server Error
    RPC_ERROR
        at makeErrorFromResponse (http://192.168.1.190:8069/web/assets/fcd5ab9/web.assets_web.min.js:2886:163)
        at XMLHttpRequest. (http://192.168.1.190:8069/web/assets/fcd5ab9/web.assets_web.min.js:2890:13)
Re: Some issue
by
林生
on 9/11/24, 3:59 AM Author

this error is raise  from your addon hr module ,please check below

File "/opt/odoo/odoo/addons/hr/models/hr_employee.py", line 447, in write
    self.env['discuss.channel'].sudo().search([