Fall 5430: Änderungswünsche - Andruck Zolltarifnummer
							parent
							
								
									923a7a2efa
								
							
						
					
					
						commit
						8532166c1e
					
				|  | @ -43,6 +43,7 @@ | ||||||
|         'views/commission_account.xml', |         'views/commission_account.xml', | ||||||
|         'wizards/wizard_confirm_production.xml', |         'wizards/wizard_confirm_production.xml', | ||||||
|         'wizards/portal_assign_company.xml', |         'wizards/portal_assign_company.xml', | ||||||
|  |         'wizards/wizard_confirm_print_invoice.xml', | ||||||
|         'security/security.xml', |         'security/security.xml', | ||||||
|         'data/dp_custom_data.xml', |         'data/dp_custom_data.xml', | ||||||
|         'data/glaser_company_data.xml', |         'data/glaser_company_data.xml', | ||||||
|  |  | ||||||
|  | @ -121,3 +121,21 @@ class AccountInvoice(models.Model): | ||||||
|             elif currency_obj and currency_obj.position == 'before': |             elif currency_obj and currency_obj.position == 'before': | ||||||
|                 res = '%s %s' % (currency_obj.symbol, res) |                 res = '%s %s' % (currency_obj.symbol, res) | ||||||
|         return res |         return res | ||||||
|  | 
 | ||||||
|  |     @api.multi | ||||||
|  |     def print_intrastat_invoice(self): | ||||||
|  |         self.ensure_one() | ||||||
|  |         info = "Bei folgenden Produkten fehlt die Zolltarifnummer:\n" | ||||||
|  |         intrastrat_not_set = False | ||||||
|  |         for invoice_line in self.invoice_line_ids: | ||||||
|  |             if invoice_line.product_id and invoice_line.product_id.type != 'service': | ||||||
|  |                 if not invoice_line.intrastat_id: | ||||||
|  |                     info += invoice_line.name + "\n" | ||||||
|  |                     intrastrat_not_set = True | ||||||
|  |         if intrastrat_not_set: | ||||||
|  |             action = self.env.ref('dp_custom.action_wizard_confirm_print_invoice').read()[0] | ||||||
|  |             action['context'] = '{"default_info": "'+info+'"}' | ||||||
|  |             return action | ||||||
|  |         return self.env.ref('dp_reports_account.account_invoices_with_intrastat').report_action(self) | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  |  | ||||||
|  | @ -1,4 +1,14 @@ | ||||||
| <?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||||||
| <odoo> | <odoo> | ||||||
| 
 | 
 | ||||||
|  |     <record id="action_print_intrastat_invoice" model="ir.actions.server"> | ||||||
|  |         <field name="name">Rechnung mit Zolltarifnummer</field> | ||||||
|  |         <field name="type">ir.actions.server</field> | ||||||
|  |         <field name="model_id" ref="account.model_account_invoice"/> | ||||||
|  |         <field name="binding_model_id" ref="account.model_account_invoice"/> | ||||||
|  |         <field name="state">code</field> | ||||||
|  |         <field name="code">action = record.print_intrastat_invoice()</field> | ||||||
|  |         <field name="binding_type">report</field> | ||||||
|  |     </record> | ||||||
|  | 
 | ||||||
| </odoo> | </odoo> | ||||||
|  |  | ||||||
|  | @ -1,2 +1,3 @@ | ||||||
| from . import wizard_confirm_production | from . import wizard_confirm_production | ||||||
|  | from . import wizard_confirm_print_invoice | ||||||
| from . import portal_assign_company | from . import portal_assign_company | ||||||
|  |  | ||||||
|  | @ -0,0 +1,18 @@ | ||||||
|  | # Copyright 2018-Today datenpol gmbh (<http://www.datenpol.at>) | ||||||
|  | # License OPL-1 or later (https://www.odoo.com/documentation/user/11.0/legal/licenses/licenses.html#licenses). | ||||||
|  | 
 | ||||||
|  | from odoo import fields, models | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|  | class ConfirmPrintInvoice(models.TransientModel): | ||||||
|  |     _name = 'wizard.confirm_print_invoice' | ||||||
|  |     _description = 'Bestätige Rechnungsdruck' | ||||||
|  |     _order = 'name' | ||||||
|  | 
 | ||||||
|  |     info = fields.Text('Info', readonly=True) | ||||||
|  | 
 | ||||||
|  |     def print_invoice(self): | ||||||
|  |         self.ensure_one() | ||||||
|  |         invoice = self.env['account.invoice'].browse(self.env.context.get('active_ids', [])) | ||||||
|  | 
 | ||||||
