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

How to add "Existing model" fields data to the "Customised model" fields ?

By
Sai kumar
on 3/23/16, 4:57 AM 225 views

Hey, Can anyone please help me finding the solution for this.

      I've created a new menu "AssetMenu1" under "Projects" and created some customized fields in it. Now I want to map the existing "Assets" menu fields data(which is under "Accounting") to the newly created menu "AssetMenu1".

Please guide me.

Thankyou.

0
Sai kumar
On 3/23/16, 5:59 AM

Hi Jignesh, thanks for your answer.

   I inherited the account.asset.asset model. But, My requirement is that, whenever I create a record in pre-defined "Asset" menu, I should be able to access the same data in the fields into the customized menu "AssetMenu1" created by me.

Here is my code:

# assetproject.py


from openerp import fields,models

class asset_real(models.Model):

      _name='account.asset.asset'

     _inherit='account.asset.asset'

      asset_ids=fields.One2many('asset.submenu','name','Asset')


class asset_submenu(models.Model):

       _name='asset.submenu'

       name=fields.Many2one('account.asset.asset',String="Asset Name")

      reference=fields.Char("Reference")

      gross_value=fields.Many2one('account.asset.asset',String="Gross Value")

 

Do you not access data from your custom model ?

Jignesh Mehta
on 3/23/16, 8:22 AM
0

Jignesh Mehta

--Jignesh Mehta--
2087
| 6 4 8
Surat, India
--Jignesh Mehta--


Jignesh Mehta
On 3/23/16, 5:24 AM

Hello Sai Kumar,


Inherit the account.asset.asset model.

Add the fields which is want by you. create action for it and give it to your custom menu.


Hope it will works for you.

Thanks,

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: 3/23/16, 4:57 AM
Seen: 225 times
Last updated: 3/23/16, 5:59 AM