Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1 Odpovědět
3847 Zobrazení

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
Zrušit
Nejlepší odpověď

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

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
pro 22
4011
2
pro 22
6108
3
lis 20
4265
1
kvě 17
3687
0
bře 17
3554