Odoo Help


This community 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.


How to union data object on openerp?

on 1/6/14, 8:14 AM 976 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;">

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)


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