Skip to Content
Menu
This question has been flagged
1 Reply
1440 Views

Hi everyone, i'm beginer in odoo

Could someone explain me what this python-method do:

    @api.cr_uid_ids_context
    def do_enter_transfer_details(self, cr, uid, picking, context=None):
        if not context:
            context = {}
        else:
            context = context.copy()
        context.update({
            'active_model': self._name,
            'active_ids': picking,
            'active_id': len(picking) and picking[0] or False
        })

        created_id = self.pool['stock.transfer_details'].create(cr, uid, {'picking_id': len(picking) and picking[0] or False}, context)
        return self.pool['stock.transfer_details'].wizard_view(cr, uid, created_id, context)

Avatar
Discard
Best Answer

Hi

@api.cr_uid_ids_context: This will decorate a traditional-style method that takes 'cr', 'uid', 'ids', 'context' as parameters. Such a method:

So the function will automatically takes all parameters

For further knowledge refer :http://www.zbeanztech.com/blog/method-decorators-odoo-8\

this function makes a transfer of delivery note of status draft to status confirmed and created a account move in journal

\

Avatar
Discard