OCA/crm

CRM Phonecall: convert opportunit useless code

Closed this issue · 6 comments

In crm_phonecall module there is code in models/crm_phonecall.py that do nothing. v10-13

    @api.multi
    def convert_opportunity(self, opportunity_summary=False, partner_id=False,
                            planned_revenue=0.0, probability=0.0):
        partner = self.env['res.partner']
        # ...
        default_contact = False
        for call in self:
            if not partner_id:
                partner_id = call.partner_id.id or False
            if partner_id:
                address_id = partner.address_get().get('contact', False)
                # We need this here?
                # address_id = partner.browse(partner_id).address_get().get('contact', False)
                if address_id:
                    default_contact = address_id.id
                    # We need this here?
                    # default_contact = partner.browse(address_id) here?
            # using default_contact

Why do you say it's doing nothing?

Why do you say it's doing nothing?

partner.address_get() always returns {'contact': False}. default_contact is always False.

I don't think so. It depends on your contacts data.

OK, then do a PR changing the code to make sense.

There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.