Code Monkey home page Code Monkey logo

server-backend's Introduction

Runboat Pre-commit Status Build Status codecov Translation Status

server-backend

TODO: add repo description.

Available addons

addon version maintainers summary
base_external_dbsource 14.0.1.0.2 External Database Sources
base_global_discount 14.0.1.0.1 Base Global Discount
base_import_match 14.0.1.0.2 Try to avoid duplicates before importing
base_user_role 14.0.2.5.3 sebalix jcdrubay novawish User roles
base_user_role_company 14.0.2.0.2 User roles by company
base_user_role_profile 14.0.1.1.0 User profiles
server_action_navigate 14.0.1.0.2 legalsylvain ashishhirpara Navigate between any items of any Odoo Models

Licenses

This repository is licensed under AGPL-3.0.

However, each module can have a totally different license, as long as they adhere to Odoo Community Association (OCA) policy. Consult each module's __manifest__.py file, which contains a license key that explains its license.


OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

server-backend's People

Contributors

alan196 avatar bilbonet avatar chienandalu avatar douglascstd avatar dreispt avatar ernestotejeda avatar flotho avatar francesco-ooops avatar guillemcforgeflow avatar ivorra78 avatar jdidderen-noviat avatar jesusramoneda avatar kevinkhao avatar minhdc avatar mymage avatar oca-git-bot avatar oca-transbot avatar oca-travis avatar pedrocasi avatar rad0van avatar sbidoul avatar sebalix avatar sebastienbeau avatar sergio-teruel avatar silvioc2c avatar sysadminmatmoz avatar victoralmau avatar weblate avatar yajo avatar ypapouin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

server-backend's Issues

[RFO] New massive translation terms module

Hi,

We have developed a new module that allows to:

Do you find it interesting enough for the OCA?

Thank you

[11.0] base_dav incompatible with Radicale 3.0.0 and up

It seems the Python package Radicale which is used by base_dav version 3.0.0 introduces breaking changes making it incompatible with the base_dav. Would be good to indicate this/pin Radicale version or make base_dav compatible with version 3.0.0. Also see Radicale changelog here: https://github.com/Kozea/Radicale/blob/3.0.0/NEWS.md

Errors I was getting:

  File "/../server-backend/base_dav/radicale/auth.py", line 12, in <module>
    class Auth(BaseAuth):
TypeError: NoneType takes no arguments

and

File "/../server-backend/base_dav/radicale/collection.py", line 26, in <module>
    class FileItem(Item):
TypeError: NoneType takes no arguments

[16.0] base_portal_type: indicator for portal groups as a field/flag on res.groups instead of category_id

Hi,
(I am fully aware that the module base_portal_type has only been commited a few days ago and is in alpha.)

Did you consider making the indicator whether a security group is an option for portal users as a boolean flag on the res.groups model?
At the moment - as far as I understand the description and the code - groups need to be put into the special category.
In earlier versions of Odoo there was a field "is_portal" on res.groups, which was used for displaying the groups in the "grant portal access" wizard on res.partner. Something similar could be applied.

Generally speaking, I am very much willing to help developing this module - if there are any open issues.
We are currently in the process of migrating our Odoo environment with target version 16 and I was very surprised noticing the feature disappear along the way to grant portal access on a more granular level - so we are basically required to either use this particular module or a implement solution inhouse.
I am not familiar with the exact process here on github (sorry!), but if you create an issue labeled "help wanted", I will try to contribute.

Migration to version 16.0

Todo

https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-16.0

Modules to migrate

Missing module? Check https://github.com/OCA/maintainer-tools/wiki/%5BFAQ%5D-Missing-modules-in-migration-issue-list

Role associated groups created

"base_user_role" version 12
When creating new role automatic creating group with same name. (Associated group)
In Role Screen, group tab is available, then why extra group(role name group) created while creating role?
If user deleted role, Associated group not deleted is still available in database.
Can we auto delete associated group or completed avoid to create associated group?

[Question] base_import_match prevent creation of new records?

I am importing large amount of records from various sources. Often I encounter situation where I would need only to update existing records and not create new ones (in case I made an error in import files or I missed something). Similarily, sometimes I am sure I want to only create new records, not update existing ones. Would it make sense to add such an option to base_import_match - i.e. Only update / Only create? Or can be this achieved in some other way? Thank you.

base_external_dbsource_mysql has useless dependencies

In base_external_dbsource_mysql module I see that mysqlclient should be installed and MySQLdb imported. However searching through the code base I couldn't find where MySQLdb is used. All the methods seems to use sqlalchemy functionality.
Am I right with this observation and the MySQLdb import is redundant?

[11.0] base_dav: error blocks "Update Apps List" function

If the base_dav directory exists, when loading Apps the server encounters an error that seems to block the "Update Apps List" function (i.e. none of the other apps in the app-group appear in the Apps list). The final message in the error:
class Auth(BaseAuth):
TypeError: NoneType takes no arguments

Steps to reproduce:

  1. Clone the server-backend repository.
  2. Add the directory to the list of addons in the odoo configuration file.
  3. Restart the server.
  4. Click the Update Apps List button.
  5. Clear the default "Apps" filter and notice that none of the server-backend apps appear in the list.

Full error:

`2021-06-11 11:42:07,548 1 ERROR ? werkzeug: Error on request:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/werkzeug/serving.py", line 205, in run_wsgi
execute(self.server.app)
File "/usr/lib/python3/dist-packages/werkzeug/serving.py", line 193, in execute
application_iter = app(environ, start_response)
File "/usr/lib/python3/dist-packages/odoo/service/server.py", line 348, in app
return self.app(e, s)
File "/usr/lib/python3/dist-packages/odoo/service/wsgi_server.py", line 180, in application
return application_unproxied(environ, start_response)
File "/usr/lib/python3/dist-packages/odoo/service/wsgi_server.py", line 154, in application_unproxied
result = handler(environ, start_response)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 1320, in call
self.load_addons()
File "/usr/lib/python3/dist-packages/odoo/http.py", line 1352, in load_addons
m = import('odoo.addons.' + module)
File "", line 969, in _find_and_load

File "", line 958, in _find_and_load_unlocked

File "", line 664, in _load_unlocked

File "", line 634, in _load_backward_compatible

File "/usr/lib/python3/dist-packages/odoo/modules/module.py", line 82, in load_module
exec(open(modfile, 'rb').read(), new_mod.dict)
File "", line 3, in

File "/mnt/extra-addons/server-backend/base_dav/models/init.py", line 3, in
from . import dav_collection
File "/mnt/extra-addons/server-backend/base_dav/models/dav_collection.py", line 16, in
from ..radicale.collection import Collection, FileItem, Item
File "/mnt/extra-addons/server-backend/base_dav/radicale/init.py", line 3, in
from . import auth
File "/mnt/extra-addons/server-backend/base_dav/radicale/auth.py", line 12, in
class Auth(BaseAuth):
TypeError: NoneType takes no arguments`

Migration to version 12.0

Todo

https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-12.0

Modules to migrate

[RFC] User Roles: default to Internal User when missing role for some companies

On a multicompany scenario, with 10 companies.
A user has access to the 10 companies, and we assign Roles for two of them.
In this case, the other 8 are still selectable, but no accessible in practice.

In this case, I believe that it would be reasonable to assume the Internal User role for the companies with no Role definition.

[13.0] base_user_role : Group default application is not set on role creation.

Impacted versions: 13.0
Module: base_user_role

Steps to reproduce:

  • Create a role from the role menu point, filling the name it will be given.

Current behavior:

  • When a role is created, no application is set on the user group, which has been created with the role and is linked to it.

Expected behavior:

  • On role creation, a user group must be created linked to the role, with the "User roles" category (XML ID: "base_user_role.ir_module_category_role") as application.

base_user_role is not in weblate

Probably due to missing .pot file. They were deleted by @sbidoul in 19ba7cf. I assume the purpose was to have the new makepot system generate a new .pot file

How can I trigger this .pot file generation?

Only 3 out of 6 addons in this repo has .pot files and are present in weblate

[13.0] base_user_role : updating implied_ids is not working

Impacted versions: 13.0

Steps to reproduce:

  • create role via XML and set implied_ids to base.group_erp_manager for example
  • update module so that the data gets created
  • go back to the XML and update the implied_ids (remove the old group and replace it with another) hr.group_hr_user

Current behavior:

  • updates of the implied_ids field from XML are not reflected in the user interface. the field implied_ids stays static and never changes even after changing the XML and updating the module.

Expected behavior:

  • updates of the implied_ids field from XML should be reflected in the user interface as well as the database.

Migration to version 13.0

Todo

https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-13.0

Modules to migrate

Missing module? Check https://github.com/OCA/maintainer-tools/wiki/%5BFAQ%5D-Missing-modules-in-migration-issue-list

[RFC] Simplify base_user_role to focus on the most standard use case (removing the enable/date features)

I have been using base_user_role on several projects since version 10. But over the time, I found that for most of projects, base_user_role was over-engineered, and it just became more and more complex. Then, due to this complexity, it seems more and more difficult to maintain and port to the latest version of Odoo.

For the time being, we (at Komit) decided to create and use a different module user_profile which adds a m2m field profile_ids with a widget many2many_tags in the form view. Basically, it behaves the same as base_user_role when only setting roles without dates, enable/disable, company on the roles of a user in a user form.

From @sebastienbeau (Akretion):

On our side we do not use the enable/date feature. And a simple m2m for most of the case will improve the UI.

Initially discussed in:

Please share your ideas on what you think should be done next?

Some ideas

  • [A] Split base_user_role into base_user_role and base_user_role_date.
  • [B] Add a simplified module (like user_profile), but it would compete with base_user_role resulting in a diluted focus from the community making base_user_role even harder to maintain.
  • [C] Don't change anything, because there isn't really a problem, it's OK to have a single module that will handle all of the needs.

Migration

In any case, we need to keep in mind that security is sensitive and that this module is being used in production, so robust migration scripts would be necessary if aiming for [A].

A discussion we need to keep extending

Also, more features are expected to be added/removed like the multi-company functionality: #108

One more possible evolution is to force the setting of a Role/Profile depending on a company setting.

In a module base_user_role_extra (non contributed module), we have added the display of the role list from the list of users:

