添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • e-Commerce
  • Accounting
  • Inventory
  • Project management
  • Take the tour

    if contract.wage > 33333 :

    result = float(6396+(contract.wage - 33333)*0.25)


    gives me error :

    TypeError("float() argument must be a string or a real number, not 'NoneType'")

    can anyone help me?

    Hi,

    The error message you're encountering suggests that contract.wage might be None in some cases, causing the float() function to fail. To address this issue, you should check if contract.wage is not None before attempting to perform calculations with it. Here's how you can modify your code to handle this:

    if contract.wage is not None and contract.wage > 33333: result = float(6396 + (contract.wage - 33333) * 0.25) else: # Handle the case when contract.wage is None or less than or equal to 33333 result = 0 # Or any other default value you want to assign


    Hope it helps

    Enjoying the discussion? Don't just read, join in!

    Create an account today to enjoy exclusive features and engage with our awesome community!

    Sign up

    Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

    Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.