تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
3849 أدوات العرض

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?

الصورة الرمزية
إهمال
أفضل إجابة

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

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
ديسمبر 22
4013
2
ديسمبر 22
6109
3
نوفمبر 20
4266
1
مايو 17
3701
0
مارس 17
3555