コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
3855 ビュー

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
4015
2
12月 22
6113
3
11月 20
4268
1
5月 17
3713
0
3月 17
3556