Skip to content

Commit

Permalink
🚑 fix hard-coded table name + copyright cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Yelizariev committed Aug 23, 2018
1 parent 583312e commit fa137b3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion web_website/__manifest__.py
Expand Up @@ -6,7 +6,7 @@
"category": "Hidden",
# "live_test_url": "",
"images": [],
"version": "11.0.2.0.0",
"version": "11.0.2.0.1",
"application": False,

"author": "IT-Projects LLC, Ivan Yelizariev",
Expand Down
4 changes: 4 additions & 0 deletions web_website/doc/changelog.rst
@@ -1,3 +1,7 @@
`2.0.1`
-------
- **Fix:** fix API method that affects new developed module

`2.0.0`
-------
- **Improvement:** Code is refactored to convert existing field to website-dependent one in a more easy way
Expand Down
4 changes: 2 additions & 2 deletions web_website/models/website_dependent_mixin.py
@@ -1,4 +1,4 @@
# Copyright 2017-2018 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# Copyright 2018 Ivan Yelizariev <https://it-projects.info/team/yelizariev>
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
from odoo import models, api
import logging
Expand Down Expand Up @@ -120,7 +120,7 @@ def _post_init_website_dependent(self, field_name):

field = self._get_field_object(field_name)
for r in self.sudo().search([]):
cr.execute("SELECT %s FROM ir_config_parameter WHERE id = %s" % (field_name, r.id))
cr.execute("SELECT %s FROM %s WHERE id = %s" % (field_name, self._table, r.id))
res = cr.dictfetchone()
value = res.get(field_name)
# value may be empty after migration from previous module version
Expand Down

0 comments on commit fa137b3

Please sign in to comment.