-
-
Notifications
You must be signed in to change notification settings - Fork 169
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
[18.0] [MIG] product_brand #211
base: 18.0
Are you sure you want to change the base?
Conversation
… Thanks to NetAndCo who starts the module
* add smart button, move menu to a more visible position. * show brand in product.template kanban and tree views. * show brand in product variant kanban and tree views. * add product_brand kanban view. * update module's README and manifest file. * Search and group by brand for both product.product and product.template. * Convert model to new APIs. * Refactor products_count computation using product_ids one2many field. * Add public read access to product.brand (fixes 403 error on webshop for public user). * Make brand name required.
Migration to 10.0
Old form view was out of order: form blocks misaligned, because it was not using Odoo 10 views styling and layout.
Lookup fails when the ID is formatted. The unformatted version of the data is located under `raw_value`.
Currently translated at 100,0% (21 of 21 strings) Translation: product-attribute-11.0/product-attribute-11.0-product_brand Translate-URL: https://translation.odoo-community.org/projects/product-attribute-11-0/product-attribute-11-0-product_brand/de/
… with other odoo apps. (#364) * Make the logo always the same width (64px). * Remove the description (200 first caracters). Not relevant for a configuration model. * Move the brand name and product count beside the image. This is the way it is displayed in partners and products kanban views.
Currently translated at 100.0% (24 of 24 strings) Translation: product-attribute-12.0/product-attribute-12.0-product_brand Translate-URL: https://translation.odoo-community.org/projects/product-attribute-12-0/product-attribute-12-0-product_brand/es/
Currently translated at 37.5% (9 of 24 strings) Translation: product-attribute-12.0/product-attribute-12.0-product_brand Translate-URL: https://translation.odoo-community.org/projects/product-attribute-12-0/product-attribute-12-0-product_brand/nb_NO/
Currently translated at 100.0% (24 of 24 strings) Translation: product-attribute-12.0/product-attribute-12.0-product_brand Translate-URL: https://translation.odoo-community.org/projects/product-attribute-12-0/product-attribute-12-0-product_brand/nb_NO/
Currently translated at 100.0% (24 of 24 strings) Translation: product-attribute-12.0/product-attribute-12.0-product_brand Translate-URL: https://translation.odoo-community.org/projects/product-attribute-12-0/product-attribute-12-0-product_brand/nl_NL/
* Rule product.brand.public has no group, this is a deprecated feature. odoo/odoo#125216 * Every access-granting rule should specify a group. odoo/odoo@ce1a4a2
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.
@samirGuesmi Thank you for porting this module, please check my code review and the results from my testing.
product_brand/__manifest__.py
Outdated
@@ -9,7 +9,7 @@ | |||
|
|||
{ | |||
"name": "Product Brand Manager", | |||
"version": "17.0.1.1.1", | |||
"version": "18.0.1.1.1", |
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.
Should be 18.0.1.0.0
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.
Done
@@ -147,7 +147,7 @@ | |||
<field name="model">product.template</field> | |||
<field name="inherit_id" ref="product.product_template_kanban_view" /> | |||
<field name="arch" type="xml"> | |||
<xpath expr="//strong[hasclass('o_kanban_record_title')]" position="after"> | |||
<xpath expr="//div[hasclass('d-flex')]" position="after"> |
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.
Avoid to do generic search on elements with class d-flex
, like you are doing here:
expr="//div[hasclass('d-flex')]"
Try to use something more direct, like for example:
expr="//field[@name='name']/.."
(putting /..
after the field will have the same effect as the expression above)
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.
Thanks, Done
expr="//div[hasclass('oe_kanban_details')]//strong[1]" | ||
position="after" | ||
> | ||
<xpath expr="//div[hasclass('d-flex')]" position="after"> |
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.
Tested in runboat: when I click on the brand in the kanban view of a variant (product.product), the link doesn't work because it opens directly the variant instead of the brand. Could you check? (but seems working fine on the product.template)
Also here, avoid to do generic search on class d-flex
.
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.
It doesn't work on v17 either. I fixed it by adding the widget widget="many2one"
.
27fc8f9
to
17d528f
Compare
@astirpe Thank you Andrea for the review. |
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.
Thank you!
This PR has the |
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.
Functional review
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.
func review
@pedrobaeza would you set this PR to merge ? tks! |
@@ -11,14 +12,14 @@ class AccountInvoiceReport(models.Model): | |||
|
|||
@api.model | |||
def _select(self): | |||
select_str = super()._select() | |||
select_str = super()._select().code |
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.
Isn't there a way of not having to unwrap/wrap this? I suppose there should be a method to add new content to the existing SQL object.
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.
HI @samirGuesmi !
Thank you for the PR
Only we suggest one small change related to a warning that is raise in runbot,
Please could you add it to this PR?
Best Rergards
<field name="products_count" /> | ||
<field name="description" /> | ||
<templates> | ||
<t t-name="kanban-box"> |
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.
To avoid warning in runbot please change to card. for more info go to
odoo/odoo@233f03d
<t t-name="kanban-box"> | |
<t t-name="card"> |
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.
@samirGuesmi I've pushed this change because I needed our pipelines to be green :-)
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.
@marielejeune thanks 😃
17d528f
to
d57b8d7
Compare
<field name="description" /> | ||
<templates> | ||
<t t-name="card"> | ||
<div class="oe_kanban_global_click"> |
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.
class oe_kanban_global_click
is deprecated in this PR: odoo/odoo#167751
alt="Logo" | ||
/> | ||
</div> | ||
<div class="oe_kanban_details"> |
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.
oe_kanban_details
is the same above
<t t-name="card"> | ||
<div class="oe_kanban_global_click"> | ||
<div class="o_kanban_image"> | ||
<img |
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.
<field name="model">product.brand</field> | ||
<field name="arch" type="xml"> | ||
<kanban> | ||
<field name="id" /> |
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.
<field name="id" /> |
return SQL(select_str) | ||
|
||
@api.model | ||
def _group_by(self): |
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.
def _group_by(self): | |
def _group_by(self) -> SQL:: | |
return SQL("%s, template.product_brand_id", super()._group_by()) |
product_brand_id = fields.Many2one(comodel_name="product.brand", string="Brand") | ||
|
||
@api.model | ||
def _select(self): |
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.
def _select(self): | |
def _select(self) -> SQL: | |
return SQL("%s, template.product_brand_id as product_brand_id", super()._select()) |
please name the pull request following this pattern: |
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.
functional review
Hi, I created #215 to follow-up on your PR with the needed changes. |
Migarate product_brand to v18