Skip to content
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

Merged
merged 22 commits into from
Sep 14, 2015
Merged

[add]pos product category button with image #47

merged 22 commits into from
Sep 14, 2015

Conversation

jcarlosmontoya
Copy link

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;
}

@oca-clabot
Copy link

Hey @cellsnake, thank you for your Pull Request.

It looks like some users haven't signed our Contributor License Agreement, yet.
You can read and sign our full Contributor License Agreement here: http://odoo-community.org/page/website.cla
Here is a list of the users:

Appreciation of efforts,
OCA CLAbot

@jcarlosmontoya jcarlosmontoya changed the title pos product category button with image [add]pos product category button with image Aug 25, 2015
@@ -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')
Copy link
Contributor

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" ?

Copy link
Member

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.

Copy link
Author

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

@legalsylvain legalsylvain added this to the 8.0 milestone Aug 25, 2015
./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
@jcarlosmontoya
Copy link
Author

i need help about coveralls, What does it mean?
Thank you

@pedrobaeza
Copy link
Member

It means that the part of the code that is covered by tests is lower, but there's not too much impact.

@jcarlosmontoya
Copy link
Author

Thanks @pedrobaeza

@jcarlosmontoya
Copy link
Author

Hi
Well, we have images in product category,
Now, for display images in product categories buttons (POS), it needs change model (product.category by pos.category ) in widgets.js (method get_image_url, line 460) from point_of_sale module.
¿How i can do it without touching directly this .js?
¿Someone can help me please?

@pedrobaeza
Copy link
Member

You have to do JavaScript inheritance, but this something you have to learn by your own

@jcarlosmontoya
Copy link
Author

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"?>
Copy link
Contributor

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 ?

@jcarlosmontoya
Copy link
Author

do i need to do something else?

@@ -51,3 +51,6 @@ docs/_build/

# PyBuilder
target/

# pycharm projects files
.idea
Copy link
Contributor

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...)

@legalsylvain
Copy link
Contributor

Is it still WIP ? or does this PR need review ?

if(product['price_extra'] > 0.0){
price += product['price_extra']
}

Copy link
Contributor

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;

Copy link
Author

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.

@jcarlosmontoya
Copy link
Author

Hello @legalsylvain you can change status to "need review".
Thanks.

@legalsylvain
Copy link
Contributor

LGTM. Code review no test. 👍
Thanks for you contribution.
@sylvainc , could you take a look on this PR that improves your module ?

@sylvainc
Copy link

@legalsylvain, sure.

👍 (code review)

@cellsnake , Thanks for your contribution.

legalsylvain added a commit that referenced this pull request Sep 14, 2015
…ith_image-1

[add]pos product category button with image
@legalsylvain legalsylvain merged commit 8c95179 into OCA:8.0 Sep 14, 2015
@legalsylvain
Copy link
Contributor

thanks. Merged.

@jcarlosmontoya
Copy link
Author

Thanks to you @legalsylvain, @sylvainc, @pedrobaeza.
It has been my first contribution, i hope first of many ;)
regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants