Fall 5584: Neues Feld in der Produkt SST-10
							parent
							
								
									efbbce0945
								
							
						
					
					
						commit
						ccfd01af40
					
				|  | @ -38,7 +38,8 @@ values = { | ||||||
|     "assembly_line_ids": ["0000"], |     "assembly_line_ids": ["0000"], | ||||||
|     "list_price": 50.00, |     "list_price": 50.00, | ||||||
|     "can_be_sold_unconfigured": True, |     "can_be_sold_unconfigured": True, | ||||||
|     'image': "R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7", |     "image": "R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7", | ||||||
|  |     "tax": "20% MwSt.",# oder "10% MwSt.", "0% MwSt." | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| product_obj = odoo.env['product.template'] | product_obj = odoo.env['product.template'] | ||||||
|  |  | ||||||
|  | @ -120,13 +120,23 @@ class ProductTemplate(models.Model): | ||||||
|                         _("Produktionslinie \'%s\' kann nicht zugeordnet werden") % assembly_line_code) |                         _("Produktionslinie \'%s\' kann nicht zugeordnet werden") % assembly_line_code) | ||||||
|             vals['assembly_line_ids'] = [(6, 0, assembly_line_ids)] |             vals['assembly_line_ids'] = [(6, 0, assembly_line_ids)] | ||||||
| 
 | 
 | ||||||
|  |         if vals.get('tax', False): | ||||||
|  |             if vals['tax'] not in ["20% MwSt.", "10% MwSt.", "0% MwSt."]: | ||||||
|  |                 raise ValidationError(_("Die Steuer \'%s\' ist nicht gültig.") % vals['tax']) | ||||||
|  | 
 | ||||||
|  |             tax = self.env['account.tax'].search([('name', '=', vals['tax'])]) | ||||||
|  |             if tax: | ||||||
|  |                 vals['taxes_id'] = [(6, 0, [tax.id])] | ||||||
|  |             else: | ||||||
|  |                 raise ValidationError(_("Die Steuer \'%s\' kann nicht zugeordnet werden") % vals['tax']) | ||||||
|  | 
 | ||||||
|         return vals |         return vals | ||||||
| 
 | 
 | ||||||
|     @api.model |     @api.model | ||||||
|     def _get_specified_fields(self): |     def _get_specified_fields(self): | ||||||
|         return ['default_code', 'name', 'length', 'width', 'thickness', 'surface', 'active', 'weight', 'is_internal', |         return ['default_code', 'name', 'length', 'width', 'thickness', 'surface', 'active', 'weight', 'is_internal', | ||||||
|                 'xcat_id', 'notes', 'material_type_id', 'intrastat_id', 'sale_ok', 'assembly_line_ids', 'list_price', |                 'xcat_id', 'notes', 'material_type_id', 'intrastat_id', 'sale_ok', 'assembly_line_ids', 'list_price', | ||||||
|                 'height', 'categ_id', 'can_be_sold_unconfigured', 'image'] |                 'height', 'categ_id', 'can_be_sold_unconfigured', 'image', 'tax'] | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| class ProductCategory(models.Model): | class ProductCategory(models.Model): | ||||||
|  |  | ||||||
|  | @ -40,9 +40,9 @@ ENVIRONMENTS = { | ||||||
|     'br-tz'       : Environment('http://localhost',  '8080', 'tz-austria_1', 'tz-admin',     'x', 'admin', config = ConfigTZA()), |     'br-tz'       : Environment('http://localhost',  '8080', 'tz-austria_1', 'tz-admin',     'x', 'admin', config = ConfigTZA()), | ||||||
|     'br-glaser'   : Environment('http://localhost',  '8080', 'tz-austria_1', 'glaser-admin', 'x', 'admin', config = ConfigGlaser()), |     'br-glaser'   : Environment('http://localhost',  '8080', 'tz-austria_1', 'glaser-admin', 'x', 'admin', config = ConfigGlaser()), | ||||||
| 
 | 
 | ||||||
|     'aa'          : Environment('http://localhost',  '8080', 'tz-austria_1', 'admin',        'x', 'admin', config = ConfigTZA()), |     'aa'          : Environment('http://localhost',  '8080', 'tz-austria_2', 'admin',        'x', 'admin', config = ConfigTZA()), | ||||||
|     'aa-tz'       : Environment('http://localhost',  '8080', 'tz-austria_1', 'tz-admin',     'x', 'admin', config = ConfigTZA()), |     'aa-tz'       : Environment('http://localhost',  '8080', 'tz-austria_1', 'tz-admin',     'x', 'admin', config = ConfigTZA()), | ||||||
|     'aa-glaser'   : Environment('http://localhost',  '8080', 'tz-austria_1', 'glaser-admin', 'x', 'admin', config = ConfigGlaser()), |     'aa-glaser'   : Environment('http://localhost',  '8080', 'tz-austria_2', 'glaser-admin', 'x', 'admin', config = ConfigGlaser()), | ||||||
| 
 | 
 | ||||||
|     'rw'          : Environment('http://localhost',  '8080', 'tz-austria_1', 'admin',        'x', 'admin', config = ConfigTZA()), |     'rw'          : Environment('http://localhost',  '8080', 'tz-austria_1', 'admin',        'x', 'admin', config = ConfigTZA()), | ||||||
|     'rw-tz'       : Environment('http://localhost',  '8080', 'tz-austria_1', 'tz-admin',     'x', 'admin', config = ConfigTZA()), |     'rw-tz'       : Environment('http://localhost',  '8080', 'tz-austria_1', 'tz-admin',     'x', 'admin', config = ConfigTZA()), | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue