跳至内容
菜单
此问题已终结
1 回复
2207 查看

Would like to ask any solutions for prevent duplicates in DB to format the API call? 

形象
丢弃
最佳答案

Use SQL constraints on model


class PosOrder(models.Model):
_inherit = "pos.order"

    _sql_constraints = [('name_uniq', 'unique (name)', "Order with this name already exists!"), ] 
形象
丢弃
相关帖文 回复 查看 活动
3
4月 25
723
1
1月 25
1639
1
8月 24
1526
2
5月 24
1240
3
5月 24
10361