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.

1

contact creation - customer flag off by default

By
Erik Nagler
on 1/22/14, 10:40 PM 2,195 views

When creating a contact/partner it is always created as a customer on default. The flag can be found under the tab 'Sales & Purchases'. The field 'customer' is always flagged by default. How to change it so it is not flagged by default.

1

Gopakumar N G

--Gopakumar N G--
1198
| 5 3 7
Cochin, India
--Gopakumar N G--

Senior Software Engineer at BroadTech IT Solutions Pvt. Ltd.

Gopakumar N G
On 1/23/14, 12:54 AM

Inherit the res_partner model and add in defaults customer: False.

You don't have to edit in the crm module. First create folder in the addons folder, name it as partner_customization. Then in that folder create 2 files named __init__.py and __openerp__.py. Then in __init__.py add the line:

import partner

then in __openerp__.py add the following:

{
    'name': 'Partner Customization',
    'version': '0.1',
    'category': 'Custom',
    'description': """
    """,
    'author': 'Gopakumar',
    'depends': [
        'crm'
        ],
    'init_xml': [],
    'update_xml': [
    ],
    'demo_xml': [],
    'test': [],
    'installable': True,
    'active': False,

}

Then create one more files named partner.py . Then in partner.py add the following:

from openerp.osv import fields, osv

class res_partner(osv.osv):
    _inherit = 'res.partner'
    _defaults = {
    'customer': False
    }

Then restart the server, then update the module list and install the new module.

Thank you very much Gopakumar. Its works very well.

Erik Nagler
on 1/26/14, 3:38 PM
0
Erik Nagler
On 1/23/14, 7:53 PM

Could you provide me with some additional information, please? I have put it in the res_partner.py file in the /addons/crm/ module: _defaults = { 'customer' : False, }

The only effect this had was to totally shut down my erp. ;-) I am new to the system and dont know where to make these changes, but I am willing to experiement and learn.

I have updated the answer.

Gopakumar N G
on 1/24/14, 1:26 AM

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: 1/22/14, 10:40 PM
Seen: 2195 times
Last updated: 3/16/15, 8:10 AM