Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
3928 Vues

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
Ignorer
Meilleure réponse

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

Avatar
Ignorer
Publications associées Réponses Vues Activité
1
déc. 22
4054
2
déc. 22
6194
3
nov. 20
4310
1
mai 17
3775
0
mars 17
3616