Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odgovori
3865 Prikazi

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
Opusti
Best Answer

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

Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
1
dec. 22
4020
2
dec. 22
6139
3
nov. 20
4276
1
maj 17
3722
0
mar. 17
3589