Odoo Help

Welcome!

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.

0

problems with pop up context

By
Edson Murima
on 5/6/13, 12:41 PM 1,298 views

hay guys .... iam trying to pass a value from e context in my pop up view like is showed above..

class dotcom_movimento_custo_reflexao(osv.osv):

_name='dotcom.contabilidade.movimento.custo.fluxo'
_columns={
    'conta_origem_id':fields.many2one('dotcom.contabilidade.lancamentos.diarios','Conta Origem'),
    'plano_centro_id':fields.many2one('dotcom.contabilidade.centros.custos','Plano de C. Custo'),
    'centro_id':fields.many2one('dotcom.contabilidade.conta.centro.custos','C. Custo'),
    'valor':fields.float('Valor',required=True),
    'valor_reduzido':fields.float('Valor',required=True),
    'movimento_reflexao_id':fields.many2one('dotcom.contabilidade.movimentos','Movimentos'),
    'lancamento_custo_id':fields.many2one('dotcom.contabilidade.lancamento.movimento.custo','Lancamento'),
    'natureza':fields.selection([('debito','D'),('credito','C')],'Natureza',readonly=False),
    'percentagem':fields.float('Percentagem (%)'),
    'state':fields.selection([('pai','pai'),('filho','filho')]),
    'parente_sup':fields.many2one('dotcom.contabilidade.movimento.custo.fluxo','Parente'),
    'acerto':fields.selection([('all','MP/MS'),('mp','MP'),('ms','MS')],'Conversão Moeda',help='*MP - Moeda Principal\n*MS - Moeda Secundária'),
}

_default={
    'state': 'filho',
    'conta_origem_id': lambda self, cr, uid, c: c.get('conta_origem_id', False),
    'valor': lambda self, cr, uid, c: c.get('valor', False),
    'movimento_reflexao_id': lambda self, cr, uid, c: c.get('movimento_reflexao_id', False),
}
_rec_name='natureza'
<form string="Lancamentos"> <group col="6"> <field name="conta_id"/> <field name="valor_origem"/> <field name="plano_centro_id" invisible="1"/> <field name="natureza"/> <field colspan="6" name="lancamentos_reflexao_custo_ids" widget="one2many_list" nolabel="1" domain="['movimento_reflexao_id', '=', active_id]" context="{'movimento_reflexao_id': active_id}"> <tree editable="bottom"> <field name="conta_origem_id" invisible="1"/> <field name="plano_centro_id" on_change="on_change_plano(plano_centro_id)"/> <field name="centro_id"/> <field name="percentagem"/> <field name="valor" ref="valor_origem"/> <field name="natureza"/> <field name="parente_sup" invisible="1"/> </tree> </field> <label string="" colspan="3"/> <newline/> <label string="" colspan="5"/> <button string="Guardar" name="actualizar" type="object"/> </group> </form>

but my context become empty.....how can i solve this.???

0

Martin

--Martin--
1978
| 5 6 8
Cornwall, Canada
--Martin--

Analysing, designing, coding and mentoring since 1975. Kilobytes to terabytes. Punch cards to punchy sites. My OpenERP video series: http://www.youtube.com/playlist?list=PLq7op4J183lX44ZlXPiHxUpRvmmRDtxye My Google Speadsheets --> OpenERP Data Pump project: http://martinhbramwell.github.io/GData_OpenERP_Data_Pump My email (with spaces removed) : mhb . warehouseman @ gmail . com

Martin
On 5/6/13, 12:46 PM

Please have respect for the other members here.

On the site : Free Formatter it took me 10 secs to do this:

 <?xml version="1.0" encoding="UTF-8"?>
 <form string="Lancamentos">
    <group col="6">
       <field name="conta_id" />
       <field name="valor_origem" />
       <field name="plano_centro_id" invisible="1" />
       <field name="natureza" />
       <field colspan="6" name="lancamentos_reflexao_custo_ids" widget="one2many_list" nolabel="1" domain="['movimento_reflexao_id', '=', active_id]" context="{'movimento_reflexao_id': active_id}">
          <tree editable="bottom">
             <field name="conta_origem_id" invisible="1" />
             <field name="plano_centro_id" on_change="on_change_plano(plano_centro_id)" />
             <field name="centro_id" />
             <field name="percentagem" />
             <field name="valor" ref="valor_origem" />
             <field name="natureza" />
             <field name="parente_sup" invisible="1" />
          </tree>
       </field>
       <label string="" colspan="3" />
       <newline />
       <label string="" colspan="5" />
       <button string="Guardar" name="actualizar" type="object" />
    </group>
 </form>

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)

Stats

Asked: 5/6/13, 12:41 PM
Seen: 1298 times
Last updated: 3/16/15, 8:10 AM