Odoo 中文社区

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Popular
    • Users
    • Groups

    Odoo中文社区可以通过以下两个域名访问:shine-it.net , odoo.net.cn

    由于系统升迁的原因,本论坛部分较早期的内容存在格式和链接损坏失效的问题,并非本论坛系统本身的缺陷,望谅解

    本社区没有维护任何QQ群讨论组,任何与本社区同名的QQ群讨论组的言论与本社区无关!

    开发人员可以登录gitter讨论组: http://gitter.im/odoo-china/Talk, 需要github账号

    如果您登录系统碰到问题,请在微信公众号留言:

    odoo 14 數字輸入動態限制最大值

    Odoo 开发与实施交流
    2
    6
    48
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      samchou last edited by samchou

      請問在表單輸入數字時
      如何設定限制由系統運算出來的最大值

      digitalsatori 1 Reply Last reply Reply Quote 0
      • digitalsatori
        digitalsatori 管理员 @samchou last edited by

        @samchou 可以在程序中设置constraint,在代码中搜索api.constrains学习对字段设置约束逻辑, 或者利用_sql_constraints参数设置数据库级别的约束。

        这个回答同样适用于你另外一个对时间字段的约束条件

        【上海先安科技】(tony AT openerp.cn)

        1 Reply Last reply Reply Quote 0
        • S
          samchou last edited by samchou

          你好
          我是想在XML內設置限制最大值
          <field name="wk_qty" attrs="{'invisible': [('note', 'in', ('today','makeup'))]}" widget="numeric_step" options="{'step': 1, 'min': 0, 'max': 100}" / >
          但是現行僅能使用固定值 例如:100
          如何能'max': max_value ?
          動態設定最大值

          digitalsatori 1 Reply Last reply Reply Quote 0
          • digitalsatori
            digitalsatori 管理员 @samchou last edited by

            @samchou 为什么一定要在xml里设置?

            【上海先安科技】(tony AT openerp.cn)

            1 Reply Last reply Reply Quote 0
            • S
              samchou last edited by

              那請問要如何限制在畫面輸入的最大值?

              digitalsatori 1 Reply Last reply Reply Quote 0
              • digitalsatori
                digitalsatori 管理员 @samchou last edited by digitalsatori

                @samchou 我回答过你了呀, https://www.odoo.com/documentation/15.0/developer/howtos/rdtraining/11_constraints.html?highlight=constraint

                【上海先安科技】(tony AT openerp.cn)

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post