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

I made a related field that takes the information from purchase orders to the stock picking. I want to make that if the field is empty, in stock picking let the users edit that field.

from odoo import fields, models, api class Picking(models.Model): _inherit = 'stock.picking' analytic_account_id = fields.Many2one( string='Project', related='purchase_id.analytic_account_id', store=True, readonly=False) ​


Thats what I have. What should I add?

形象
丢弃
最佳答案

In XML add this <field name="analytic_account_id" attrs="{'readonly':[('analytic_account_id', '!=', False)]}"

形象
丢弃
相关帖文 回复 查看 活动
1
12月 22
4012
2
12月 22
6108
3
11月 20
4266
1
5月 17
3693
0
3月 17
3555