Call to local PG9
							parent
							
								
									86e7f75004
								
							
						
					
					
						commit
						8f52f2a4a1
					
				|  | @ -26,7 +26,9 @@ from odoo.tools import float_is_zero | |||
| from odoo.exceptions import ValidationError, UserError | ||||
| from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT | ||||
| from odoo.tools import float_compare | ||||
| from odoo.http import request | ||||
| 
 | ||||
| import requests | ||||
| 
 | ||||
| class SaleOrder(models.Model): | ||||
|     _name = 'sale.order' | ||||
|  | @ -60,6 +62,14 @@ class SaleOrder(models.Model): | |||
|     confirmation_nr = fields.Char('Freigabenummer') | ||||
|     order_type = fields.Selection(ORDER_TYPES, string='Auftragsart', default='M') | ||||
| 
 | ||||
|     @api.multi | ||||
|     def action_pg9_call(self): | ||||
|         addr = request.httprequest.environ ["REMOTE_ADDR"] | ||||
|         self.ensure_one() | ||||
|         for record in self : | ||||
|             xref = 'http://%s:9531/pg9/order/xref:%s' % (addr, record.origin) | ||||
|             r = requests.get(xref) | ||||
| 
 | ||||
|     @api.multi | ||||
|     @api.onchange('partner_invoice_id') | ||||
|     def _onchange_partner_invoice_id(self): | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue