Feedback 1143: SST-11: neues Feld in Zahlungsbedingungen
							parent
							
								
									45e9b0d76a
								
							
						
					
					
						commit
						27f19ad365
					
				|  | @ -31,3 +31,9 @@ class AccountInvoiceLine(models.Model): | ||||||
|         if vals.get('product_id', False) and not vals.get('intrastat_id', False): |         if vals.get('product_id', False) and not vals.get('intrastat_id', False): | ||||||
|             vals.update(intrastat_id=self.env['product.template'].browse(vals['product_id']).intrastat_id.id) |             vals.update(intrastat_id=self.env['product.template'].browse(vals['product_id']).intrastat_id.id) | ||||||
|         return super(AccountInvoiceLine, self).create(vals) |         return super(AccountInvoiceLine, self).create(vals) | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | class AccountPaymentTerm(models.Model): | ||||||
|  |     _inherit = 'account.payment.term' | ||||||
|  | 
 | ||||||
|  |     code = fields.Char(string='Code') | ||||||
|  |  | ||||||
|  | @ -124,6 +124,15 @@ class Partner(models.Model): | ||||||
|             else: |             else: | ||||||
|                 raise ValidationError(_("Die Branche \'%s\' kann nicht zugeordnet werden" % vals['partner_sector_id'])) |                 raise ValidationError(_("Die Branche \'%s\' kann nicht zugeordnet werden" % vals['partner_sector_id'])) | ||||||
| 
 | 
 | ||||||
|  |         if vals.get('property_payment_term_id', False): | ||||||
|  |             payment_term = self.env['account.payment.term'].search( | ||||||
|  |                 [('code', '=', vals['property_payment_term_id'])]) | ||||||
|  |             if payment_term: | ||||||
|  |                 vals['property_payment_term_id'] = payment_term.id | ||||||
|  |             else: | ||||||
|  |                 raise ValidationError(_("Die Zahlungsbedingung mit dem Code \'%s\' kann nicht zugeordnet werden" % vals[ | ||||||
|  |                     'property_payment_term_id'])) | ||||||
|  | 
 | ||||||
|         return vals |         return vals | ||||||
| 
 | 
 | ||||||
|     @api.model |     @api.model | ||||||
|  | @ -169,7 +178,8 @@ class Partner(models.Model): | ||||||
|                 }) |                 }) | ||||||
|                 portal_url = tools.config.get('portal_url') |                 portal_url = tools.config.get('portal_url') | ||||||
|                 application_id = tools.config.get('portal_secret') |                 application_id = tools.config.get('portal_secret') | ||||||
|                 response = requests.post(portal_url + '/api/v1/set-discounts/?secret=' + application_id, data=json.dumps(data)) |                 response = requests.post(portal_url + '/api/v1/set-discounts/?secret=' + application_id, | ||||||
|  |                                          data=json.dumps(data)) | ||||||
|                 if response.status_code != 200: |                 if response.status_code != 200: | ||||||
|                     raise ValidationError(_('Rabatt konnte nicht gesetzt werden.')) |                     raise ValidationError(_('Rabatt konnte nicht gesetzt werden.')) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -12,4 +12,17 @@ | ||||||
|         </field> |         </field> | ||||||
|     </record> |     </record> | ||||||
| 
 | 
 | ||||||
|  |     <record id="account_payment_term_form_view" model="ir.ui.view"> | ||||||
|  |         <field name="name">account_payment_term_form_view</field> | ||||||
|  |         <field name="model">account.payment.term</field> | ||||||
|  |         <field name="inherit_id" ref="account.view_payment_term_form"/> | ||||||
|  |         <field name="arch" type="xml"> | ||||||
|  |             <field name="name" position="after"> | ||||||
|  |                 <field name="code"/> | ||||||
|  |             </field> | ||||||
|  |         </field> | ||||||
|  |     </record> | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| </odoo> | </odoo> | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue