跳至内容
菜单
此问题已终结
1 回复
2232 查看

classSaleTransportOrder(models.Model):

         _inherit = 'sale.order'

          transport_id = fields.Many2one('transport.management', string="Transport Via")
         defaction_confirm(self):

         ressuper(SaleTransportOrder,  self).action_confirm()

          for rec in self:

        rec.picking_ids.write({'transport_id':rec.transport_id.id})

       returnres


classStockpicking(models.Model):

        _inherit = "stock.picking"

          transport_id=fields.Many2one("transport.management",string="TransportVia",tracking=True,readonly=True)

route_id = fields.Many2one("transport.routes", string="Route",tracking=True,)


i wont to add domain fields transport_id to route_id

形象
丢弃
编写者
yes


On Thu, Jan 5, 2023 at 10:57 AM Emad akram <notifications@mail.odoo.com> wrote:

A new question how to use domain defferent fields of object in odoo v14 , blow my code... on Help has been posted. Click here to access the question :

See question

Sent by Odoo S.A. using Odoo.

最佳答案

Hi Owais,

Try the following code,

    @api.onchange('transport_id')
    def onchange_transport_id(self):
        res = {
            'domain': {
                'route_id': [(Your Domain Here)]
            }}
        return res


形象
丢弃
相关帖文 回复 查看 活动
2
5月 16
4110
0
3月 15
3593
1
5月 25
883
2
11月 24
2093
1
8月 24
1799