Odoo Help

0

how to create many2one fields in openerp7

By
Arunagiri
on 12/25/13, 3:38 PM 1,109 views

hey please anybody help me i have problem in my program tell about how to create many 2one fields

0
Abhishek H Menon
On 12/26/13, 5:23 AM
from osv import fields, osv
class sample(osv.osv)
              _name = 'sample.sample'
              _columns = {
                      'm2ofield1': fields.many2one('relation1','M2O'),
                       }
sample()

Here m2ofield1 is the many2one field. relation1 is the table which you are tending to relate the table sample.sample with. Here the point should be noted is the table relation1 should exists before sample.sample otherwise error will occur

0

Ray Carnes

--Ray Carnes--
16773
| 9 7 9
Atlanta, United States
--Ray Carnes--

Senior Odoo Analyst

OpenERP 6.1, 7.0; Odoo 8.0, 9.0, 10.0.

Completed Odoo Functional and Technical Training.

Major Skills:

  • User Needs and GAP Analysis;

  • Functional and Technical Design;

  • Prototyping and Proof of Concepts;

  • Requirements Specifications;

  • Agile Implementation;

  • Data Migration;

  • Configuration & Customization (UI and code);

  • Integration - Odoo and non Odoo Applications and Services;

  • Training and Knowledge Transfer;

  • Go Live Support;

  • Helpdesk;

  • Version Upgrades and Migration.

  • Accounting Expert.

I have over 20 years of experience empowering and enabling users with enterprise information systems that make a real and measurable difference in their ability to proactively manage their businesses and organizations. 

I am a skilled Communicator and I only take the serious things seriously!

Ray Carnes
On 12/25/13, 6:51 PM
fields.one2many(
    'other.object.name',
    'Field relation id',
    'Fieldname' 
    [, Optional parameters])

https://doc.openerp.com/trunk/server/03_module_dev_02/

Example:

class travel_hostel(osv.osv):
   _name = 'travel.hostel'
   _inherit = 'res.partner'

   _columns = {
   'rooms_id': fields.one2many('travel.room', 'hostel_id', 'Rooms'),
   'quality': fields.char('Quality', size=16),
   }

https://doc.openerp.com/trunk/server/03_module_dev_05/

About This Community

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

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)

Stats

Asked: 12/25/13, 3:38 PM
Seen: 1109 times
Last updated: 3/16/15, 8:10 AM