Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. @api.multi
  2. def invoice_validate(self):
  3. ...
  4.  
  5. @api.multi
  6. def invoice_validate(self):
  7. for invoice in self:
  8. ...
  9. origin = self.origin
  10. sale_order_id = self.env['sale.order'].search([('name', '=', origin)])[0].id
  11. sale_order_obj = self.env['sale.order'].browse(sale_order_id)
  12. sale_order_obj.write({'invoice_status': 'invoiced'})
  13. return self.write({'state': 'open'})
  14.  
  15. invoice_status = fields.Selection([
  16. ('upselling', 'Upselling Opportunity'),
  17. ('invoiced', 'Fully Invoiced'),
  18. ('to invoice', 'To Invoice'),
  19. ('no', 'Nothing to Invoice')
  20. ], string='Invoice Status', compute='_get_invoiced', store=True, readonly=True, default='no')
  21.  
  22. invoice_status = fields.Selection(selection_add=[("state", "open")])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement