how to multiply the percent value to another field? what i did, i have a field and on that field the number will be input and i sue the code + '%'to translate it in percent. so im gonna multiply it on another field which is the total of the other computation. but i encounter a error. can anybody help me with this????? i really need all your help to those prof. of this odoo or openerp.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
def _show_percent(self, cr, uid, ids, field_names=None, arg=False, context=None):
res = {}
for rec in self.browse(cr, uid, ids, context=context):
res[rec.id] = str(rec.numtopercentage) + "%"
return res
class appraisal_report(osv.Model):
_name = 'appraisal.report'
_description = 'Appraisal Report'
_columns = {
'housevalue': fields.function(difference_year, string='House Value', type='char'),
'numtopercentage': fields.float('% of Comp', required=True),
'percentage': fields.function(_show_percent, string='Percentage', type='char'), }
so what i want is to multiply the house value to percentage. how could do that? what code should i write?
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng ký
Hi Louie,, can you please add more details..??
paste your code.
You should add "%" sign using widget (you can extend existing widget) in javascript, not in python... then in python you'll have only a number value and you can use it as you need.
what is the code for that? i really need help
i really need a sample code. since im a newbie...