From af508e8ca16c007227eff947c25508f093c84191 Mon Sep 17 00:00:00 2001 From: Andreas Osim Date: Wed, 4 Jul 2018 19:38:44 +0200 Subject: [PATCH] consider difference between D and T orders in PG9 --- ext/custom-addons/dp_custom/models/sale.py | 12 +++++++++--- ext/custom-addons/dp_custom/views/sale_views.xml | 9 ++++++++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/ext/custom-addons/dp_custom/models/sale.py b/ext/custom-addons/dp_custom/models/sale.py index 7392c70e..2bc8655b 100644 --- a/ext/custom-addons/dp_custom/models/sale.py +++ b/ext/custom-addons/dp_custom/models/sale.py @@ -62,14 +62,20 @@ 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) +# pg9_call = fields.Char(string='PG9-Auftrag', compute='_pg9_call', store=False) + pg9_call_D = fields.Char(string='PG9-Auftrag_D', compute='_pg9_call', store=False) + pg9_call_T = fields.Char(string='PG9-Auftrag_T', compute='_pg9_call', store=False) @api.multi def _pg9_call(self): for record in self: - if record.origin != False: + if record.order_type == 'D' and record.origin != False: xref = 'xref:' + record.origin - record.pg9_call = 'http://localhost:9531/pg9/order/' + xref + record.pg9_call_D = 'http://localhost:9531/pg9/order/' + xref + + if record.order_type == 'T': + xref = 'xref:' + record.name + record.pg9_call_T = 'http://localhost:9531/pg9/order/' + xref # end def _pg9_call diff --git a/ext/custom-addons/dp_custom/views/sale_views.xml b/ext/custom-addons/dp_custom/views/sale_views.xml index 6dc30428..40f6664b 100644 --- a/ext/custom-addons/dp_custom/views/sale_views.xml +++ b/ext/custom-addons/dp_custom/views/sale_views.xml @@ -20,7 +20,14 @@ - + + +