python - How to get total workers by button? -


my requirement when adding workers in select workers tree view, need add total of them right side bottom total workers field.its ok show when i'm going save or when clicked (update) button. refer purchase module can't find function exaclty called when button clicked.

my whole code uploaded here@github refer line 397 in bpl_view.xml , line 335 in bpl.py

as per purchase module wrote function.but have return statement.thats confused me.

def button_total(self, cr, uid, ids, context=none):     return true 

please advice me on issue & please tell me why when clicked button records save automatically.?its have return true statement. ? ?

screen

write code:

def button_total(self, cr, uid, ids, context=none):     tea_worker_line_ids = self.browse(cr, uid, ids[0], context=context).selected_tea_workers_line_ids or []     total_tea_worker = len(tea_worker_line_ids)     self.write(cr, uid, ids, {'total_workers': total_tea_worker}, context=context)     return true 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -