如何从活动配置按钮Radio中运行代码部分 我已经创建了按钮收音机
class PurchaseConfig(models.TransientModel):
_inherit = 'purchase.config.settings'
groupe_purchase_grouping = fields.Selection([
(0, 'Active'),
(1, 'Desactive')
], "Purchase grouping")
单击激活时可以执行的功能
class ProcurementOrder(models.Model):
_inherit = 'procurement.order'
def _make_po_get_domain(self, partner):
res = super(ProcurementOrder, self)._make_po_get_domain(partner)
resr = list()
supplier=[]
for r in res:
if r[0]=="partner_id":
l=("partner_id","=",False)
resr.append(l)
continue
resr.append(r)
resr = tuple(resr)
return resr