Odoo Help


How to union data object on openerp?

on 1/6/14, 8:14 AM 1,327 views

i have module _inherit = 'account.analytic.account' i want print fields 'name.debti,credi' from account.account.


import time
from report import report_sxw
from osv import osv
from openerp import pooler

class iec_report_webkit(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
    super(iec_report_webkit, self).__init__(cr, uid, name, context=context)
    self.pool = pooler.get_pool(self.cr.dbname)
    self.cursor = self.cr

    name_obj= self.pool.get('account.account').browse(cr, uid, uid).name
    credit_obj= self.pool.get('account.account').browse(cr, uid, uid).credit
    debit_obj= self.pool.get('account.account').browse(cr, uid, uid).debit
    parent_obj= self.pool.get('account.account').browse(cr, uid, uid).parent_id

            'time': time,
            'uid': uid,

                  'addons/iec/report/iec_report_webkit.mako', parser=iec_report_webkit)

mako templet:

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.0 Transitional//EN”>
<head> </head>
<table width="500" border="0" align="center">
<td colspan="2" style="background-color:#FFA500;">
<h1 align="center">
  report webkit
 <td style="background-color:#eeeeee;height:200px;width:400px;">
<table dir="rtl" align="center" border="1"  bordercolor="#c1d3e1"  size="90*90" >
       <tr align="right">
       <th font-size="30" >field1</th>
       <th font-size="30" >field2</th>
      <th font-size="30" >field3</th>
       <th font-size="30" >field4</th>
      %for o in objects :
  <td colspan="2" style="background-color:#FFA500;text-align:center;">

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.


Odoo Training Center

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

Test it now

Question tools

0 follower(s)


Asked: 1/6/14, 8:14 AM
Seen: 1327 times
Last updated: 3/16/15, 8:10 AM