Skip to Content
मेन्यू
This question has been flagged
1 Reply
3838 Views

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?

Avatar
Discard
Best Answer

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

Avatar
Discard
Related Posts Replies Views Activity
1
दिस॰ 22
4005
2
दिस॰ 22
6103
3
नव॰ 20
4264
1
मई 17
3676
0
मार्च 17
3551