Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
1 Responder
3850 Visualizações

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
Cancelar
Melhor resposta

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

Avatar
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
1
dez. 22
4013
2
dez. 22
6109
3
nov. 20
4266
1
mai. 17
3701
0
mar. 17
3555