Skip to content

Sourcery refactored 13.0 branch#1

Open
sourcery-ai[bot] wants to merge 1 commit into
13.0from
sourcery/13.0
Open

Sourcery refactored 13.0 branch#1
sourcery-ai[bot] wants to merge 1 commit into
13.0from
sourcery/13.0

Conversation

@sourcery-ai
Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot commented Apr 11, 2023

Branch 13.0 refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the 13.0 branch, then run:

git fetch origin sourcery/13.0
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai Bot requested a review from barackvn April 11, 2023 04:30
# Mix. image colors using addition method
RGBA_WHITE = (255, 255, 255, 255)
for i in range(0, height * width):
for i in range(height * width):
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function image_to_rgb refactored with the following changes:


URL_BASE = "/web_company_color/static/src/scss/"
URL_SCSS_GEN_TEMPLATE = URL_BASE + "custom_colors.%d.gen.scss"
URL_SCSS_GEN_TEMPLATE = f"{URL_BASE}custom_colors.%d.gen.scss"
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 11-11 refactored with the following changes:

result = super().write(values)

if any([field in values for field in fields_to_check]):
if any(field in values for field in fields_to_check):
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function ResCompany.write refactored with the following changes:

Comment on lines -111 to +118
values.update(
{
"color_navbar_bg": (values.get("color_navbar_bg") or "$o-brand-odoo"),
"color_navbar_bg_hover": (
values.get("color_navbar_bg_hover")
or "$o-navbar-inverse-link-hover-bg"
),
"color_navbar_text": (values.get("color_navbar_text") or "#FFF"),
}
)
values |= {
"color_navbar_bg": (values.get("color_navbar_bg") or "$o-brand-odoo"),
"color_navbar_bg_hover": (
values.get("color_navbar_bg_hover")
or "$o-navbar-inverse-link-hover-bg"
),
"color_navbar_text": (values.get("color_navbar_text") or "#FFF"),
}
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function ResCompany._scss_get_sanitized_values refactored with the following changes:

Comment on lines -126 to +128
if not self.company_colors:
return "// No Web Company Color SCSS Content\n"
return self.SCSS_TEMPLATE % self._scss_get_sanitized_values()
return (
self.SCSS_TEMPLATE % self._scss_get_sanitized_values()
if self.company_colors
else "// No Web Company Color SCSS Content\n"
)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function ResCompany._scss_generate_content refactored with the following changes:

news = bus_bus.search(domain) - existing
self.assertEqual(1, len(news))
test_msg.update({"type": DEFAULT})
test_msg["type"] = DEFAULT
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function TestResUsers.test_notify_default refactored with the following changes:

version_list = []
for url in urls:
version_list.append(url.split("/")[3])
version_list = [url.split("/")[3] for url in urls]
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function PWA.service_worker refactored with the following changes:

for value in range(min_value, max_value + 1):
options.append((value, str(value)))
return options
return [(value, str(value)) for value in range(min_value, max_value + 1)]
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function WebWidgetDropdownDynamicExample.values_int_field refactored with the following changes:

view_id = self.env.ref(
"web_widget_x2many_2d_matrix_example.%s" % view_xmlid,
).id
view_id = self.env.ref(f"web_widget_x2many_2d_matrix_example.{view_xmlid}").id
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function X2MDemo._open_x2m_matrix refactored with the following changes:

Comment on lines -19 to -31
(
(4, rec.line_ids.filtered(lambda x: x.user_id == usr)[0].id)
if rec.line_ids.filtered(lambda x: x.user_id == usr)
else (
0,
0,
{
"name": "{}'s task on {}".format(usr.name, rec.name),
"name": f"{usr.name}'s task on {rec.name}",
"demo_id": rec.id,
"user_id": usr.id,
},
)
# if there isn't a demo line record for the user, create a new one
if not rec.line_ids.filtered(lambda x: x.user_id == usr) else
# otherwise, return the line
(4, rec.line_ids.filtered(lambda x: x.user_id == usr)[0].id)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function X2mMatrixDemoWiz._default_line_ids refactored with the following changes:

This removes the following comments ( why? ):

# if there isn't a demo line record for the user, create a new one
# otherwise, return the line

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.

0 participants