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

update data from one model to another

By
joshi
on 4/1/15, 1:11 AM 382 views

Hi,, i need to update details from action to amount ,what changes i have to do.


from openerp.osv import fields,osv

class daily_action(osv.osv):

_name = 'daily.action'

_description = 'dailyaction'

_columns={

'subject':fields.char('Subject', size=128,required=True),

'date':fields.date('Date',required=True),

'note':fields.text('Notes'),

'amount':fields.float('Amount',required=True),

'type':fields.selection([('transport', 'Transport'),('household','Household'),('personal','Personal')],'Type',required=True),

}

class daily_amount(osv.osv):

_name = 'daily.amount'

_description = 'dailyamount'

_columns = {

'x_subject': fields.char('Subject', size=128,required=True),

'x_date': fields.date('Date', required=True),

'x_amount': fields.float('Amount', required=True),

}



<?xml version="1.0" encoding="UTF-8"?>

<openerp>

<data>

<menuitem name="Dailyaction" id="base.Daily_Transaction_root" sequence="110"/>

<menuitem name="Dailyaction" id="menu_Daily_Transaction_root" parent="base.Daily_Transaction_root"/>

<record id="view_Daily_Transaction_form" model="ir.ui.view">

<field name="name">daily action</field>

<field name="model">daily.action</field>

<field name="arch" type="xml">

<form string="Daily Transaction" version="8.0">

<group>

<field name="subject" placeholder="Subject"/>

<field name="date" />

<field name="type" />

<field name="amount" />

<field name="note" />

</group>

</form>

</field>

</record>

<record model="ir.ui.view" id="orders_order_lines_tree_view">

<field name="name">daily amount</field>

<field name="model">daily.amount</field>

<field name="arch" type="xml">

<tree string="daily amount" >

<field name="x_subject" />

<field name="x_date" />

<field name="x_amount" sum="Total" />

</tree>

</field>

</record>

<!--actions -->

<record model="ir.actions.act_window" id="action_Daily_Transaction">

<field name="name">daily update action</field>

<field name="res_model">daily.action</field>

<field name="view_type">form</field>

<field name="view_mode">tree,form</field>

<field name="search_view_id" eval="False" />

<field name="context">{}</field>

<field name="help">Create New Daily Transaction</field>

</record>

<menuitem name="Action" id="menu_Daily_Transaction" parent="menu_Daily_Transaction_root"

sequence="1" action="action_Daily_Transaction"/>

<record model="ir.actions.act_window" id="action_amount_Transaction">

<field name="name">daily amount action</field>

<field name="res_model">daily.amount</field>

<field name="view_type">form</field>

<field name="view_mode">tree,form</field>

<field name="search_view_id" />

<field name="context">{}</field>

<field name="help">Create New Daily Transaction</field>

</record>

<menuitem name="Amount" id="menu_amount_Transaction" parent="menu_Daily_Transaction_root"

sequence="3" action="action_amount_Transaction"/>

</data>

</openerp>

 

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

1 follower(s)

Stats

Asked: 4/1/15, 1:11 AM
Seen: 382 times
Last updated: 4/1/15, 1:11 AM