-
-
Notifications
You must be signed in to change notification settings - Fork 585
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
[add]pos product category button with image #47
[add]pos product category button with image #47
Conversation
Hey @cellsnake, thank you for your Pull Request. It looks like some users haven't signed our Contributor License Agreement, yet.
Appreciation of efforts, |
@@ -44,12 +44,23 @@ def write(self, vals): | |||
class ProductCategory(models.Model): | |||
_inherit = 'product.category' | |||
|
|||
image = fields.Binary(help='Show Image Category in Form View') | |||
image_medium = fields.Binary(help='Show image category button in POS') |
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,
don't you forgot compute=''_save_image_medium" ?
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.
I think _save_image_medium
is more the inverse method than the compute one.
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.
Hello , I tried , but did not have the desired results , so I chose to use @api.constrains
./pos_remove_pos_category/product.py:55:1: W293 blank line contains whitespace ./pos_remove_pos_category/product.py:60:20: F821 undefined name 'tools'
image_medium with inverse parameter updated method _save_image_medium
in inverse _save_image_medium method - add class css and size 100px image in product category form view
i need help about coveralls, What does it mean? |
It means that the part of the code that is covered by tests is lower, but there's not too much impact. |
Thanks @pedrobaeza |
Hi |
You have to do JavaScript inheritance, but this something you have to learn by your own |
thanks @pedrobaeza, come soon i'll update, this take a time, but i'll do it ;) |
…th_image-1' into cellsnake-pos_category_button_with_image-1
This file replace src attribute original script POS
@@ -0,0 +1,13 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> |
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.
Could you remove this file ?
*Override javascript method original POS (get_image_url)
…th_image-1' into cellsnake-pos_category_button_with_image-1
do i need to do something else? |
for image_medium
[FIX] pos_pricelist does not include price_extra (product variant)
@@ -51,3 +51,6 @@ docs/_build/ | |||
|
|||
# PyBuilder | |||
target/ | |||
|
|||
# pycharm projects files | |||
.idea |
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.
could you remove this useless lines. (useless for OCA community, maybe not for you...)
Is it still WIP ? or does this PR need review ? |
if(product['price_extra'] > 0.0){ | ||
price += product['price_extra'] | ||
} | ||
|
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.
i don't understand why you change this file. I guess it is out of the scope of this PR.
regards;
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.
Sorry for these changes, I meant them for another PR but I merged with this one. My mistake.
I have already deleted them.
Hello @legalsylvain you can change status to "need review". |
LGTM. Code review no test. 👍 |
@legalsylvain, sure. 👍 (code review) @cellsnake , Thanks for your contribution. |
…ith_image-1 [add]pos product category button with image
thanks. Merged. |
Thanks to you @legalsylvain, @sylvainc, @pedrobaeza. |
When installing this module, images of the product categories at the POS buttons are no longer displayed.
TODO : widgets.js update from odoo/addons/point_of_sale/static/src/js
Method (line 459):
get_image_url: function(category){
//original line
//return window.location.origin + '/web/binary/image?model=pos.category&field=image_medium&id='+category.id;
//actual line
return window.location.origin + '/web/binary/image?model=product.category&field=image_medium&id='+category.id;
}