Skip to Content
Menu
This question has been flagged

i want to use write_date from crm_history,but my odoo code always use write date from the crm_lead


one2manyfield:

'history_id': fields.one2many('crm.history', 'form_id'), #form id is the ID from crm_lead table


Implementation:

    #these codes is from crm_lead model

    @api.multi

    @api.depends('history_id.write_date')

    def _apply_prospect_date(self):

        for record in self:

            if record.write_date != False:

                record.prospect_date = record.write_date #this part always use crm_lead write_date while i want to get from crm_history


thanks in advance

Avatar
Discard
Related Posts Replies Views Activity
1
Jun 24
950
2
Sep 22
1793
0
Jul 22
2723
2
Oct 19
2477
1
Jun 18
2958