Fall 5585: Anpassung aller Schnittstellen
							parent
							
								
									61e212d56e
								
							
						
					
					
						commit
						efbbce0945
					
				|  | @ -30,7 +30,6 @@ values = { | ||||||
|     "line_ids": ["0000"], |     "line_ids": ["0000"], | ||||||
|     "opt_out": True, |     "opt_out": True, | ||||||
|     "lang": "de", |     "lang": "de", | ||||||
|     "is_retailer": True, |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| res_partner_obj = odoo.env['res.partner'] | res_partner_obj = odoo.env['res.partner'] | ||||||
|  |  | ||||||
|  | @ -7,14 +7,15 @@ db = 'tz-austria_1' | ||||||
| user = 'admin' | user = 'admin' | ||||||
| pw = 'x' | pw = 'x' | ||||||
| 
 | 
 | ||||||
| host = 'erp.tzaustria.info' | # host = 'erp.tzaustria.info' | ||||||
| port = 443 | # port = 443 | ||||||
| db = 'odoo-test' | # db = 'odoo-test' | ||||||
| user = 'tz-admin' | # user = 'tz-admin' | ||||||
| pw = '12tza345' | # pw = '12tza345' | ||||||
| protocol="jsonrpc+ssl" | # protocol="jsonrpc+ssl" | ||||||
| 
 | 
 | ||||||
| odoo = odoorpc.ODOO(host, protocol=protocol, port=port) | odoo = odoorpc.ODOO(host, port=port) | ||||||
|  | # odoo = odoorpc.ODOO(host, protocol=protocol, port=port) | ||||||
| odoo.login(db, user, pw) | odoo.login(db, user, pw) | ||||||
| 
 | 
 | ||||||
| sale_order_obj = odoo.env['sale.order'] | sale_order_obj = odoo.env['sale.order'] | ||||||
|  |  | ||||||
|  | @ -7,14 +7,15 @@ db = 'tz-austria_1' | ||||||
| user = 'tz-admin' | user = 'tz-admin' | ||||||
| pw = 'x' | pw = 'x' | ||||||
| 
 | 
 | ||||||
| host = 'erp.tzaustria.info' | # host = 'erp.tzaustria.info' | ||||||
| port = 443 | # port = 443 | ||||||
| db = 'odoo-test' | # db = 'odoo-test' | ||||||
| user = 'tz-admin' | # user = 'tz-admin' | ||||||
| pw = '12tza345' | # pw = '12tza345' | ||||||
| protocol="jsonrpc+ssl" | # protocol="jsonrpc+ssl" | ||||||
| 
 | 
 | ||||||
| odoo = odoorpc.ODOO(host, protocol=protocol, port=port) | odoo = odoorpc.ODOO(host, port=port) | ||||||
|  | # odoo = odoorpc.ODOO(host, protocol=protocol, port=port) | ||||||
| odoo.login(db, user, pw) | odoo.login(db, user, pw) | ||||||
| 
 | 
 | ||||||
| values = { | values = { | ||||||
|  | @ -28,10 +29,10 @@ values = { | ||||||
|     "weight": 80.45, |     "weight": 80.45, | ||||||
|     "active": True, |     "active": True, | ||||||
|     "is_internal": True, |     "is_internal": True, | ||||||
|     "xcat_id": "Kategorie 1", |     "xcat_id": "XCategory Name", | ||||||
|     "notes": "notes", |     "notes": "notes", | ||||||
|     "material_type_id": "Holz", |     "material_type_id": "Roh Material", | ||||||
|     "categ_id": "all", |     "categ_id": "__connector", | ||||||
|     "intrastat_id": "34052000", |     "intrastat_id": "34052000", | ||||||
|     "sale_ok": True, |     "sale_ok": True, | ||||||
|     "assembly_line_ids": ["0000"], |     "assembly_line_ids": ["0000"], | ||||||
|  |  | ||||||
|  | @ -1,6 +1,5 @@ | ||||||
| # -*- coding: utf-8 -*- | # -*- coding: utf-8 -*- | ||||||
| import odoorpc | import odoorpc | ||||||
| from urllib.parse import urlparse |  | ||||||
| 
 | 
 | ||||||
| host = 'localhost' | host = 'localhost' | ||||||
| port = 8080 | port = 8080 | ||||||
|  | @ -32,7 +31,7 @@ values = { | ||||||
|     "vat": False, |     "vat": False, | ||||||
|     "lang": "de", |     "lang": "de", | ||||||
|     "line_ids": ["0000"], |     "line_ids": ["0000"], | ||||||
|     "property_payment_term_id": "15 Tage", |     "property_payment_term_id": "7", | ||||||
|     "property_product_pricelist": "EUR", |     "property_product_pricelist": "EUR", | ||||||
|     "date_vat_check": "2017-08-04", |     "date_vat_check": "2017-08-04", | ||||||
|     "active": True, |     "active": True, | ||||||
|  |  | ||||||
|  | @ -27,14 +27,12 @@ class AbstractHelper(models.AbstractModel): | ||||||
|     _description = 'Abstract Helper' |     _description = 'Abstract Helper' | ||||||
| 
 | 
 | ||||||
|     @api.model |     @api.model | ||||||
|     def remove_not_specified_fields(self, vals): |     def check_not_specified_fields(self, vals): | ||||||
|         specified_fields = self._get_specified_fields() |         specified_fields = self._get_specified_fields() | ||||||
|         remove_fields = [] |  | ||||||
|         for key in list(vals.keys()): |         for key in list(vals.keys()): | ||||||
|             if key not in specified_fields: |             if key not in specified_fields: | ||||||
|                 remove_fields.append(key) |                 raise ValidationError( | ||||||
|         for key in remove_fields: |                     _('Es befinden sich unerlaubte Felder in Ihrem Aufruf. Bitte entfernen Sie diese.')) | ||||||
|             del vals[key] |  | ||||||
|         return vals |         return vals | ||||||
| 
 | 
 | ||||||
|     @api.model |     @api.model | ||||||
|  |  | ||||||
|  | @ -66,7 +66,7 @@ class ProductTemplate(models.Model): | ||||||
|         :param vals: |         :param vals: | ||||||
|         :return: |         :return: | ||||||
|         """ |         """ | ||||||
|         vals = self.remove_not_specified_fields(vals) |         self.check_not_specified_fields(vals) | ||||||
|         vals = self.correct_values(vals) |         vals = self.correct_values(vals) | ||||||
|         product_template = self.with_context(active_test=False).search([('default_code', '=', vals['default_code'])]) |         product_template = self.with_context(active_test=False).search([('default_code', '=', vals['default_code'])]) | ||||||
|         if product_template: |         if product_template: | ||||||
|  |  | ||||||
|  | @ -93,7 +93,7 @@ class Partner(models.Model): | ||||||
|         :param vals: |         :param vals: | ||||||
|         :return: |         :return: | ||||||
|         """ |         """ | ||||||
|         vals = self.with_context(sst_1=True).remove_not_specified_fields(vals) |         self.with_context(sst_1=True).check_not_specified_fields(vals) | ||||||
|         vals = self.correct_values(vals) |         vals = self.correct_values(vals) | ||||||
|         if not vals.get('active', False): |         if not vals.get('active', False): | ||||||
|             vals['active'] = False |             vals['active'] = False | ||||||
|  | @ -109,7 +109,7 @@ class Partner(models.Model): | ||||||
|         :param vals: |         :param vals: | ||||||
|         :return: |         :return: | ||||||
|         """ |         """ | ||||||
|         vals = self.with_context(sst_14=True).remove_not_specified_fields(vals) |         self.with_context(sst_14=True).check_not_specified_fields(vals) | ||||||
|         vals = self.correct_values(vals) |         vals = self.correct_values(vals) | ||||||
|         return self.create(vals).id |         return self.create(vals).id | ||||||
| 
 | 
 | ||||||
|  | @ -120,7 +120,7 @@ class Partner(models.Model): | ||||||
|         :param vals: |         :param vals: | ||||||
|         :return: |         :return: | ||||||
|         """ |         """ | ||||||
|         vals = self.with_context(sst_11=True).remove_not_specified_fields(vals) |         self.with_context(sst_11=True).check_not_specified_fields(vals) | ||||||
|         vals = self.correct_values(vals) |         vals = self.correct_values(vals) | ||||||
|         partner = self.with_context(active_test=False).search([('ref', '=', vals['ref'])]) |         partner = self.with_context(active_test=False).search([('ref', '=', vals['ref'])]) | ||||||
|         if partner: |         if partner: | ||||||
|  |  | ||||||
|  | @ -202,7 +202,7 @@ class SaleOrder(models.Model): | ||||||
|             if key.startswith('delivery_'): |             if key.startswith('delivery_'): | ||||||
|                 delivery_vals[key.replace('delivery_', '')] = vals[key] |                 delivery_vals[key.replace('delivery_', '')] = vals[key] | ||||||
| 
 | 
 | ||||||
|         delivery_vals = delivery_partner.with_context(delivery_partner=True).remove_not_specified_fields(delivery_vals) |         delivery_partner.with_context(delivery_partner=True).check_not_specified_fields(delivery_vals) | ||||||
|         delivery_vals = delivery_partner.correct_values(delivery_vals) |         delivery_vals = delivery_partner.correct_values(delivery_vals) | ||||||
|         delivery_vals['parent_id'] = partner.id |         delivery_vals['parent_id'] = partner.id | ||||||
| 
 | 
 | ||||||
|  | @ -219,7 +219,7 @@ class SaleOrder(models.Model): | ||||||
| 
 | 
 | ||||||
|         attachment_vals = vals.get('attachment_ids', False) |         attachment_vals = vals.get('attachment_ids', False) | ||||||
|         order_line_vals = vals.get('order_lines', False) |         order_line_vals = vals.get('order_lines', False) | ||||||
|         vals = self.remove_not_specified_fields(vals) |         self.check_not_specified_fields(vals) | ||||||
|         vals = self.correct_values(vals) |         vals = self.correct_values(vals) | ||||||
|         payment_term = partner.property_payment_term_id |         payment_term = partner.property_payment_term_id | ||||||
|         if partner.retail_partner_id: |         if partner.retail_partner_id: | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue