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

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
4040
2
12月 22
6172
3
11月 20
4301
1
5月 17
3762
0
3月 17
3604