-
-
Notifications
You must be signed in to change notification settings - Fork 77
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
[11.0][FIX] github_connector keyerror 'blog' #34
Conversation
Description of the issue/feature this PR addresses: On new database error when syncing new github organization (example: OCA). Error traceback: KeyError: 'blog' Current behavior before PR: Synchronization gets blog key on `get_odoo_data_from_github` but blog field does not exist. When it tries to match the key with model attribute we get key error. Desired behavior after PR is merged: Get blog key from github data and show it on form view.
I don't know how you get to that, but what we should do is to restrict the list of |
Thanks for reporting but I tend to agree with @pedrobaeza otherwise, every time a new field appears in the framework sync we will have to update the code |
I just synced an organization (OCA) on a new database and the error happened. Anyway I made some research and I saw that in previous version of this addon, there was a mapping of field-key. Here In the migration this mapping has been replaced by a list of keys directly, except I see now that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a question
Please bump the version number
@enriquemartin I think the change was done because sometimes other keys are not present, so the previous iterative process seems OK for me, but you only have to add a mapping dictionary with the GH label and the field name, that it will be the same for all except the blog one. Another option is to add an if with that specific condition. |
@pedrobaeza what I see proper is to create a method on abstract model
|
Great, this seems a good idea. |
Only a pylint error:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. The Pylint error seems to predate this PR. I don't know what is the way to go in these cases.
Well, the error is there because you always must to call super in a inherit. |
Yes. I just meant that the error is not related to this pull request and I don't know if PRs are supposed to address previous errors :) |
@j-zaballa are you sure? The module is the same, and I would say is due to these changes. |
@pedrobaeza the error is on line 158 of github_connector/models/github.py file. |
Yes, please 🙏 |
@pedrobaeza Github class inherits from |
OK, I see, @moylop260 can we consider this as a bug in pylint-odoo? |
So the error is another, Moi? |
[FIX] github_connector: keyerror 'blog' Description of the issue/feature this PR addresses: On new database error when syncing new github organization (example: OCA). Error traceback: KeyError: 'blog' Current behavior before PR: Synchronization gets blog key on `get_odoo_data_from_github` but blog field does not exist. When it tries to match the key with model attribute we get key error. Desired behavior after PR is merged: Get blog key from github data and show it on form view.
[FIX] github_connector: keyerror 'blog' Description of the issue/feature this PR addresses: On new database error when syncing new github organization (example: OCA). Error traceback: KeyError: 'blog' Current behavior before PR: Synchronization gets blog key on `get_odoo_data_from_github` but blog field does not exist. When it tries to match the key with model attribute we get key error. Desired behavior after PR is merged: Get blog key from github data and show it on form view.
[FIX] github_connector: keyerror 'blog' Description of the issue/feature this PR addresses: On new database error when syncing new github organization (example: OCA). Error traceback: KeyError: 'blog' Current behavior before PR: Synchronization gets blog key on `get_odoo_data_from_github` but blog field does not exist. When it tries to match the key with model attribute we get key error. Desired behavior after PR is merged: Get blog key from github data and show it on form view.
[FIX] github_connector: keyerror 'blog' Description of the issue/feature this PR addresses: On new database error when syncing new github organization (example: OCA). Error traceback: KeyError: 'blog' Current behavior before PR: Synchronization gets blog key on `get_odoo_data_from_github` but blog field does not exist. When it tries to match the key with model attribute we get key error. Desired behavior after PR is merged: Get blog key from github data and show it on form view.
[FIX] github_connector: keyerror 'blog' Description of the issue/feature this PR addresses: On new database error when syncing new github organization (example: OCA). Error traceback: KeyError: 'blog' Current behavior before PR: Synchronization gets blog key on `get_odoo_data_from_github` but blog field does not exist. When it tries to match the key with model attribute we get key error. Desired behavior after PR is merged: Get blog key from github data and show it on form view.
[FIX] github_connector: keyerror 'blog' Description of the issue/feature this PR addresses: On new database error when syncing new github organization (example: OCA). Error traceback: KeyError: 'blog' Current behavior before PR: Synchronization gets blog key on `get_odoo_data_from_github` but blog field does not exist. When it tries to match the key with model attribute we get key error. Desired behavior after PR is merged: Get blog key from github data and show it on form view.
[FIX] github_connector: keyerror 'blog' Description of the issue/feature this PR addresses: On new database error when syncing new github organization (example: OCA). Error traceback: KeyError: 'blog' Current behavior before PR: Synchronization gets blog key on `get_odoo_data_from_github` but blog field does not exist. When it tries to match the key with model attribute we get key error. Desired behavior after PR is merged: Get blog key from github data and show it on form view.
[FIX] github_connector: keyerror 'blog' Description of the issue/feature this PR addresses: On new database error when syncing new github organization (example: OCA). Error traceback: KeyError: 'blog' Current behavior before PR: Synchronization gets blog key on `get_odoo_data_from_github` but blog field does not exist. When it tries to match the key with model attribute we get key error. Desired behavior after PR is merged: Get blog key from github data and show it on form view.
[FIX] github_connector: keyerror 'blog' Description of the issue/feature this PR addresses: On new database error when syncing new github organization (example: OCA). Error traceback: KeyError: 'blog' Current behavior before PR: Synchronization gets blog key on `get_odoo_data_from_github` but blog field does not exist. When it tries to match the key with model attribute we get key error. Desired behavior after PR is merged: Get blog key from github data and show it on form view.
[FIX] github_connector: keyerror 'blog' Description of the issue/feature this PR addresses: On new database error when syncing new github organization (example: OCA). Error traceback: KeyError: 'blog' Current behavior before PR: Synchronization gets blog key on `get_odoo_data_from_github` but blog field does not exist. When it tries to match the key with model attribute we get key error. Desired behavior after PR is merged: Get blog key from github data and show it on form view.
[FIX] github_connector: keyerror 'blog' Description of the issue/feature this PR addresses: On new database error when syncing new github organization (example: OCA). Error traceback: KeyError: 'blog' Current behavior before PR: Synchronization gets blog key on `get_odoo_data_from_github` but blog field does not exist. When it tries to match the key with model attribute we get key error. Desired behavior after PR is merged: Get blog key from github data and show it on form view.
[FIX] github_connector: keyerror 'blog' Description of the issue/feature this PR addresses: On new database error when syncing new github organization (example: OCA). Error traceback: KeyError: 'blog' Current behavior before PR: Synchronization gets blog key on `get_odoo_data_from_github` but blog field does not exist. When it tries to match the key with model attribute we get key error. Desired behavior after PR is merged: Get blog key from github data and show it on form view.
Description of the issue/feature this PR addresses:
On new database error when syncing new github organization (example: OCA).
Error traceback: KeyError: 'blog'
Current behavior before PR:
Synchronization gets blog key on
get_odoo_data_from_github
but blog field does not exist.When it tries to match the key with model attribute we get key error.
Desired behavior after PR is merged:
Get blog key from github data and show it on form view.