Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
3893 มุมมอง

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)]}"

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ธ.ค. 22
4038
2
ธ.ค. 22
6169
3
พ.ย. 20
4298
1
พ.ค. 17
3761
0
มี.ค. 17
3603