diff --git a/ext/custom-addons/dp_custom/models/sale.py b/ext/custom-addons/dp_custom/models/sale.py index 53439cfa..ad3c91e9 100644 --- a/ext/custom-addons/dp_custom/models/sale.py +++ b/ext/custom-addons/dp_custom/models/sale.py @@ -62,13 +62,15 @@ class SaleOrder(models.Model): confirmation_nr = fields.Char('Freigabenummer') order_type = fields.Selection(ORDER_TYPES, string='Auftragsart', default='M') + pg9_call = fields.Char(string='PG9-Auftrag', compute='_pg9_call', store=False) + @api.multi - def action_pg9_call(self): - addr = request.httprequest.environ ["REMOTE_ADDR"] - self.ensure_one() + def _pg9_call(self) : for record in self : - xref = 'http://%s:9531/pg9/order/xref:%s' % (addr, record.origin) - r = requests.get(xref) + xref = 'xref:'+record.origin + record.pg9_call = 'http://localhost:9531/pg9/order/' + xref + + # end def _pg9_call @api.multi @api.onchange('partner_invoice_id')