【问题标题】:odoo14 on change only gets called on specific changeodoo14 on change 仅在特定更改时被调用
【发布时间】:2022-01-04 13:02:11
【问题描述】:

这是我的 odoo14 模块中我的一个模型的 on change 功能:

@api.onchange('staende', 'name', 'length', 'height')
def change(self):
    print("\033[92m +++ DEBUG#ONCHANGE +++")
    print(self)
    print("\033[93m", end="")

奇怪的是,只有在我更改模型名称时才会调用该方法,但不会在我更改长度或高度或 staende 属性时调用

这就是模型的样子:

class Halle(models.Model):
    _name = 'rectanglemaps.halle'
    _inherit = 'mail.thread'
    _description = 'desc'

    active = fields.Boolean('Active', default=True)

    name = fields.Char(string="Name", required=True)
    length = fields.Float(string="Länge", required=True)
    height = fields.Float(string="Tiefe", required=True)
    measurehalle = fields.Float(string="Rastermaß")
    plan = fields.Image(string="Plan")

    messe_id = fields.Many2one('rectanglemaps.messe', string="Messe")

    staende = fields.One2many('rectanglemaps.stand', 'halle_id', string="Stände")

【问题讨论】:

    标签: python odoo odoo-14


    【解决方案1】:

    看来,这只是热模块重新加载的问题。使用标志 -u MODULENAME 重新启动 odoo 解决了问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-04-08
      • 1970-01-01
      • 1970-01-01
      • 2019-09-10
      • 1970-01-01
      相关资源
      最近更新 更多