Odoo Help

0
1 Answer
1
Avatar

Cyril Gaspard (GEM)

--Cyril Gaspard (GEM)--

4284
| 5 6 8
Paris, France
--Cyril Gaspard (GEM)--

Forum contributor since 2008

Cyril Gaspard (GEM)
3/2/13, 8:47 AM

Hi,

see first this url (sorry I not enough Karma to add complete url :( ):

h t t p : / / en.wikipedia.org/wiki/Strikethrough

to test :

create a new field type char normal_price_char with same string than normal_price ((to display the same name in view).

add it to the tree view and do invisible field normal_price in this same tree view.

in the form view, for fields normal_price and extra_price add the same attribute on_change function named by example onchange_normal_price_char with in body function this 2 fields.

in python class create the onchange function onchange_normal_price_char.

in onchange function, add test: if extra_price:

normal_price_char_temp = str(normal_price) (convert integer to string)

add in this condition a function which custom normal_price_char_temp with character "-" betweeen each char number (example : 1234 become 1-2-3-4).

use function attribute encode() with unicode U+0336 normal_price_char = normal_price_char_temp.encode('U+0336') (I hope this unicode will be known else search how to write this unicode correctly if this doesn't work)

else: normal_price_char = str(normal_price)

return {'value'{normal_price_char ': normal_price_char}}

perhaps you should do some personnal customs...

Hope this will help and work.

Don't forget to post your module to the openerp apps if it works ;)

Bye

Ask a Question
Writer
Keep Informed
1 follower(s)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now