Skip to Content
Menu
This question has been flagged
1204 Views

my code is

def init(self):
   self.env.cr.execute("""update account_move
   set sale_order_id = b.so_id, customer_name = b.partner_name, so_number = b.name
   from (
   SELECT am.id as move_id,so.id as so_id,so.name,so.partner_id
    ,rp.name as partner_name
   FROM account_move am
  JOIN purchase_order po ON po.name = am.invoice_origin
  JOIN sale_order so ON so.name = po.origin
  JOIN res_partner rp on rp.id = so.partner_id
  where am.move_type = 'in_invoice' ) b
  where account_move.id = record.id;""")

Avatar
Discard

Give the context of what you're trying to do, then the code will be playful

Author

I want every time I make a vendor bill, it will update the so_number,customer_name field, which I have added to the account_move table

Related Posts Replies Views Activity
0
May 24
324
1
Mar 24
289
1
Jun 24
651
1
Jan 24
409
1
Oct 22
1110