consider difference between D and T orders in PG9
							parent
							
								
									c5c687a8f1
								
							
						
					
					
						commit
						af508e8ca1
					
				|  | @ -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 | ||||
| 
 | ||||
|  |  | |||
|  | @ -20,7 +20,14 @@ | |||
|                 <field name="confirmation_nr"/> | ||||
|                 <field name="order_type"/> | ||||
|                 <field name="assembly_state"/> | ||||
|                 <field name="pg9_call" widget="url" text="...gehe zu Auftrag in PG9" attrs="{'invisible': ['|','|','|','|',('origin','=', False),('origin','=', ''),('assembly_state','=',''),('assembly_state','=','created'),('assembly_state','=','failed')]}"/> | ||||
| <!-- | ||||
|                 <field name="pg9_call" widget="url" text="...gehe zu Auftrag in PG9" | ||||
|                        attrs="{'invisible': [('order_type','not in',['T','D']),('assembly_state','in',['','created','failed'])]}"/> | ||||
| --> | ||||
|                 <field name="pg9_call_D" widget="url" text="...gehe zu Auftrag in PG9" | ||||
|                        attrs="{'invisible': ['|','|','|','|',('order_type','!=', 'D'),('origin','=', False),('origin','=', ''),('assembly_state','not in',['wait','started','done','packed','delivered'])]}"/> | ||||
|                 <field name="pg9_call_T" widget="url" text="...gehe zu Auftrag in PG9" | ||||
|                        attrs="{'invisible': ['|','|',('order_type','!=', 'T'),('assembly_state','not in',['wait','started','done','packed','delivered'])]}"/> | ||||
|             </field> | ||||
|             <field name="note" position="after"> | ||||
|                 <separator/> | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue