bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def _total_cost_calc(self, cr, uid, ids, name, arg, context={}): res = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: acc_set = ",".join(map(str, ids2)) cr.execute("""select account_analytic_line.account_id,COALESCE(sum(amount_currency),0.0) \
def _total_cost_calc(self, cr, uid, ids, name, arg, context={}): res = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: acc_set = ",".join(map(str, ids2)) cr.execute("""select account_analytic_line.account_id,COALESCE(sum(amount_currency),0.0) \
476,700
def _total_cost_calc(self, cr, uid, ids, name, arg, context={}): res = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: acc_set = ",".join(map(str, ids2)) cr.execute("""select account_analytic_line.account_id,COALESCE(sum(amount_currency),0.0) \
def _total_cost_calc(self, cr, uid, ids, name, arg, context={}): res = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: acc_set = ",".join(map(str, ids2)) cr.execute("""select account_analytic_line.account_id,COALESCE(sum(amount_currency),0.0) \
476,701
def _total_cost_calc(self, cr, uid, ids, name, arg, context={}): res = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: acc_set = ",".join(map(str, ids2)) cr.execute("""select account_analytic_line.account_id,COALESCE(sum(amount_currency),0.0) \
def _total_cost_calc(self, cr, uid, ids, name, arg, context={}): res = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: acc_set = ",".join(map(str, ids2)) cr.execute("""select account_analytic_line.account_id,COALESCE(sum(amount_currency),0.0) \
476,702
def _ca_theorical_calc(self, cr, uid, ids, name, arg, context={}): res = {} res2 = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) # Warning # This computation doesn't take care of pricelist ! # Just consider list_price if ids2: cr.execute("""select account_analytic_line.account_id as account_id, \ COALESCE(sum((account_analytic_line.unit_amount * pt.list_price) \ - (account_analytic_line.unit_amount * pt.list_price \ * hr.factor)),0.0) as somme from account_analytic_line \ left join account_analytic_journal \ on (account_analytic_line.journal_id = account_analytic_journal.id) \ join product_product pp \ on (account_analytic_line.product_id = pp.id) \ join product_template pt \ on (pp.product_tmpl_id = pt.id) \ join account_analytic_account a \ on (a.id=account_analytic_line.account_id) \ join hr_timesheet_invoice_factor hr \ on (hr.id=a.to_invoice) \ where account_analytic_line.account_id =ANY(%s) \ and a.to_invoice IS NOT NULL \ and account_analytic_journal.type in ('purchase','general') GROUP BY account_analytic_line.account_id""",(ids2,)) for account_id, sum in cr.fetchall(): res2[account_id] = round(sum,2) for obj_id in ids: res.setdefault(obj_id, 0.0) res2.setdefault(obj_id, 0.0) for child_id in self.search(cr, uid, [('parent_id', 'child_of', [obj_id])]): if child_id != obj_id: res[obj_id] += res.get(child_id, 0.0) res[obj_id] += res2.get(child_id, 0.0) # sum both result on account_id for id in ids: res[id] = round(res.get(id, 0.0),2) + round(res2.get(id, 0.0),2) return res
def _ca_theorical_calc(self, cr, uid, ids, name, arg, context={}): res = {} res2 = {} parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)])) # Warning # This computation doesn't take care of pricelist ! # Just consider list_price if ids2: cr.execute("""select account_analytic_line.account_id as account_id, \ COALESCE(sum((account_analytic_line.unit_amount * pt.list_price) \ - (account_analytic_line.unit_amount * pt.list_price \ * hr.factor)),0.0) as somme from account_analytic_line \ left join account_analytic_journal \ on (account_analytic_line.journal_id = account_analytic_journal.id) \ join product_product pp \ on (account_analytic_line.product_id = pp.id) \ join product_template pt \ on (pp.product_tmpl_id = pt.id) \ join account_analytic_account a \ on (a.id=account_analytic_line.account_id) \ join hr_timesheet_invoice_factor hr \ on (hr.id=a.to_invoice) \ where account_analytic_line.account_id =ANY(%s) \ and a.to_invoice IS NOT NULL \ and account_analytic_journal.type in ('purchase','general') GROUP BY account_analytic_line.account_id""",(ids2,)) for account_id, sum in cr.fetchall(): res2[account_id] = round(sum,2) for obj_id in ids: res.setdefault(obj_id, 0.0) res2.setdefault(obj_id, 0.0) for child_id in self.search(cr, uid, [('parent_id', 'child_of', [obj_id])]): if child_id != obj_id: res[obj_id] += res.get(child_id, 0.0) res[obj_id] += res2.get(child_id, 0.0) # sum both result on account_id for id in ids: res[id] = round(res.get(id, 0.0),2) + round(res2.get(id, 0.0),2) return res
476,703
def _ca_theorical_calc(self, cr, uid, ids, name, arg, context={}): res = {} res2 = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) # Warning # This computation doesn't take care of pricelist ! # Just consider list_price if ids2: cr.execute("""select account_analytic_line.account_id as account_id, \ COALESCE(sum((account_analytic_line.unit_amount * pt.list_price) \ - (account_analytic_line.unit_amount * pt.list_price \ * hr.factor)),0.0) as somme from account_analytic_line \ left join account_analytic_journal \ on (account_analytic_line.journal_id = account_analytic_journal.id) \ join product_product pp \ on (account_analytic_line.product_id = pp.id) \ join product_template pt \ on (pp.product_tmpl_id = pt.id) \ join account_analytic_account a \ on (a.id=account_analytic_line.account_id) \ join hr_timesheet_invoice_factor hr \ on (hr.id=a.to_invoice) \ where account_analytic_line.account_id =ANY(%s) \ and a.to_invoice IS NOT NULL \ and account_analytic_journal.type in ('purchase','general') GROUP BY account_analytic_line.account_id""",(ids2,)) for account_id, sum in cr.fetchall(): res2[account_id] = round(sum,2) for obj_id in ids: res.setdefault(obj_id, 0.0) res2.setdefault(obj_id, 0.0) for child_id in self.search(cr, uid, [('parent_id', 'child_of', [obj_id])]): if child_id != obj_id: res[obj_id] += res.get(child_id, 0.0) res[obj_id] += res2.get(child_id, 0.0) # sum both result on account_id for id in ids: res[id] = round(res.get(id, 0.0),2) + round(res2.get(id, 0.0),2) return res
def _ca_theorical_calc(self, cr, uid, ids, name, arg, context={}): res = {} res2 = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) # Warning # This computation doesn't take care of pricelist ! # Just consider list_price if parent_ids: cr.execute("""select account_analytic_line.account_id as account_id, \ COALESCE(sum((account_analytic_line.unit_amount * pt.list_price) \ - (account_analytic_line.unit_amount * pt.list_price \ * hr.factor)),0.0) as somme from account_analytic_line \ left join account_analytic_journal \ on (account_analytic_line.journal_id = account_analytic_journal.id) \ join product_product pp \ on (account_analytic_line.product_id = pp.id) \ join product_template pt \ on (pp.product_tmpl_id = pt.id) \ join account_analytic_account a \ on (a.id=account_analytic_line.account_id) \ join hr_timesheet_invoice_factor hr \ on (hr.id=a.to_invoice) \ where account_analytic_line.account_id =ANY(%s) \ and a.to_invoice IS NOT NULL \ and account_analytic_journal.type in ('purchase','general') GROUP BY account_analytic_line.account_id""",(ids2,)) for account_id, sum in cr.fetchall(): res2[account_id] = round(sum,2) for obj_id in ids: res.setdefault(obj_id, 0.0) res2.setdefault(obj_id, 0.0) for child_id in self.search(cr, uid, [('parent_id', 'child_of', [obj_id])]): if child_id != obj_id: res[obj_id] += res.get(child_id, 0.0) res[obj_id] += res2.get(child_id, 0.0) # sum both result on account_id for id in ids: res[id] = round(res.get(id, 0.0),2) + round(res2.get(id, 0.0),2) return res
476,704
def _ca_theorical_calc(self, cr, uid, ids, name, arg, context={}): res = {} res2 = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) # Warning # This computation doesn't take care of pricelist ! # Just consider list_price if ids2: cr.execute("""select account_analytic_line.account_id as account_id, \ COALESCE(sum((account_analytic_line.unit_amount * pt.list_price) \ - (account_analytic_line.unit_amount * pt.list_price \ * hr.factor)),0.0) as somme from account_analytic_line \ left join account_analytic_journal \ on (account_analytic_line.journal_id = account_analytic_journal.id) \ join product_product pp \ on (account_analytic_line.product_id = pp.id) \ join product_template pt \ on (pp.product_tmpl_id = pt.id) \ join account_analytic_account a \ on (a.id=account_analytic_line.account_id) \ join hr_timesheet_invoice_factor hr \ on (hr.id=a.to_invoice) \ where account_analytic_line.account_id =ANY(%s) \ and a.to_invoice IS NOT NULL \ and account_analytic_journal.type in ('purchase','general') GROUP BY account_analytic_line.account_id""",(ids2,)) for account_id, sum in cr.fetchall(): res2[account_id] = round(sum,2) for obj_id in ids: res.setdefault(obj_id, 0.0) res2.setdefault(obj_id, 0.0) for child_id in self.search(cr, uid, [('parent_id', 'child_of', [obj_id])]): if child_id != obj_id: res[obj_id] += res.get(child_id, 0.0) res[obj_id] += res2.get(child_id, 0.0) # sum both result on account_id for id in ids: res[id] = round(res.get(id, 0.0),2) + round(res2.get(id, 0.0),2) return res
def _ca_theorical_calc(self, cr, uid, ids, name, arg, context={}): res = {} res2 = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) # Warning # This computation doesn't take care of pricelist ! # Just consider list_price if ids2: cr.execute("""select account_analytic_line.account_id as account_id, \ COALESCE(sum((account_analytic_line.unit_amount * pt.list_price) \ - (account_analytic_line.unit_amount * pt.list_price \ * hr.factor)),0.0) as somme from account_analytic_line \ left join account_analytic_journal \ on (account_analytic_line.journal_id = account_analytic_journal.id) \ join product_product pp \ on (account_analytic_line.product_id = pp.id) \ join product_template pt \ on (pp.product_tmpl_id = pt.id) \ join account_analytic_account a \ on (a.id=account_analytic_line.account_id) \ join hr_timesheet_invoice_factor hr \ on (hr.id=a.to_invoice) \ where account_analytic_line.account_id IN %s \ and a.to_invoice IS NOT NULL \ and account_analytic_journal.type in ('purchase','general') GROUP BY account_analytic_line.account_id""",(ids2,)) for account_id, sum in cr.fetchall(): res2[account_id] = round(sum,2) for obj_id in ids: res.setdefault(obj_id, 0.0) res2.setdefault(obj_id, 0.0) for child_id in self.search(cr, uid, [('parent_id', 'child_of', [obj_id])]): if child_id != obj_id: res[obj_id] += res.get(child_id, 0.0) res[obj_id] += res2.get(child_id, 0.0) # sum both result on account_id for id in ids: res[id] = round(res.get(id, 0.0),2) + round(res2.get(id, 0.0),2) return res
476,705
def _ca_theorical_calc(self, cr, uid, ids, name, arg, context={}): res = {} res2 = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) # Warning # This computation doesn't take care of pricelist ! # Just consider list_price if ids2: cr.execute("""select account_analytic_line.account_id as account_id, \ COALESCE(sum((account_analytic_line.unit_amount * pt.list_price) \ - (account_analytic_line.unit_amount * pt.list_price \ * hr.factor)),0.0) as somme from account_analytic_line \ left join account_analytic_journal \ on (account_analytic_line.journal_id = account_analytic_journal.id) \ join product_product pp \ on (account_analytic_line.product_id = pp.id) \ join product_template pt \ on (pp.product_tmpl_id = pt.id) \ join account_analytic_account a \ on (a.id=account_analytic_line.account_id) \ join hr_timesheet_invoice_factor hr \ on (hr.id=a.to_invoice) \ where account_analytic_line.account_id =ANY(%s) \ and a.to_invoice IS NOT NULL \ and account_analytic_journal.type in ('purchase','general') GROUP BY account_analytic_line.account_id""",(ids2,)) for account_id, sum in cr.fetchall(): res2[account_id] = round(sum,2) for obj_id in ids: res.setdefault(obj_id, 0.0) res2.setdefault(obj_id, 0.0) for child_id in self.search(cr, uid, [('parent_id', 'child_of', [obj_id])]): if child_id != obj_id: res[obj_id] += res.get(child_id, 0.0) res[obj_id] += res2.get(child_id, 0.0) # sum both result on account_id for id in ids: res[id] = round(res.get(id, 0.0),2) + round(res2.get(id, 0.0),2) return res
def _ca_theorical_calc(self, cr, uid, ids, name, arg, context={}): res = {} res2 = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) # Warning # This computation doesn't take care of pricelist ! # Just consider list_price if ids2: cr.execute("""select account_analytic_line.account_id as account_id, \ COALESCE(sum((account_analytic_line.unit_amount * pt.list_price) \ - (account_analytic_line.unit_amount * pt.list_price \ * hr.factor)),0.0) as somme from account_analytic_line \ left join account_analytic_journal \ on (account_analytic_line.journal_id = account_analytic_journal.id) \ join product_product pp \ on (account_analytic_line.product_id = pp.id) \ join product_template pt \ on (pp.product_tmpl_id = pt.id) \ join account_analytic_account a \ on (a.id=account_analytic_line.account_id) \ join hr_timesheet_invoice_factor hr \ on (hr.id=a.to_invoice) \ where account_analytic_line.account_id =ANY(%s) \ and a.to_invoice IS NOT NULL \ and account_analytic_journal.type in ('purchase','general') GROUP BY account_analytic_line.account_id""",(parent_ids,)) for account_id, sum in cr.fetchall(): res2[account_id] = round(sum,2) for obj_id in ids: res.setdefault(obj_id, 0.0) res2.setdefault(obj_id, 0.0) for child_id in self.search(cr, uid, [('parent_id', 'child_of', [obj_id])]): if child_id != obj_id: res[obj_id] += res.get(child_id, 0.0) res[obj_id] += res2.get(child_id, 0.0) # sum both result on account_id for id in ids: res[id] = round(res.get(id, 0.0),2) + round(res2.get(id, 0.0),2) return res
476,706
def _last_worked_date_calc (self, cr, uid, ids, name, arg, context={}): res = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: cr.execute("select account_analytic_line.account_id, max(date) \ from account_analytic_line \ where account_id =ANY(%s) \ and invoice_id is null \ GROUP BY account_analytic_line.account_id" ,(ids2,)) for account_id, sum in cr.fetchall(): res[account_id] = sum for obj_id in ids: res.setdefault(obj_id, '') for child_id in self.search(cr, uid, [('parent_id', 'child_of', [obj_id])]): if res[obj_id] < res.get(child_id, ''): res[obj_id] = res.get(child_id, '') for id in ids: res[id] = res.get(id, '') return res
def _last_worked_date_calc (self, cr, uid, ids, name, arg, context={}): res = {} parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)])) if parent_ids: cr.execute("select account_analytic_line.account_id, max(date) \ from account_analytic_line \ where account_id =ANY(%s) \ and invoice_id is null \ GROUP BY account_analytic_line.account_id" ,(ids2,)) for account_id, sum in cr.fetchall(): res[account_id] = sum for obj_id in ids: res.setdefault(obj_id, '') for child_id in self.search(cr, uid, [('parent_id', 'child_of', [obj_id])]): if res[obj_id] < res.get(child_id, ''): res[obj_id] = res.get(child_id, '') for id in ids: res[id] = res.get(id, '') return res
476,707
def _last_worked_date_calc (self, cr, uid, ids, name, arg, context={}): res = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: cr.execute("select account_analytic_line.account_id, max(date) \ from account_analytic_line \ where account_id =ANY(%s) \ and invoice_id is null \ GROUP BY account_analytic_line.account_id" ,(ids2,)) for account_id, sum in cr.fetchall(): res[account_id] = sum for obj_id in ids: res.setdefault(obj_id, '') for child_id in self.search(cr, uid, [('parent_id', 'child_of', [obj_id])]): if res[obj_id] < res.get(child_id, ''): res[obj_id] = res.get(child_id, '') for id in ids: res[id] = res.get(id, '') return res
def _last_worked_date_calc (self, cr, uid, ids, name, arg, context={}): res = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: cr.execute("select account_analytic_line.account_id, max(date) \ from account_analytic_line \ where account_id IN %s \ and invoice_id is null \ GROUP BY account_analytic_line.account_id" ,(ids2,)) for account_id, sum in cr.fetchall(): res[account_id] = sum for obj_id in ids: res.setdefault(obj_id, '') for child_id in self.search(cr, uid, [('parent_id', 'child_of', [obj_id])]): if res[obj_id] < res.get(child_id, ''): res[obj_id] = res.get(child_id, '') for id in ids: res[id] = res.get(id, '') return res
476,708
def _last_worked_date_calc (self, cr, uid, ids, name, arg, context={}): res = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: cr.execute("select account_analytic_line.account_id, max(date) \ from account_analytic_line \ where account_id =ANY(%s) \ and invoice_id is null \ GROUP BY account_analytic_line.account_id" ,(ids2,)) for account_id, sum in cr.fetchall(): res[account_id] = sum for obj_id in ids: res.setdefault(obj_id, '') for child_id in self.search(cr, uid, [('parent_id', 'child_of', [obj_id])]): if res[obj_id] < res.get(child_id, ''): res[obj_id] = res.get(child_id, '') for id in ids: res[id] = res.get(id, '') return res
def _last_worked_date_calc (self, cr, uid, ids, name, arg, context={}): res = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: cr.execute("select account_analytic_line.account_id, max(date) \ from account_analytic_line \ where account_id =ANY(%s) \ and invoice_id is null \ GROUP BY account_analytic_line.account_id" ,(parent_ids,)) for account_id, sum in cr.fetchall(): res[account_id] = sum for obj_id in ids: res.setdefault(obj_id, '') for child_id in self.search(cr, uid, [('parent_id', 'child_of', [obj_id])]): if res[obj_id] < res.get(child_id, ''): res[obj_id] = res.get(child_id, '') for id in ids: res[id] = res.get(id, '') return res
476,709
def _last_invoice_date_calc (self, cr, uid, ids, name, arg, context={}): res = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: cr.execute ("select account_analytic_line.account_id, \ date(max(account_invoice.date_invoice)) \ from account_analytic_line \ join account_invoice \ on account_analytic_line.invoice_id = account_invoice.id \ where account_analytic_line.account_id =ANY(%s) \ and account_analytic_line.invoice_id is not null \ GROUP BY account_analytic_line.account_id",(ids2,)) for account_id, sum in cr.fetchall(): res[account_id] = sum for obj_id in ids: res.setdefault(obj_id, '') for child_id in self.search(cr, uid, [('parent_id', 'child_of', [obj_id])]): if res[obj_id] < res.get(child_id, ''): res[obj_id] = res.get(child_id, '') for id in ids: res[id] = res.get(id, '') return res
def _last_invoice_date_calc (self, cr, uid, ids, name, arg, context={}): res = {} parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)])) if parent_ids: cr.execute ("select account_analytic_line.account_id, \ date(max(account_invoice.date_invoice)) \ from account_analytic_line \ join account_invoice \ on account_analytic_line.invoice_id = account_invoice.id \ where account_analytic_line.account_id =ANY(%s) \ and account_analytic_line.invoice_id is not null \ GROUP BY account_analytic_line.account_id",(ids2,)) for account_id, sum in cr.fetchall(): res[account_id] = sum for obj_id in ids: res.setdefault(obj_id, '') for child_id in self.search(cr, uid, [('parent_id', 'child_of', [obj_id])]): if res[obj_id] < res.get(child_id, ''): res[obj_id] = res.get(child_id, '') for id in ids: res[id] = res.get(id, '') return res
476,710
def _last_invoice_date_calc (self, cr, uid, ids, name, arg, context={}): res = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: cr.execute ("select account_analytic_line.account_id, \ date(max(account_invoice.date_invoice)) \ from account_analytic_line \ join account_invoice \ on account_analytic_line.invoice_id = account_invoice.id \ where account_analytic_line.account_id =ANY(%s) \ and account_analytic_line.invoice_id is not null \ GROUP BY account_analytic_line.account_id",(ids2,)) for account_id, sum in cr.fetchall(): res[account_id] = sum for obj_id in ids: res.setdefault(obj_id, '') for child_id in self.search(cr, uid, [('parent_id', 'child_of', [obj_id])]): if res[obj_id] < res.get(child_id, ''): res[obj_id] = res.get(child_id, '') for id in ids: res[id] = res.get(id, '') return res
def _last_invoice_date_calc (self, cr, uid, ids, name, arg, context={}): res = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: cr.execute ("select account_analytic_line.account_id, \ date(max(account_invoice.date_invoice)) \ from account_analytic_line \ join account_invoice \ on account_analytic_line.invoice_id = account_invoice.id \ where account_analytic_line.account_id IN %s \ and account_analytic_line.invoice_id is not null \ GROUP BY account_analytic_line.account_id",(ids2,)) for account_id, sum in cr.fetchall(): res[account_id] = sum for obj_id in ids: res.setdefault(obj_id, '') for child_id in self.search(cr, uid, [('parent_id', 'child_of', [obj_id])]): if res[obj_id] < res.get(child_id, ''): res[obj_id] = res.get(child_id, '') for id in ids: res[id] = res.get(id, '') return res
476,711
def _last_invoice_date_calc (self, cr, uid, ids, name, arg, context={}): res = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: cr.execute ("select account_analytic_line.account_id, \ date(max(account_invoice.date_invoice)) \ from account_analytic_line \ join account_invoice \ on account_analytic_line.invoice_id = account_invoice.id \ where account_analytic_line.account_id =ANY(%s) \ and account_analytic_line.invoice_id is not null \ GROUP BY account_analytic_line.account_id",(ids2,)) for account_id, sum in cr.fetchall(): res[account_id] = sum for obj_id in ids: res.setdefault(obj_id, '') for child_id in self.search(cr, uid, [('parent_id', 'child_of', [obj_id])]): if res[obj_id] < res.get(child_id, ''): res[obj_id] = res.get(child_id, '') for id in ids: res[id] = res.get(id, '') return res
def _last_invoice_date_calc (self, cr, uid, ids, name, arg, context={}): res = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: cr.execute ("select account_analytic_line.account_id, \ date(max(account_invoice.date_invoice)) \ from account_analytic_line \ join account_invoice \ on account_analytic_line.invoice_id = account_invoice.id \ where account_analytic_line.account_id =ANY(%s) \ and account_analytic_line.invoice_id is not null \ GROUP BY account_analytic_line.account_id",(parent_ids,)) for account_id, sum in cr.fetchall(): res[account_id] = sum for obj_id in ids: res.setdefault(obj_id, '') for child_id in self.search(cr, uid, [('parent_id', 'child_of', [obj_id])]): if res[obj_id] < res.get(child_id, ''): res[obj_id] = res.get(child_id, '') for id in ids: res[id] = res.get(id, '') return res
476,712
def _last_worked_invoiced_date_calc (self, cr, uid, ids, name, arg, context={}): res = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: cr.execute("select account_analytic_line.account_id, max(date) \ from account_analytic_line \ where account_id =ANY(%s) \ and invoice_id is not null \ GROUP BY account_analytic_line.account_id;",(ids2,)) for account_id, sum in cr.fetchall(): res[account_id] = sum for obj_id in ids: res.setdefault(obj_id, '') for child_id in self.search(cr, uid, [('parent_id', 'child_of', [obj_id])]): if res[obj_id] < res.get(child_id, ''): res[obj_id] = res.get(child_id, '') for id in ids: res[id] = res.get(id, '') return res
def _last_worked_invoiced_date_calc (self, cr, uid, ids, name, arg, context={}): res = {} parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)])) if parent_ids: cr.execute("select account_analytic_line.account_id, max(date) \ from account_analytic_line \ where account_id =ANY(%s) \ and invoice_id is not null \ GROUP BY account_analytic_line.account_id;",(ids2,)) for account_id, sum in cr.fetchall(): res[account_id] = sum for obj_id in ids: res.setdefault(obj_id, '') for child_id in self.search(cr, uid, [('parent_id', 'child_of', [obj_id])]): if res[obj_id] < res.get(child_id, ''): res[obj_id] = res.get(child_id, '') for id in ids: res[id] = res.get(id, '') return res
476,713
def _last_worked_invoiced_date_calc (self, cr, uid, ids, name, arg, context={}): res = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: cr.execute("select account_analytic_line.account_id, max(date) \ from account_analytic_line \ where account_id =ANY(%s) \ and invoice_id is not null \ GROUP BY account_analytic_line.account_id;",(ids2,)) for account_id, sum in cr.fetchall(): res[account_id] = sum for obj_id in ids: res.setdefault(obj_id, '') for child_id in self.search(cr, uid, [('parent_id', 'child_of', [obj_id])]): if res[obj_id] < res.get(child_id, ''): res[obj_id] = res.get(child_id, '') for id in ids: res[id] = res.get(id, '') return res
def _last_worked_invoiced_date_calc (self, cr, uid, ids, name, arg, context={}): res = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: cr.execute("select account_analytic_line.account_id, max(date) \ from account_analytic_line \ where account_id IN %s \ and invoice_id is not null \ GROUP BY account_analytic_line.account_id;",(ids2,)) for account_id, sum in cr.fetchall(): res[account_id] = sum for obj_id in ids: res.setdefault(obj_id, '') for child_id in self.search(cr, uid, [('parent_id', 'child_of', [obj_id])]): if res[obj_id] < res.get(child_id, ''): res[obj_id] = res.get(child_id, '') for id in ids: res[id] = res.get(id, '') return res
476,714
def _last_worked_invoiced_date_calc (self, cr, uid, ids, name, arg, context={}): res = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: cr.execute("select account_analytic_line.account_id, max(date) \ from account_analytic_line \ where account_id =ANY(%s) \ and invoice_id is not null \ GROUP BY account_analytic_line.account_id;",(ids2,)) for account_id, sum in cr.fetchall(): res[account_id] = sum for obj_id in ids: res.setdefault(obj_id, '') for child_id in self.search(cr, uid, [('parent_id', 'child_of', [obj_id])]): if res[obj_id] < res.get(child_id, ''): res[obj_id] = res.get(child_id, '') for id in ids: res[id] = res.get(id, '') return res
def _last_worked_invoiced_date_calc (self, cr, uid, ids, name, arg, context={}): res = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: cr.execute("select account_analytic_line.account_id, max(date) \ from account_analytic_line \ where account_id =ANY(%s) \ and invoice_id is not null \ GROUP BY account_analytic_line.account_id;",(parent_ids,)) for account_id, sum in cr.fetchall(): res[account_id] = sum for obj_id in ids: res.setdefault(obj_id, '') for child_id in self.search(cr, uid, [('parent_id', 'child_of', [obj_id])]): if res[obj_id] < res.get(child_id, ''): res[obj_id] = res.get(child_id, '') for id in ids: res[id] = res.get(id, '') return res
476,715
def _month(self, cr, uid, ids, name, arg, context=None): res = {} for id in ids: ids2 = self.search(cr, uid, [('parent_id', 'child_of', [id])]) if ids2: cr.execute('SELECT DISTINCT(month_id) FROM account_analytic_analysis_summary_month ' \ 'WHERE account_id =ANY(%s) AND unit_amount <> 0.0',(ids2,)) res[id] = [int(id * 1000000 + int(x[0])) for x in cr.fetchall()] else: res[id] = [] return res
def _month(self, cr, uid, ids, name, arg, context=None): res = {} for id in ids: parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)])) if parent_ids: cr.execute('SELECT DISTINCT(month_id) FROM account_analytic_analysis_summary_month ' \ 'WHERE account_id =ANY(%s) AND unit_amount <> 0.0',(ids2,)) res[id] = [int(id * 1000000 + int(x[0])) for x in cr.fetchall()] else: res[id] = [] return res
476,716
def _month(self, cr, uid, ids, name, arg, context=None): res = {} for id in ids: ids2 = self.search(cr, uid, [('parent_id', 'child_of', [id])]) if ids2: cr.execute('SELECT DISTINCT(month_id) FROM account_analytic_analysis_summary_month ' \ 'WHERE account_id =ANY(%s) AND unit_amount <> 0.0',(ids2,)) res[id] = [int(id * 1000000 + int(x[0])) for x in cr.fetchall()] else: res[id] = [] return res
def _month(self, cr, uid, ids, name, arg, context=None): res = {} for id in ids: ids2 = self.search(cr, uid, [('parent_id', 'child_of', [id])]) if ids2: cr.execute('SELECT DISTINCT(month_id) FROM account_analytic_analysis_summary_month ' \ 'WHERE account_id IN %s AND unit_amount <> 0.0',(parent_ids,)) res[id] = [int(id * 1000000 + int(x[0])) for x in cr.fetchall()] else: res[id] = [] return res
476,717
def _user(self, cr, uid, ids, name, arg, context=None): res = {} cr.execute('SELECT MAX(id) FROM res_users') max_user = cr.fetchone()[0] for id in ids: ids2 = self.search(cr, uid, [('parent_id', 'child_of', [id])]) if ids2: cr.execute('SELECT DISTINCT("user") FROM account_analytic_analysis_summary_user ' \ 'WHERE account_id =ANY(%s) AND unit_amount <> 0.0',(ids2,)) res[id] = [int((id * max_user) + x[0]) for x in cr.fetchall()] else: res[id] = [] return res
def _user(self, cr, uid, ids, name, arg, context=None): res = {} cr.execute('SELECT MAX(id) FROM res_users') max_user = cr.fetchone()[0] for id in ids: parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', ids)])) if parent_ids: cr.execute('SELECT DISTINCT("user") FROM account_analytic_analysis_summary_user ' \ 'WHERE account_id =ANY(%s) AND unit_amount <> 0.0',(ids2,)) res[id] = [int((id * max_user) + x[0]) for x in cr.fetchall()] else: res[id] = [] return res
476,718
def _user(self, cr, uid, ids, name, arg, context=None): res = {} cr.execute('SELECT MAX(id) FROM res_users') max_user = cr.fetchone()[0] for id in ids: ids2 = self.search(cr, uid, [('parent_id', 'child_of', [id])]) if ids2: cr.execute('SELECT DISTINCT("user") FROM account_analytic_analysis_summary_user ' \ 'WHERE account_id =ANY(%s) AND unit_amount <> 0.0',(ids2,)) res[id] = [int((id * max_user) + x[0]) for x in cr.fetchall()] else: res[id] = [] return res
def _user(self, cr, uid, ids, name, arg, context=None): res = {} cr.execute('SELECT MAX(id) FROM res_users') max_user = cr.fetchone()[0] for id in ids: ids2 = self.search(cr, uid, [('parent_id', 'child_of', [id])]) if ids2: cr.execute('SELECT DISTINCT("user") FROM account_analytic_analysis_summary_user ' \ 'WHERE account_id IN %s AND unit_amount <> 0.0',(parent_ids,)) res[id] = [int((id * max_user) + x[0]) for x in cr.fetchall()] else: res[id] = [] return res
476,719
def _unit_amount(self, cr, uid, ids, name, arg, context=None): res = {} account_obj = self.pool.get('account.analytic.account') cr.execute('SELECT MAX(id) FROM res_users') max_user = cr.fetchone()[0] account_ids = [int(str(x/max_user - (x%max_user == 0 and 1 or 0))) for x in ids] user_ids = [int(str(x-((x/max_user - (x%max_user == 0 and 1 or 0)) *max_user))) for x in ids] account_ids2 = account_obj.search(cr, uid, [('parent_id', 'child_of', account_ids)]) if account_ids2: cr.execute('SELECT id, unit_amount ' \ 'FROM account_analytic_analysis_summary_user ' \ 'WHERE account_id =ANY(%s) ' \ 'AND "user" =ANY(%s)',(account_ids2, user_ids,)) for sum_id, unit_amount in cr.fetchall(): res[sum_id] = unit_amount for obj_id in ids: res.setdefault(obj_id, 0.0) for child_id in account_obj.search(cr, uid, [('parent_id', 'child_of', [int(str(obj_id/max_user - (obj_id%max_user == 0 and 1 or 0)))])]): if child_id != int(str(obj_id/max_user - (obj_id%max_user == 0 and 1 or 0))): res[obj_id] += res.get((child_id * max_user) + obj_id -((obj_id/max_user - (obj_id%max_user == 0 and 1 or 0)) * max_user), 0.0) for id in ids: res[id] = round(res.get(id, 0.0), 2) return res
def _unit_amount(self, cr, uid, ids, name, arg, context=None): res = {} account_obj = self.pool.get('account.analytic.account') cr.execute('SELECT MAX(id) FROM res_users') max_user = cr.fetchone()[0] account_ids = [int(str(x/max_user - (x%max_user == 0 and 1 or 0))) for x in ids] user_ids = [int(str(x-((x/max_user - (x%max_user == 0 and 1 or 0)) *max_user))) for x in ids] parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', account_ids)])) if parent_ids: cr.execute('SELECT id, unit_amount ' \ 'FROM account_analytic_analysis_summary_user ' \ 'WHERE account_id =ANY(%s) ' \ 'AND "user" =ANY(%s)',(account_ids2, user_ids,)) for sum_id, unit_amount in cr.fetchall(): res[sum_id] = unit_amount for obj_id in ids: res.setdefault(obj_id, 0.0) for child_id in account_obj.search(cr, uid, [('parent_id', 'child_of', [int(str(obj_id/max_user - (obj_id%max_user == 0 and 1 or 0)))])]): if child_id != int(str(obj_id/max_user - (obj_id%max_user == 0 and 1 or 0))): res[obj_id] += res.get((child_id * max_user) + obj_id -((obj_id/max_user - (obj_id%max_user == 0 and 1 or 0)) * max_user), 0.0) for id in ids: res[id] = round(res.get(id, 0.0), 2) return res
476,720
def _unit_amount(self, cr, uid, ids, name, arg, context=None): res = {} account_obj = self.pool.get('account.analytic.account') cr.execute('SELECT MAX(id) FROM res_users') max_user = cr.fetchone()[0] account_ids = [int(str(x/max_user - (x%max_user == 0 and 1 or 0))) for x in ids] user_ids = [int(str(x-((x/max_user - (x%max_user == 0 and 1 or 0)) *max_user))) for x in ids] account_ids2 = account_obj.search(cr, uid, [('parent_id', 'child_of', account_ids)]) if account_ids2: cr.execute('SELECT id, unit_amount ' \ 'FROM account_analytic_analysis_summary_user ' \ 'WHERE account_id =ANY(%s) ' \ 'AND "user" =ANY(%s)',(account_ids2, user_ids,)) for sum_id, unit_amount in cr.fetchall(): res[sum_id] = unit_amount for obj_id in ids: res.setdefault(obj_id, 0.0) for child_id in account_obj.search(cr, uid, [('parent_id', 'child_of', [int(str(obj_id/max_user - (obj_id%max_user == 0 and 1 or 0)))])]): if child_id != int(str(obj_id/max_user - (obj_id%max_user == 0 and 1 or 0))): res[obj_id] += res.get((child_id * max_user) + obj_id -((obj_id/max_user - (obj_id%max_user == 0 and 1 or 0)) * max_user), 0.0) for id in ids: res[id] = round(res.get(id, 0.0), 2) return res
def _unit_amount(self, cr, uid, ids, name, arg, context=None): res = {} account_obj = self.pool.get('account.analytic.account') cr.execute('SELECT MAX(id) FROM res_users') max_user = cr.fetchone()[0] account_ids = [int(str(x/max_user - (x%max_user == 0 and 1 or 0))) for x in ids] user_ids = [int(str(x-((x/max_user - (x%max_user == 0 and 1 or 0)) *max_user))) for x in ids] account_ids2 = account_obj.search(cr, uid, [('parent_id', 'child_of', account_ids)]) if account_ids2: cr.execute('SELECT id, unit_amount ' \ 'FROM account_analytic_analysis_summary_user ' \ 'WHERE account_id IN %s ' \ 'AND "user" IN %s',(parent_ids, user_ids,)) for sum_id, unit_amount in cr.fetchall(): res[sum_id] = unit_amount for obj_id in ids: res.setdefault(obj_id, 0.0) for child_id in account_obj.search(cr, uid, [('parent_id', 'child_of', [int(str(obj_id/max_user - (obj_id%max_user == 0 and 1 or 0)))])]): if child_id != int(str(obj_id/max_user - (obj_id%max_user == 0 and 1 or 0))): res[obj_id] += res.get((child_id * max_user) + obj_id -((obj_id/max_user - (obj_id%max_user == 0 and 1 or 0)) * max_user), 0.0) for id in ids: res[id] = round(res.get(id, 0.0), 2) return res
476,721
def _unit_amount(self, cr, uid, ids, name, arg, context=None): res = {} account_obj = self.pool.get('account.analytic.account') account_ids = [int(str(int(x))[:-6]) for x in ids] month_ids = [int(str(int(x))[-6:]) for x in ids] account_ids2 = account_obj.search(cr, uid, [('parent_id', 'child_of', account_ids)]) if account_ids2: cr.execute('SELECT id, unit_amount ' \ 'FROM account_analytic_analysis_summary_month ' \ 'WHERE account_id =ANY(%s) ' \ 'AND month_id =ANY(%s) ',(account_ids2, month_ids,)) for sum_id, unit_amount in cr.fetchall(): res[sum_id] = unit_amount for obj_id in ids: res.setdefault(obj_id, 0.0) for child_id in account_obj.search(cr, uid, [('parent_id', 'child_of', [int(str(int(obj_id))[:-6])])]): if child_id != int(str(int(obj_id))[:-6]): res[obj_id] += res.get(int(child_id * 1000000 + int(str(int(obj_id))[-6:])), 0.0) for id in ids: res[id] = round(res.get(id, 0.0), 2) return res
def _unit_amount(self, cr, uid, ids, name, arg, context=None): res = {} account_obj = self.pool.get('account.analytic.account') account_ids = [int(str(int(x))[:-6]) for x in ids] month_ids = [int(str(int(x))[-6:]) for x in ids] parent_ids = tuple(self.search(cr, uid, [('parent_id', 'child_of', account_ids)])) if parent_ids: cr.execute('SELECT id, unit_amount ' \ 'FROM account_analytic_analysis_summary_month ' \ 'WHERE account_id =ANY(%s) ' \ 'AND month_id =ANY(%s) ',(account_ids2, month_ids,)) for sum_id, unit_amount in cr.fetchall(): res[sum_id] = unit_amount for obj_id in ids: res.setdefault(obj_id, 0.0) for child_id in account_obj.search(cr, uid, [('parent_id', 'child_of', [int(str(int(obj_id))[:-6])])]): if child_id != int(str(int(obj_id))[:-6]): res[obj_id] += res.get(int(child_id * 1000000 + int(str(int(obj_id))[-6:])), 0.0) for id in ids: res[id] = round(res.get(id, 0.0), 2) return res
476,722
def _unit_amount(self, cr, uid, ids, name, arg, context=None): res = {} account_obj = self.pool.get('account.analytic.account') account_ids = [int(str(int(x))[:-6]) for x in ids] month_ids = [int(str(int(x))[-6:]) for x in ids] account_ids2 = account_obj.search(cr, uid, [('parent_id', 'child_of', account_ids)]) if account_ids2: cr.execute('SELECT id, unit_amount ' \ 'FROM account_analytic_analysis_summary_month ' \ 'WHERE account_id =ANY(%s) ' \ 'AND month_id =ANY(%s) ',(account_ids2, month_ids,)) for sum_id, unit_amount in cr.fetchall(): res[sum_id] = unit_amount for obj_id in ids: res.setdefault(obj_id, 0.0) for child_id in account_obj.search(cr, uid, [('parent_id', 'child_of', [int(str(int(obj_id))[:-6])])]): if child_id != int(str(int(obj_id))[:-6]): res[obj_id] += res.get(int(child_id * 1000000 + int(str(int(obj_id))[-6:])), 0.0) for id in ids: res[id] = round(res.get(id, 0.0), 2) return res
def _unit_amount(self, cr, uid, ids, name, arg, context=None): res = {} account_obj = self.pool.get('account.analytic.account') account_ids = [int(str(int(x))[:-6]) for x in ids] month_ids = [int(str(int(x))[-6:]) for x in ids] account_ids2 = account_obj.search(cr, uid, [('parent_id', 'child_of', account_ids)]) if account_ids2: cr.execute('SELECT id, unit_amount ' \ 'FROM account_analytic_analysis_summary_month ' \ 'WHERE account_id IN %s ' \ 'AND month_id IN %s ',(parent_ids, month_ids,)) for sum_id, unit_amount in cr.fetchall(): res[sum_id] = unit_amount for obj_id in ids: res.setdefault(obj_id, 0.0) for child_id in account_obj.search(cr, uid, [('parent_id', 'child_of', [int(str(int(obj_id))[:-6])])]): if child_id != int(str(int(obj_id))[:-6]): res[obj_id] += res.get(int(child_id * 1000000 + int(str(int(obj_id))[-6:])), 0.0) for id in ids: res[id] = round(res.get(id, 0.0), 2) return res
476,723
def assign_tool(self, newtool): # Deactivate old button item = self.tools[self.current_tool][4] item.set_properties(pixbuf = gcompris.utils.load_pixmap(gcompris.skin.image_to_skin(self.tools[self.current_tool][1])))
def assign_tool(self, newtool): # Deactivate old button item = self.tools[self.current_tool][4] item.set_properties(pixbuf = gcompris.utils.load_pixmap(gcompris.skin.image_to_skin(self.tools[self.current_tool][1])))
476,724
def assign_tool(self, newtool): # Deactivate old button item = self.tools[self.current_tool][4] item.set_properties(pixbuf = gcompris.utils.load_pixmap(gcompris.skin.image_to_skin(self.tools[self.current_tool][1])))
def assign_tool(self, newtool): # Deactivate old button item = self.tools[self.current_tool][4] item.set_properties(pixbuf = gcompris.utils.load_pixmap(gcompris.skin.image_to_skin(self.tools[self.current_tool][1])))
476,725
def sun_item_event(self, widget, target, event=None): if event.type == gtk.gdk.BUTTON_PRESS: if event.button == 1: if not self.sun_on : gcompris.utils.item_focus_remove(self.sunitem, None) gcompris.sound.play_ogg("sounds/bleep.wav") trip_y = self.sunitem_target_y1 - self.sunitem_orig_y1 if self.sun_connect_handler: self.sunitem.disconnect(self.sun_connect_handler) self.sun_connect_handler = self.sunitem.connect("animation-finished", self.sun_up_arrived) self.sunitem.animate(0, trip_y, 1, 1, True, int(self.timerinc*abs(trip_y)), self.step_time, goocanvas.ANIMATE_FREEZE)
def sun_item_event(self, widget, target, event=None): if event.type == gtk.gdk.BUTTON_PRESS: if event.button == 1: if not self.sun_on and not self.cloud_on: gcompris.utils.item_focus_remove(self.sunitem, None) gcompris.sound.play_ogg("sounds/bleep.wav") trip_y = self.sunitem_target_y1 - self.sunitem_orig_y1 if self.sun_connect_handler: self.sunitem.disconnect(self.sun_connect_handler) self.sun_connect_handler = self.sunitem.connect("animation-finished", self.sun_up_arrived) self.sunitem.animate(0, trip_y, 1, 1, True, int(self.timerinc*abs(trip_y)), self.step_time, goocanvas.ANIMATE_FREEZE)
476,726
def parseText(self): if self.verbose: print "Processing " + self.titleContent inWord = wiktio.Word()
def parseText(self): if self.verbose: print "Processing " + self.titleContent inWord = wiktio.Word()
476,727
def __init__(self, gcomprisBoard):
def __init__(self, gcomprisBoard):
476,728
def draw_colors(self):
def draw_colors(self):
476,729
def draw_drawing_area(self, step):
def draw_drawing_area(self, step):
476,730
def draw_grid(self, x1, x2, y1, y2, step):
def draw_grid(self, x1, x2, y1, y2, step):
476,731
def draw_grid(self, x1, x2, y1, y2, step):
def draw_grid(self, x1, x2, y1, y2, step):
476,732
def draw_grid(self, x1, x2, y1, y2, step):
def draw_grid(self, x1, x2, y1, y2, step):
476,733
def draw_grid(self, x1, x2, y1, y2, step):
def draw_grid(self, x1, x2, y1, y2, step):
476,734
def draw_grid(self, x1, x2, y1, y2, step):
def draw_grid(self, x1, x2, y1, y2, step):
476,735
def fillin_item_event(self, item, target, event, drawing_item_index): if event.type == gtk.gdk.BUTTON_PRESS: if event.button == 1: if self.tools[self.current_tool][0] == "FILL": item.props.fill_color_rgba = self.colors[self.current_color] | self.color_fill # Reset the item in our list self.current_drawing[drawing_item_index]['fill_color_rgba'] = \ self.colors[self.current_color] | self.color_fill gcompris.sound.play_ogg("sounds/paint1.wav") return True return False
def fillin_item_event(self, item, target, event, drawing_item_index): if event.type == gtk.gdk.BUTTON_PRESS: if event.button == 1: if self.tools[self.current_tool][0] == "FILL": item.props.fill_color_rgba = self.colors[self.current_color] | C_FILL # Reset the item in our list self.current_drawing[drawing_item_index]['fill_color_rgba'] = \ self.colors[self.current_color] | self.color_fill gcompris.sound.play_ogg("sounds/paint1.wav") return True return False
476,736
def fillin_item_event(self, item, target, event, drawing_item_index): if event.type == gtk.gdk.BUTTON_PRESS: if event.button == 1: if self.tools[self.current_tool][0] == "FILL": item.props.fill_color_rgba = self.colors[self.current_color] | self.color_fill # Reset the item in our list self.current_drawing[drawing_item_index]['fill_color_rgba'] = \ self.colors[self.current_color] | self.color_fill gcompris.sound.play_ogg("sounds/paint1.wav") return True return False
def fillin_item_event(self, item, target, event, drawing_item_index): if event.type == gtk.gdk.BUTTON_PRESS: if event.button == 1: if self.tools[self.current_tool][0] == "FILL": item.props.fill_color_rgba = self.colors[self.current_color] | C_FILL # Reset the item in our list self.current_drawing[drawing_item_index]['fill_color_rgba'] = \ self.colors[self.current_color] | C_FILL gcompris.sound.play_ogg("sounds/paint1.wav") return True return False
476,737
def fillout_item_event(self, item, target, event, drawing_item_index): if event.type == gtk.gdk.BUTTON_PRESS: if event.button == 1: if self.tools[self.current_tool][0] == "FILL": item.props.stroke_color_rgba = self.colors[self.current_color] | self.color_stroke # Reset the item in our list self.current_drawing[drawing_item_index]['stroke_color_rgba'] = \ self.colors[self.current_color] | self.color_stroke gcompris.sound.play_ogg("sounds/paint1.wav") return True return False
def fillout_item_event(self, item, target, event, drawing_item_index): if event.type == gtk.gdk.BUTTON_PRESS: if event.button == 1: if self.tools[self.current_tool][0] == "FILL": item.props.stroke_color_rgba = self.colors[self.current_color] | C_STROKE # Reset the item in our list self.current_drawing[drawing_item_index]['stroke_color_rgba'] = \ self.colors[self.current_color] | self.color_stroke gcompris.sound.play_ogg("sounds/paint1.wav") return True return False
476,738
def fillout_item_event(self, item, target, event, drawing_item_index): if event.type == gtk.gdk.BUTTON_PRESS: if event.button == 1: if self.tools[self.current_tool][0] == "FILL": item.props.stroke_color_rgba = self.colors[self.current_color] | self.color_stroke # Reset the item in our list self.current_drawing[drawing_item_index]['stroke_color_rgba'] = \ self.colors[self.current_color] | self.color_stroke gcompris.sound.play_ogg("sounds/paint1.wav") return True return False
def fillout_item_event(self, item, target, event, drawing_item_index): if event.type == gtk.gdk.BUTTON_PRESS: if event.button == 1: if self.tools[self.current_tool][0] == "FILL": item.props.stroke_color_rgba = self.colors[self.current_color] | C_STROKE # Reset the item in our list self.current_drawing[drawing_item_index]['stroke_color_rgba'] = \ self.colors[self.current_color] | C_STROKE gcompris.sound.play_ogg("sounds/paint1.wav") return True return False
476,739
def create_item_event(self, item, target, event):
def create_item_event(self, item, target, event):
476,740
def create_item_event(self, item, target, event):
def create_item_event(self, item, target, event):
476,741
def create_item_event(self, item, target, event):
def create_item_event(self, item, target, event):
476,742
def create_item_event(self, item, target, event):
def create_item_event(self, item, target, event):
476,743
def create_item_event(self, item, target, event):
def create_item_event(self, item, target, event):
476,744
def create_item_event(self, item, target, event):
def create_item_event(self, item, target, event):
476,745
def create_item_event(self, item, target, event):
def create_item_event(self, item, target, event):
476,746
def create_item_event(self, item, target, event):
def create_item_event(self, item, target, event):
476,747
def create_item_event(self, item, target, event):
def create_item_event(self, item, target, event):
476,748
def create_item_event(self, item, target, event):
def create_item_event(self, item, target, event):
476,749
def init_item_list(self):
def init_item_list(self):
476,750
def init_item_list(self):
def init_item_list(self):
476,751
def init_item_list(self):
def init_item_list(self):
476,752
def init_item_list(self):
def init_item_list(self):
476,753
def init_item_list(self):
def init_item_list(self):
476,754
def init_item_list(self):
def init_item_list(self):
476,755
def init_item_list(self):
def init_item_list(self):
476,756
def init_item_list(self):
def init_item_list(self):
476,757
def init_item_list(self):
def init_item_list(self):
476,758
def init_item_list(self):
def init_item_list(self):
476,759
def init_item_list(self):
def init_item_list(self):
476,760
def init_item_list(self):
def init_item_list(self):
476,761
def init_item_list(self):
def init_item_list(self):
476,762
def init_item_list(self):
def init_item_list(self):
476,763
def init_item_list(self):
def init_item_list(self):
476,764
def init_item_list(self):
def init_item_list(self):
476,765
def init_item_list(self):
def init_item_list(self):
476,766
def init_item_list(self):
def init_item_list(self):
476,767
def init_item_list(self):
def init_item_list(self):
476,768
def init_item_list(self):
def init_item_list(self):
476,769
def init_item_list(self):
def init_item_list(self):
476,770
def init_item_list(self):
def init_item_list(self):
476,771
def init_item_list(self):
def init_item_list(self):
476,772
def init_item_list(self):
def init_item_list(self):
476,773
def init_item_list(self):
def init_item_list(self):
476,774
def init_item_list(self):
def init_item_list(self):
476,775
def init_item_list(self):
def init_item_list(self):
476,776
def init_item_list(self):
def init_item_list(self):
476,777
def init_item_list(self):
def init_item_list(self):
476,778
def init_item_list(self):
def init_item_list(self):
476,779
def init_item_list(self):
def init_item_list(self):
476,780
def init_item_list(self):
def init_item_list(self):
476,781
def init_item_list(self):
def init_item_list(self):
476,782
def init_item_list(self):
def init_item_list(self):
476,783
def init_item_list(self):
def init_item_list(self):
476,784
def init_item_list(self):
def init_item_list(self):
476,785
def init_item_list(self):
def init_item_list(self):
476,786
def init_item_list(self):
def init_item_list(self):
476,787
def init_item_list(self):
def init_item_list(self):
476,788
def start(self): self.gcomprisBoard.level=1 self.gcomprisBoard.maxlevel=9 self.gcomprisBoard.sublevel=1 self.gcomprisBoard.number_of_sublevel=1 gcompris.bar_set(gcompris.BAR_LEVEL) gcompris.bar_location(5, -1, 0.8)
def start(self): self.gcomprisBoard.level=1 self.gcomprisBoard.maxlevel=9 self.gcomprisBoard.sublevel=1 self.gcomprisBoard.number_of_sublevel=1 gcompris.bar_set(gcompris.BAR_LEVEL) gcompris.bar_location(5, -1, 0.8)
476,789
def next_level(self): gcompris.score.end() self.rootitem.remove() self.rootitem = goocanvas.Group(parent = self.gcomprisBoard.canvas.get_root_item()) self.display_level()
def next_level(self): gcompris.score.end() self.rootitem.remove() self.rootitem = goocanvas.Group(parent = self.backitem) self.display_level()
476,790
def endElement(self, name):
def endElement(self, name):
476,791
def wiki2xml(self, text):
def wiki2xml(self, text):
476,792
def display_game(self): # The grid we display # It contains all the graphic items self.items = self.create_empty_list()
def display_game(self): # The grid we display # It contains all the graphic items self.items = self.create_empty_list()
476,793
def newGame(self): self.cleanup()
def newGame(self): self.cleanup()
476,794
def __init__(self, board, root, x, y, index, board_size, scale): self.board = board
def __init__(self, board, root, x, y, index, board_size, scale): self.board = board
476,795
def indents2xml(self, text): result = re.search("[*#:;]+[ ]*", text) if not result: close = "" while self.lilevel: close += self.lilevel.pop() text = close + text return text
def indents2xml(self, text): result = re.search("[*#:;]+[ ]*", text) if not result: close = "" while self.lilevel: close += self.lilevel.pop() text = close + text return text
476,796
def wiki2xml(self, text):
def wiki2xml(self, text):
476,797
def wiki2xml(self, text):
def wiki2xml(self, text):
476,798
def parseText(self): inDefinition = False inAnagram = False inSynonym = False inAntonym = False inPron = False wordType = "" wordSubType = ""
def parseText(self): inDefinition = False inAnagram = False inSynonym = False inAntonym = False inPron = False wordType = "" wordSubType = ""
476,799