Skip to content Skip to sidebar Skip to footer

Typeerror: Object Of Type 'bool' Has No Len() - Odoo V9

I'm trying to connect to a webservice through an Odoov9 module. This is my class: class invoice(models.Model): _inherit = 'account.invoice' @api.multi def send_xml_file(self):

Solution 1:

When you try to access self.sii_xml_request. First check whether it's value is empty or not.

In your case, it returns an empty string which is False. To avoid this, try the following code:

_logger.info('len (como viene): %s' % (len(self.sii_xml_request) ifself.sii_xml_request else'')

This will only log 'self.sii_xml_request' if it has a value in it. Otherwise it will just log an empty string. You can change this of course to log something different that you would like to show if there is no value in 'self.sii_xml_request'.

Post a Comment for "Typeerror: Object Of Type 'bool' Has No Len() - Odoo V9"