Skip to Content
Menu
This question has been flagged
971 Views

Hi,

Invoice barcode and return invoice barcode are the same but I want the return invoice barcode to be unique; Please help me how to change the following code?

    def refund(selfcruididscontext=None):
        clone_list = []
        line_obj = self.pool.get('pos.order.line')
        
        for order in self.browse(cr, uid, ids, context=context):
            current_session_ids = self.pool.get('pos.session').search(cr, uid, [
                ('state''!=''closed'),
                ('user_id''=', uid)], context=context)
            if not current_session_ids:
                raise UserError(_('To return product(s), you need to open a session that will be used to register the refund.'))

            clone_id = self.copy(cr, uid, order.id, {
                'name': order.name + ' REFUND' 
                'session_id': current_session_ids[0],
                'ean13' : ?????
                'date_order': time.strftime('%Y-%m-%d %H:%M:%S'),
            }, context=context)
            clone_list.append(clone_id)
Avatar
Discard