Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
2612 มุมมอง

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.

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

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 ?

คำตอบที่ดีที่สุด

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,

อวตาร
ละทิ้ง