|  |         return self.env.ref('dp_reports_account.account_invoices_with_intrastat').report_action(invoice) | ||||||
|  | @ -0,0 +1,32 @@ | ||||||
|  | <?xml version="1.0" encoding="utf-8"?> | ||||||
|  | <!-- Copyright 2018-Today datenpol gmbh(<http://www.datenpol.at>) | ||||||
|  |      License OPL-1 or later (https://www.odoo.com/documentation/user/11.0/legal/licenses/licenses.html#licenses). --> | ||||||
|  | 
 | ||||||
|  | <odoo> | ||||||
|  | 
 | ||||||
|  |     <record id="wizard_confirm_print_invoice_form_view" model="ir.ui.view"> | ||||||
|  |         <field name="name">wizard_confirm_print_invoice_form_view</field> | ||||||
|  |         <field name="model">wizard.confirm_print_invoice</field> | ||||||
|  |         <field name="arch" type="xml"> | ||||||
|  |             <form string="Bestätige Rechnungsdruck"> | ||||||
|  |                 <group> | ||||||
|  |                     <field name="info"/> | ||||||
|  |                 </group> | ||||||
|  |                 <footer> | ||||||
|  |                     <button name="print_invoice" string="Rechnung trotzdem drucken" class="btn-primary" type="object"/> | ||||||
|  |                     <button string="Abbrechen" class="btn-default" special="cancel"/> | ||||||
|  |                 </footer> | ||||||
|  |             </form> | ||||||
|  |         </field> | ||||||
|  |     </record> | ||||||
|  | 
 | ||||||
|  |     <record id="action_wizard_confirm_print_invoice" model="ir.actions.act_window"> | ||||||
|  |         <field name="name">Bestätige Rechnungsdruck</field> | ||||||
|  |         <field name="type">ir.actions.act_window</field> | ||||||
|  |         <field name="res_model">wizard.confirm_print_invoice</field> | ||||||
|  |         <field name="target">new</field> | ||||||
|  |         <field name="view_type">form</field> | ||||||
|  |         <field name="view_mode">form</field> | ||||||
|  |     </record> | ||||||
|  | 
 | ||||||
|  | </odoo> | ||||||
|  | @ -32,10 +32,6 @@ class AccountInvoiceWithIntrastat(models.AbstractModel): | ||||||
|     def get_report_values(self, docids, data=None): |     def get_report_values(self, docids, data=None): | ||||||
|         model = 'account.invoice' |         model = 'account.invoice' | ||||||
|         docs = self.env[model].browse(docids) |         docs = self.env[model].browse(docids) | ||||||
|         for doc in docs: |  | ||||||
|             for line in doc.invoice_line_ids: |  | ||||||
|                 if not line.intrastat_id: |  | ||||||
|                     raise ValidationError(_('Es muss bei allen Produkten/Lots eine Zolltarifnummer hinterlegt sein!')) |  | ||||||
|         return { |         return { | ||||||
|             'doc_ids': docids, |             'doc_ids': docids, | ||||||
|             'doc_model': model, |             'doc_model': model, | ||||||
|  |  | ||||||
|  | @ -107,7 +107,7 @@ | ||||||
|                                             <t t-esc="layout_category['name']"/> |                                             <t t-esc="layout_category['name']"/> | ||||||
|                                             - |                                             - | ||||||
|                                             <t t-esc="o.partner_id.ref"/> |                                             <t t-esc="o.partner_id.ref"/> | ||||||
|                                             <t t-if="layout_category['order_id']"> |                                             <t t-if="layout_category.get('order_id')"> | ||||||
|                                                 <t t-if="layout_category['order_id'].origin"> |                                                 <t t-if="layout_category['order_id'].origin"> | ||||||
|                                                     - |                                                     - | ||||||
|                                                     <t t-esc="layout_category['order_id'].origin"/> |                                                     <t t-esc="layout_category['order_id'].origin"/> | ||||||
|  | @ -152,7 +152,7 @@ | ||||||
|                                                 </strong> |                                                 </strong> | ||||||
|                                                 <br/> |                                                 <br/> | ||||||
|                                             </t> |                                             </t> | ||||||
|                                             <span t-if="with_intrastat"> |                                             <span t-if="with_intrastat and invoice_line.intrastat_id"> | ||||||
|                                                 <strong>Zolltarif Nr.:</strong> |                                                 <strong>Zolltarif Nr.:</strong> | ||||||
|                                                 <span t-field="invoice_line.intrastat_id"/> |                                                 <span t-field="invoice_line.intrastat_id"/> | ||||||
|                                                 <br/> |                                                 <br/> | ||||||
|  | @ -163,7 +163,8 @@ | ||||||
|                                             <span t-field="invoice_line.price_unit"/> |                                             <span t-field="invoice_line.price_unit"/> | ||||||
|                                         </td> |                                         </td> | ||||||
|                                         <td class="text-right" t-if="discount_is_set"> |                                         <td class="text-right" t-if="discount_is_set"> | ||||||
|                                             <span t-if="not invoice_line.hide_discount" t-field="invoice_line.discount"/> |                                             <span t-if="not invoice_line.hide_discount" | ||||||
|  |                                                   t-field="invoice_line.discount"/> | ||||||
|                                         </td> |                                         </td> | ||||||
|                                         <td class="text-right"> |                                         <td class="text-right"> | ||||||
|                                             <span t-field="invoice_line.price_subtotal"/> |                                             <span t-field="invoice_line.price_subtotal"/> | ||||||
|  | @ -273,6 +274,7 @@ | ||||||
|             attachment="(object.state in ('open','paid')) and ('INV'+(object.number or '').replace('/','')+'.pdf')" |             attachment="(object.state in ('open','paid')) and ('INV'+(object.number or '').replace('/','')+'.pdf')" | ||||||
|             print_report_name="(object._get_printed_report_name())" |             print_report_name="(object._get_printed_report_name())" | ||||||
|             paperformat="dp_reports.paperformat_a4_european" |             paperformat="dp_reports.paperformat_a4_european" | ||||||
|  |             menu="False" | ||||||
|     /> |     /> | ||||||
| 
 | 
 | ||||||
|     <record id="account.account_invoices_without_payment" model="ir.actions.report"> |     <record id="account.account_invoices_without_payment" model="ir.actions.report"> | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue