Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REF] manifest-version-format: Add valid odoo v15.0 #353

Merged
merged 1 commit into from Oct 4, 2021

Conversation

moylop260
Copy link
Collaborator

No description provided.

@moylop260 moylop260 self-assigned this Oct 4, 2021
@moylop260 moylop260 merged commit 4d4f254 into OCA:master Oct 4, 2021
@moylop260 moylop260 deleted the master-odoo-v14-moy branch October 4, 2021 17:55
moylop260 added a commit to Vauxoo/pylint-odoo that referenced this pull request Oct 4, 2021
* [REF] invalid-name, unused-argument: Suppress check for migrations path (OCA#348)

The following path:
 - module/x.y.z/migrations/pre-migration.py
has a few false negatives

Considering that standard method is:
    def migrate(cr, version):

- invalid-name (C0103) for module and argument name
  - e.g. "pre-migration.py" instead of pre_migration.py
  - e.g. "cr" for cursor

- unused-argument (W0613) for argument
  - e.g. "version" for version of Odoo

They are valid since that Odoo has already defined as it

So supressing from augmentations

Fix OCA#338

* [ADD] context-overridden: Better using kwargs instead of dictionary (OCA#256)

More info about see docstring of the method:
  - https://github.com/odoo/odoo/blob/ff3064258a320e4008b3fb52a149e6751ae1e7f5/odoo/models.py#L5086-L5105

Using
  - `self.with_context({'key': 'value'})`

The original context is overridden

It should be:
  - `self.with_context(**{'key': 'value'})`
  - `self.with_context(key='value')`

If you need to override the full context only silent this check using:
  - `self.with_context({'key': 'value'})  # pylint: disable=context-overridden`
In order to allow an explicit overridden

* [ADD] dangerous-qweb-replace-wo-priority: Consider qweb view templates (OCA#347)

More info about:
 - https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#inherited-xml

Fix OCA#323

* [REF] README: Auto-update Using pylint_odoo.messages2rst()

* [REF] requirements: Upgrade pylint version (OCA#349)

Add compatibility for pylint between 2.6 and 2.9

The method `_is_in_ignore_list_re` changed for each version

* [FIX] sql-injection: AttributeError: 'NoneType' object has no attribute 'parent' (OCA#350)

Using the following code:

    queries = [
        "SELECT id FROM res_partner",
        "SELECT id FROM res_users",
    ]
    for query in queries:
        self.env.cr.execute(query)

The check sql-injection shows the following error:
 - AttributeError: 'NoneType' object has no attribute 'parent'

So, Now it is validating if it is not None

* [REF] sql-injection: No sql-injection using constants (OCA#351)

The following examples should not be considered as sql-injection:

    self.env.cr.execute("SELECT * FROM %s" % 'table_constant')
    self.env.cr.execute("SELECT * FROM {}".format('table_constant'))
    self.env.cr.execute("SELECT * FROM %(table_variable)s" % {'table_variable': 'table_constant'})

Since that the constant is not possible to inject

* [FIX] sql-injection: AttributeError: 'NoneType' object has no attribute 'parent'

Using the following code:

    queries = [
        "SELECT id FROM res_partner",
        "SELECT id FROM res_users",
    ]
    for query in queries:
        self.env.cr.execute(query)

The check sql-injection shows the following error:
 - AttributeError: 'NoneType' object has no attribute 'parent'

So, Now it is validating if it is not None

* [FIX] sql-injection: Fix false positive using BinOp "+"

Considering the following valid case:

    cr.execute('SELECT ' + operator + ' FROM table' + 'WHERE')

The representation tree is:

    node.repr_tree()
    BinOp(
    op='+',
    left=BinOp(
        op='+',
        left=BinOp(
            op='+',
            left=Const(value='SELECT '),
            right=Name(name='operator')),
        right=Const(value=' FROM table')),
    right=Const(value='WHERE'))

Notice that left node is another BinOp node
So, it need to be considered recursively

* [REF] manifest-version-format: Add new valid odoo v15.0 (OCA#353)

* [REF] requirements: Upgrade pylint version 2.11.1 (OCA#354)

* [REF] .travis.yml: Fix syntax error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant