콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
4575 화면

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>

 

 

아바타
취소
베스트 답변

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

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

작성자

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

작성자

yes showing in form view

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

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