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 a date [ my field is Closing Date] (plot on calendar) for a custom module in openerp 7

By
Odoo
on 8/21/14, 5:30 AM 891 views

Hi all,

when i create a closing date in my custom model .it should  add in caledar view with some indication like  leave request  in hr module how to do it via a form ..need a help

Here I attached my code -----

class crm_lead(osv.osv):
    
    _inherit = 'crm.lead'

    _columns = {
            'closing_date':fields.date('Closing Date',required=True),# I want to add this date in openerp calendar view when #form is save
            'walk_thorugh_date': fields.date('Walk-through Date',required=True),
            'tender_no': fields.char('Tender No:')

    }
    
    _defaults={
                'tender_no': lambda obj, cr, uid, context: '',
                
              }
    
    def create(self, cr, uid, vals, context=None):
           vals['tender_no'] = self.pool.get('ir.sequence').get(cr, uid,'crm.lead')
           return super(crm_lead, self).create(cr, uid, vals, context=context)
 
crm_lead()

<record model="ir.ui.view" id="crm_calendar_view_inherit">
    <field name="name">CRM Calendar</field>
    <field name="model">crm.lead</field>
    <field name="inherit_id" ref="crm.crm_case_calendar_view_leads"/>
    <field name="type">calendar</field>
    <field name="arch" type="xml">
    <field name="name" position="after">
       <field name="closing_date" />
    </field>
    </field>
</record>

               

 

   <record id="opertunities_view_inherited" model="ir.ui.view">
                <field name="name">Opertunity view</field>
                <field name="model">crm.lead</field>
                <field name="type">form</field>
                <field name="inherit_id" ref="crm.crm_case_form_view_oppor"/>
                <field name="arch" type="xml">
                    <xpath expr="/form/sheet/group/group/field[@name='phone']" position="after">
                    
                       <group> <field name="closing_date"/>
                        <field name="walk_thorugh_date"/>
                                                        </group>
                    </xpath>
                    
                    
                    <xpath expr="/form/sheet/group/group/field[@name='priority']" position="after">
                    
                    <group>
                    
                     <field name="tender_no" />
                                                             </group>
                    
                    
                    </xpath>
                    
                </field>
                </record>

 

 

0

Prakash

--Prakash--
3173
| 5 4 7
Bikaner, India
--Prakash--

OpenERP Devloper at SunARC Technology

Prakash
On 8/21/14, 5:39 AM

In CRM Module Inherit Calendar view and add closing_date field.

Example,

<record model="ir.ui.view" id="crm_calendar_view_inherit">
    <field name="name">CRM Calendar</field>
    <field name="model">crm.lead</field>
    <field name="inherit_id" ref="crm.crm_case_calendar_view_leads"/>
    <field name="type">calendar</field>
    <field name="arch" type="xml">
    <field name="name" position="after">
       <field name="closing_date" />
    </field>
</record>
    

it is not working in calendar i added your code but not shows in calender pls check my code...

Odoo
on 8/21/14, 6:10 AM

closing_data field is it shows in form view?...

Prakash
on 8/21/14, 7:06 AM

yes this two fields are showing... in form view

Odoo
on 8/21/14, 7:31 AM

yes showing in form view

Odoo
on 8/21/14, 7:31 AM

The above inherit calendar here working its shows date in the menu Sales --> Opportunities calendar view shows extra added field.

Prakash
on 8/21/14, 7:45 AM

The above inherit calendar here working its shows date in the menu Sales --> Opportunities calendar view shows extra added field.

Prakash
on 8/21/14, 7:46 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

2 follower(s)

Stats

Asked: 8/21/14, 5:30 AM
Seen: 891 times
Last updated: 3/16/15, 8:10 AM