class ResUsers(models.Model):
    _inherit = "res.users"

    roles_list = fields.Char(compute="_compute_roles_list", store=True)

    @api.depends("role_line_ids", "role_line_ids.role_id", "role_line_ids.role_id.name")
    def _compute_roles_list(self):
        for user in self:
            list_roles_name = ", ".join(user.role_line_ids.mapped("role_id.name"))
            user.roles_list = list_roles_name
    <record id="view_users_tree_inherit" model="ir.ui.view">
        <field name="name">res.users.tree.inherit</field>
        <field name="model">res.users</field>
        <field name="inherit_id" ref="base.view_users_tree" />
        <field name="arch" type="xml">
            <field name="name" position="after">
                <field name="roles_list" />
            </field>
        </field>
    </record>
    ```

base_dav dead?

Is your feature request related to a problem?
If so, please provide clear and concise description of what the problem is.

Is base_dav discontinued since 11.0?
https://github.com/OCA/server-backend/tree/11.0/base_dav

Describe the solution you'd like
A clear and concise description of what you want to happen.

WebDav sync of Calendars :)

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

not possible - switch away from odoo

Additional context
Add any other context about the feature request here.

[11.0] base_external_db_source_mysql execute raises error on insert/update/delete sentences

Impacted versions:
Branch 11.0

Steps to reproduce:
From any valid base.external.dbsource object with MySQL connector, try to execute an INSERT, UPDATE or DELETE SQL sentence

Current behavior:
The SQL sentence is correctly executed and changes made, but execute gets the following error:

Traceback (most recent call last):
  File "C:\Users\David\Solvos\Desarrollo\PycharmProjects\odoo-11-interfaceconta01\venv\lib\site-packages\sqlalchemy\engine\result.py", line 1066, in
_fetchone_impl
    return self.cursor.fetchone()
AttributeError: 'NoneType' object has no attribute 'fetchone'

and finally raises:

sqlalchemy.exc.ResourceClosedError: This result object does not return rows. It has been closed automatically.

Expected behavior:
If INSERT/UPDATE/DELETE sentences are allowed, thay are supposed to finish without raise any exception; otherwise those operations should be forbidden

base_user_role: create role from existing user

I created a module that extends base_user_role to add a wizard to create a new role based on an existing user.

image

It basically adds a wizard that permits to create a role that contains the same groups as the selected user.

image

I'd like to contribute it to OCA. I think it is pretty useful for people who start using base_user_role after having already created several users. So:

  • Would it be of interest to the community?
  • Would it be best to keep it as a separate module, or rather to include the wizard in base_user_role module? My personal preference would be to include it in the existing module, as it is very small.

I have a version for Odoo v8 and another for Odoo v16. There are no functional differences between them.

base_suspend_security: BaseSuspendSecurityUid.__iter__ method. Do we need it?

Hello!

Suspend Security wrapper currently has method __iter__, and that's why following expression evaluates to True: elif isinstance(right, collections.Iterable):. But later, following code tries to split that iterable by chunks, and raises error: TypeError: object of type 'BaseSuspendSecurityUid' has no len().

So, do we need to keep __iter__ method and also add __len__ (and possibly some other methods)? Or we do not need this wrapper to look like iterable, and we could safelly remove this __iter__ method?

[11.0] ERROR

When you install this module appears this error when you change the company into dashboard (invoicing module)

Lo siento, no tiene permiso para acceder a este documento. Sólo usuarios con los siguientes permisos están autorizados a hacer esto:

  • Administration/Access Rights

(Modelo de documento: res.users.role.line)

Only if you put the acces right into user.... it work but, if you dont want give him those acces rights?

[RFC][WIP] Mixin for declarative partitioning of tables (list and range type partitioning)

Hello,

With postgresql 11.0 out and partitioning support enhanced, we came up with the idea of creating a mixin that when inherited from will help programmers partition their models.

Here are the abstract initial requirements:
Give the user the possibility to partition their tables as shown in https://www.postgresql.org/docs/current/static/ddl-partitioning.html 5.10.2.

Abstract implementation:

  1. The models that want to make use of the partition need to inherit from base_table_partition_mixin and on the fields that will be used for partitioning need to use partition_by_range=$range or $list or callable that returns them

  2. When the module is installed updated the following will take place (or not if they have already been done)

    a) since we cannot partition an already existing table, create create an identical one with the same schema. (in order to not have conflicts with global constrains the table will be created in a new temporary database schema)

    b) based on the $range or $list and the already existing data, create as many partitions as necessary (create the index on this column as well)

    c) find all the foreign key constrains that point to my initial non partitioned table and change them to point to tableB which is partitioned.

    d) drop tableA, move tableB from temporary database schema to public database schema, drop temprory database schema.

  3. When it comes to maintenance we do not need to do something.

  4. Possibly revert the process when the module is uninstalled?

Pitfalls:
On versions < 10.0 on models.py the relkind is being used and restricted to 'r', 'v' table types while the partitioned tables have a type of 'p'. For > 10.0 the relkind is not used but for previous versions this needs to be patched.

Please add your comments below so that we can keep all the comments recorded.

cc @hbrunn @NL66278

Documentation BASE_DAV

Module

base_dav

Describe the bug

The field NAME of the event is not exported as SUMMARY as the ical defenition needs, but as NAME.

This leads to an empty description of the event.

To Reproduce

Affected versions:
ALL

Steps to reproduce the behavior:
My contribution so far:

  1. Installing
    Install the module and the radical python lib

  2. Rights
    Set the access and creation rights for your user (access_dav_collection, access_dav_collection_field_mapping)

  3. Create a webdav collection
    Add the following:
    DSTART --> START
    DTEND --> STOP
    DESCRIPTION --> ( I use the videocall_location)
    SUMMARY --> NAME

Expected behavior
A clear and concise description of what you expected to happen.
in the ical file, the NAME: should be SUMMARY:

I guess, you can do this with the in and out code, but I do not understand that: Need help!

Additional context
Add any other context about the problem here. (e.g. OS, Python version, ...)

[14.0][BUG] base_user_role: "Access rights" group is not enough to create/edit Roles

Module

base_user_role

Describe the bug

Even though Roles model is suppose to be editable with just "Access rights" Administrator group, it doesn't work.

To Reproduce

Affected versions: 14.0

Steps to reproduce the behavior:

  1. On Runboat create additional user admin2
  2. Add only "Access rights" (not "Settings"!) group for the admin2
  3. Login with the new user and try to create a Role

Expected behavior
admin2 should be able to create a Role but gets an error saying he can't access View objects.

Images of the bug reproduced in Runboat
image
image

https://github.com/OCA/server-backend/tree/14.0/base_user_role_profile - missing access line

Module

base_user_role_profile

Describe the bug

When installing the module, there are only 2 access lines with read access.
No access to create and modify profiles for group Administration / Configuration

To Reproduce

v14:

Steps to reproduce the behavior:

  1. Install Modules
  2. Connect as user with Administration / Configuration
  3. Try to create a new profil

Expected behavior
As a user with Administration/Configuration group, I should have access to creation, modification and reading.

Additional context
This access should make the use of this module more easy for odoo beginners.

[14.0] base_import_match: "Unable to use a closed cursor"?

I have not been able to pinpoint the cause, nor am 100% sure it is cased by base_import_match.

I've seen the "Unable to use a closed cursor" error show on databases with base_import_match installed.
It typically starts showing after several failed attempts to import a file, that had errors in it.
In particular, this was a product.product import, matching Internal Reference, to update some fields in products.

Sharing to gather more feedback, that might help pinpointing the root cause.

base_user_role_company doesn't work with multiple browser tabs

Hello,

On module base_urser_role_company

If several tabs are open on different companies, the role is not correctly assigned.

Steps to reproduce the behavior:

  1. Create a database with Company A and Company B,
  2. Create 2 roles : Role A and Role B
  3. Assign a user Role A to company A and Role B to company B
  4. open a first tab, select Company A the user has the Role A
  5. open a second tab, select company B
  6. Go back to first tab, the user has role B

Having looked at how the base_user_role module works, I can't really see a solution to fix this other than disabling multi-tabbing.
Perhaps we should put in the known issues that this problem exists unless someone has a solution!

Thanks for your comments on this issue.

[11.0] ERROR 2

When you try duplicate a record into res.users.role

Odoo Server Error - Error de validación
¡El nombre del grupo debe ser único en una aplicación!>

It possible write some like this?

``
@api.multi
def copy(self, default=None):
default = dict(default or {})
copied_count = self.search_count(
[('name', '=like', u"Copy of {}%".format(self.name))])
if not copied_count:
new_name = u"Copy of {}".format(self.name)
else:
new_name = u"Copy of {} ({})".format(self.name, copied_count)
default['name'] = new_name
return super(Course, self).copy(default)

``

[16.0] base_external_dbsource_mssql requirements break odoo core compatibily

Module

base_external_dbsource_mssql

sqlalchemy in requirements file

Describe the bug

the requirement cause incompatibilty issues with greenlet

/home/odoo_16/.local/lib/python3.9/site-packages (from -r /home/odoo_16/additionnal_repositories/OCA-server-backend/requirements.txt (line 3)) (2.0.15)\nRequirement already satisfied: typing-extensions>=4.2.0 in /home/odoo_16/.local/lib/python3.9/site-packages (from sqlalchemy->-r /home/odoo_16/additionnal_repositories/OCA-server-backend/requirements.txt (line 3)) (4.5.0)\nCollecting greenlet!=0.4.17 (from sqlalchemy->-r /home/odoo_16/additionnal_repositories/OCA-server-backend/requirements.txt (line 3))\n  **Downloading greenlet-2.0.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl** (610 kB)\n

when greenlet 2.0.2 is installed we have issues like this : gevent/gevent#1685

if I desinstall sqlalchemy and force the installation of the odoo requirements everything works fine

To Reproduce

install requirement on a v16 with python 3.9

Expected behavior

no issue while running Odoo

Additional context

rocky linux 9

base_import_match - TypeError: '<' not supported between instances of 'NoneType' and 'NoneType'

I get an error installing on Odoo12

Odoo Server Error Traceback (most recent call last): File "/odoo/odoo-server/odoo/http.py", line 656, in _handle_exception return super(JsonRequest, self)._handle_exception(exception) File "/odoo/odoo-server/odoo/http.py", line 314, in _handle_exception raise pycompat.reraise(type(exception), exception, sys.exc_info()[2]) File "/odoo/odoo-server/odoo/tools/pycompat.py", line 87, in reraise raise value File "/odoo/odoo-server/odoo/http.py", line 698, in dispatch result = self._call_function(**self.params) File "/odoo/odoo-server/odoo/http.py", line 346, in _call_function return checked_call(self.db, *args, **kwargs) File "/odoo/odoo-server/odoo/service/model.py", line 98, in wrapper return f(dbname, *args, **kwargs) File "/odoo/odoo-server/odoo/http.py", line 339, in checked_call result = self.endpoint(*a, **kw) File "/odoo/odoo-server/odoo/http.py", line 941, in __call__ return self.method(*args, **kw) File "/odoo/odoo-server/odoo/http.py", line 519, in response_wrap response = f(*args, **kw) File "/odoo/odoo-server/addons/web/controllers/main.py", line 967, in call_button action = self._call_kw(model, method, args, {}) File "/odoo/odoo-server/addons/web/controllers/main.py", line 955, in _call_kw return call_kw(request.env[model], method, args, kwargs) File "/odoo/odoo-server/odoo/api.py", line 759, in call_kw return _call_kw_multi(method, model, args, kwargs) File "/odoo/odoo-server/odoo/api.py", line 746, in _call_kw_multi result = method(recs, *args, **kwargs) File "<decorator-gen-61>", line 2, in button_immediate_install File "/odoo/odoo-server/odoo/addons/base/models/ir_module.py", line 74, in check_and_log return method(self, *args, **kwargs) File "/odoo/odoo-server/odoo/addons/base/models/ir_module.py", line 445, in button_immediate_install return self._button_immediate_function(type(self).button_install) File "/odoo/odoo-server/odoo/addons/base/models/ir_module.py", line 557, in _button_immediate_function function(self) File "<decorator-gen-60>", line 2, in button_install File "/odoo/odoo-server/odoo/addons/base/models/ir_module.py", line 74, in check_and_log return method(self, *args, **kwargs) File "/odoo/odoo-server/odoo/addons/base/models/ir_module.py", line 394, in button_install modules._state_update('to install', ['uninstalled']) File "/odoo/odoo-server/odoo/addons/base/models/ir_module.py", line 373, in _state_update module.write({'state': newstate, 'demo': module_demo}) File "/odoo/odoo-server/addons/website_theme_install/models/ir_module_module.py", line 94, in write return super(IrModuleModule, self).write(vals) File "/odoo/odoo-server/odoo/models.py", line 3399, in write self.recompute() File "/odoo/odoo-server/odoo/models.py", line 5312, in recompute field, recs = self.env.get_todo() File "/odoo/odoo-server/odoo/api.py", line 993, in get_todo field = min(self.all.todo, key=self.registry.field_sequence)

Migration to version 17.0

Todo

https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-17.0

Modules to migrate

  • base_external_dbsource - By @Anxo82 - #292
  • base_external_dbsource_mssql
  • base_external_dbsource_sqlite
  • base_external_system
  • base_global_discount - By @miguel-S73 - #275
  • base_import_match
  • base_portal_type
  • base_user_role - By @rven - #253
  • base_user_role_company
  • base_user_role_history

Missing module? Check https://github.com/OCA/maintainer-tools/wiki/%5BFAQ%5D-Missing-modules-in-migration-issue-list

[12.0][ERR] base_external_dbsource after migration from v11.0

In v11.0 there is a security rule that referenced the field 'company_id'.
The field 'company_id' doesn't exist in v12 but the rule persist after migration. The module gives this error:

raise ValueError("Invalid field %r in leaf %r" % (left, str(leaf)))
ValueError: Invalid field 'company_id' in leaf "<osv.ExtendedLeaf: ('company_id', '=', False) on base_external_dbsource (ctx: )>"

You have to delete the security rule manually and it's work well.

base_user_role resets Notification User preference

Module

base_user_role

Describe the bug

When a user's roles are altered,

To Reproduce

Affected versions: V17 at least, have not tried it in other versions

Steps to reproduce the behavior:

  1. A user changes their notification_type selection from 'Handle by Emails' (default) to 'Handle in Odoo'
  2. The user's roles list is modified (A role is added or removed)
  3. The user's notification_type has been set back to 'Handle by Emails'

Expected behavior
User's notification handling preferences shouldn't change, regardless of their roles

Additional context
Found this bug in my Odoo.sh instance. Version is 17.0+e (Enterprise Edition)
The bug was found in my productive (main) branch, and successfully replicated in a fresh dev database with only the base_user_role module installed

[14.0] base_import_match: Unable to use a closed cursor.

I'm consistently getting this error.
The first import works. If I repeat it a second time, I get this error.

2021-04-26 16:43:52,121 31401 INFO 14-vin-0412 odoo.addons.base_import.models.base_import: importing 2 rows...
2021-04-26 16:43:52,647 31401 INFO 14-vin-0412 odoo.addons.base_import.models.base_import: done
2021-04-26 16:44:03,921 31401 INFO 14-vin-0412 odoo.addons.base_import.models.base_import: importing 2 rows...
2021-04-26 16:44:04,061 31401 ERROR 14-vin-0412 odoo.http: Exception during JSON request handling.
Traceback (most recent call last):                                                                                                                                                                                                             File "/home/daniel/work14/bot/odoo-boti/odoo/odoo/addons/base/models/ir_http.py", line 237, in _dispatch                                                                                                                                       result = request.dispatch()                                                                                                                                                                                                                File "/home/daniel/work14/bot/odoo-boti/odoo/odoo/http.py", line 683, in dispatch
    result = self._call_function(**self.params)
  File "/home/daniel/work14/bot/odoo-boti/odoo/odoo/http.py", line 359, in _call_function                                                                                                                                                        return checked_call(self.db, *args, **kwargs)
  File "/home/daniel/work14/bot/odoo-boti/odoo/odoo/service/model.py", line 94, in wrapper                                                                                                                                                       return f(dbname, *args, **kwargs)
  File "/home/daniel/work14/bot/odoo-boti/odoo/odoo/http.py", line 347, in checked_call                                                                                                                                                          result = self.endpoint(*a, **kw)
  File "/home/daniel/work14/bot/odoo-boti/odoo/odoo/http.py", line 912, in __call__
    return self.method(*args, **kw)
  File "/home/daniel/work14/bot/odoo-boti/odoo/odoo/http.py", line 531, in response_wrap                                                                                                                                                         response = f(*args, **kw)
  File "/home/daniel/work14/vin/vinha-odoo/odoo/addons/web/controllers/main.py", line 1377, in call_kw                                                                                                                                           return self._call_kw(model, method, args, kwargs)
  File "/home/daniel/work14/vin/vinha-odoo/odoo/addons/web/controllers/main.py", line 1369, in _call_kw                                                                                                                                          return call_kw(request.env[model], method, args, kwargs)
  File "/home/daniel/work14/bot/odoo-boti/odoo/odoo/api.py", line 396, in call_kw
    result = _call_kw_multi(method, model, args, kwargs)
  File "/home/daniel/work14/bot/odoo-boti/odoo/odoo/api.py", line 383, in _call_kw_multi                                                                                                                                                         result = method(recs, *args, **kwargs)
  File "/home/daniel/work14/vin/vinha-odoo/src/enterprise/account_bank_statement_import_csv/wizard/account_bank_statement_import_csv.py", line 177, in do                                                                                        
  return super(AccountBankStmtImportCSV, self).do(fields, columns, options, dryrun=dryrun)                                                                                                                                                   File "/home/daniel/work14/vin/vinha-odoo/odoo/addons/base_import/models/base_import.py", line 928, in do                                                                                                                                       import_result = model.load(import_fields, data)
  File "/home/daniel/work14/vin/vinha-odoo/src/custom-addons/base_import_match/models/base.py", line 45, in load                                                                                                                                 match = self.env["base_import.match"]._match_find(self, record, row)
  File "/home/daniel/work14/vin/vinha-odoo/src/custom-addons/base_import_match/models/base_import.py", line 84, in _match_find                                                                                                                   
    for field in combination.field_ids:
  File "/home/daniel/work14/bot/odoo-boti/odoo/odoo/fields.py", line 3144, in __get__
    return super().__get__(records, owner)
  File "/home/daniel/work14/bot/odoo-boti/odoo/odoo/fields.py", line 2483, in __get__
    return super().__get__(records, owner)
  File "/home/daniel/work14/bot/odoo-boti/odoo/odoo/fields.py", line 996, in __get__
    recs._fetch_field(self)
  File "/home/daniel/work14/bot/odoo-boti/odoo/odoo/models.py", line 3069, in _fetch_field                                                                                                                                                       self._read(fnames)
  File "/home/daniel/work14/bot/odoo-boti/odoo/odoo/models.py", line 3164, in _read
    field.read(fetched)
  File "/home/daniel/work14/bot/odoo-boti/odoo/odoo/fields.py", line 3155, in read
    lines = comodel.search(domain, limit=self.limit)
  File "/home/daniel/work14/bot/odoo-boti/odoo/odoo/models.py", line 1709, in search
    return res if count else self.browse(res)
  File "/home/daniel/work14/bot/odoo-boti/odoo/odoo/models.py", line 4954, in browse
    if not ids:
  File "/home/daniel/work14/bot/odoo-boti/odoo/odoo/osv/query.py", line 156, in __bool__
    return bool(self._result)
  File "/home/daniel/work14/bot/odoo-boti/odoo/odoo/tools/func.py", line 26, in __get__
    value = self.fget(obj)
  File "/home/daniel/work14/bot/odoo-boti/odoo/odoo/osv/query.py", line 149, in _result
    self._cr.execute(query_str, params)
  File "<decorator-gen-3>", line 2, in execute
  File "/home/daniel/work14/bot/odoo-boti/odoo/odoo/sql_db.py", line 100, in check
    raise psycopg2.OperationalError('Unable to use a closed cursor.')
Exception

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

Traceback (most recent call last):
  File "/home/daniel/work14/bot/odoo-boti/odoo/odoo/http.py", line 639, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/home/daniel/work14/bot/odoo-boti/odoo/odoo/http.py", line 315, in _handle_exception
    raise exception.with_traceback(None) from new_cause
psycopg2.OperationalError: Unable to use a closed cursor.

Order by sql sentences

Hi, I'm using external_database_source, but when I execute a select with order by it seems its not working...

I use something like this:

rows, params = database.execute_mysql("select * from table where param1=%s order by field2 desc", [value,], "")

I get results but are not sorted... can someone help me?

Thanks!

server-backend don't show in transifex project list

I want to translate server-backend (bar user role) into Argentinean Spanish but the project does not appear in the list of transifex projects. I wrote a message to Pedro M. Baeza and he tells me to put a problem here.
Thank you.

Migration to version 15.0

Todo

https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-15.0

Modules to migrate

Missing module? Check https://github.com/OCA/maintainer-tools/wiki/%5BFAQ%5D-Missing-modules-in-migration-issue-list

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.