Fall 4915: Auftragsfreigabe mehrere Angebote
							parent
							
								
									df40cb5406
								
							
						
					
					
						commit
						dda1d24f46
					
				|  | @ -20,3 +20,4 @@ | |||
| ############################################################################## | ||||
| 
 | ||||
| from . import models | ||||
| from . import wizards | ||||
|  |  | |||
|  | @ -37,6 +37,7 @@ | |||
|         'dp_intercompany_invoicing', | ||||
|     ], | ||||
|     'data': [ | ||||
|         'wizards/wizard_confirm_production.xml', | ||||
|         'security/security.xml', | ||||
|         'data/dp_custom_data.xml', | ||||
|         'data/glaser_company_data.xml', | ||||
|  |  | |||
|  | @ -55,7 +55,24 @@ | |||
|             <field name="partner_id" position="after"> | ||||
|                 <field name="partner_invoice_id"/> | ||||
|             </field> | ||||
|             <field name="invoice_status" position="after"> | ||||
|                 <field name="assembly_state"/> | ||||
|             </field> | ||||
|         </field> | ||||
|     </record> | ||||
| 
 | ||||
|     <record id="view_sales_order_filter_assembly" model="ir.ui.view"> | ||||
|     <field name="name">view.sales.order.filter.assembly</field> | ||||
|     <field name="model">sale.order</field> | ||||
|     <field name="inherit_id" ref="sale.view_sales_order_filter"/> | ||||
|     <field name="arch" type="xml"> | ||||
|         <field name="name" position="after"> | ||||
|             <field name="assembly_state" string="PG Status" filter_domain="[('assembly_state','ilike',self)]"/> | ||||
|         </field> | ||||
|         <filter name="customer" position="after"> | ||||
|             <filter string="PG Status" domain="[]" context="{'group_by':'assembly_state'}"/> | ||||
|         </filter> | ||||
|     </field> | ||||
| </record> | ||||
| 
 | ||||
| </odoo> | ||||
|  |  | |||
|  | @ -0,0 +1 @@ | |||
| from . import wizard_confirm_production | ||||
|  | @ -0,0 +1,27 @@ | |||
| # 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 api, fields, models, _ | ||||
| from odoo.exceptions import ValidationError | ||||
| 
 | ||||
| 
 | ||||
| class WizardConfirmProduction(models.TransientModel): | ||||
|     _name = 'wizard.confirm.production' | ||||
|     _description = 'Produktionsfreigabe' | ||||
| 
 | ||||
|     name = fields.Char() | ||||
| 
 | ||||
|     @api.multi | ||||
|     def button_confirm_production(self): | ||||
|         for wizard in self: | ||||
|             active_ids = self.env.context.get('active_ids', []) | ||||
|             sale_orders = self.env['sale.order'].browse(active_ids) | ||||
|             if sale_orders.exists(): | ||||
|                 for so in sale_orders: | ||||
|                     if so.assembly_state == 'created' and so.state == 'sale': | ||||
|                         so.assembly_state = 'approved' | ||||
|                     else: | ||||
|                         raise ValidationError(u'Auftrag %s: Bitte prüfen Sie den PG-Status und/oder Auftragsstatus.' % so.name) | ||||
|             action = self.env.ref('sale.action_orders').read()[0] | ||||
|             action['domain'] = [('id', 'in', active_ids)] | ||||
|             return action | ||||
|  | @ -0,0 +1,56 @@ | |||
| <?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="view_wizard_confirm_production_form" model="ir.ui.view"> | ||||
|         <field name="name">view_wizard_confirm_production_form</field> | ||||
|         <field name="model">wizard.confirm.production</field> | ||||
|         <field name="arch" type="xml"> | ||||
|             <form string="Wizard Confirm Production"> | ||||
|                 <group> | ||||
|                     <p>Wollen Sie die Produktion für die markierten Aufträge freigeben?</p> | ||||
|                 </group> | ||||
|                 <footer> | ||||
|                     <button name="button_confirm_production" | ||||
|                             string="Produktion freigeben" | ||||
|                             class="btn-primary" | ||||
|                             type="object"/> | ||||
|                     <button string="Abbrechen" | ||||
|                             class="btn-default" | ||||
|                             special="cancel"/> | ||||
|                 </footer> | ||||
|             </form> | ||||
|         </field> | ||||
|     </record> | ||||
| 
 | ||||
|     <act_window id="action_wizard_confirm_production" | ||||
|         name="Produktionsfreigabe" | ||||
|         src_model="sale.order" | ||||
|         res_model="wizard.confirm.production" | ||||
|         view_type="form" | ||||
|         view_mode="form" | ||||
|         key2="client_action_multi" | ||||
|         target="new"/> | ||||
| 
 | ||||
| 
 | ||||
|     <!-- | ||||
|     <record id="action_wizard_confirm_production" model="ir.actions.act_window"> | ||||
|         <field name="name">Produktionsfreigabe</field> | ||||
|         <field name="res_model">wizard.confirm.production</field> | ||||
|         <field name="view_mode">form</field> | ||||
|         <field name="context">{}</field> | ||||
|         <field name="target">new</field> | ||||
|     </record> | ||||
| 
 | ||||
| 
 | ||||
|     <record id="wizard_confirm_production_act_multi" model="ir.values"> | ||||
|         <field name="name">Produktionsfreigabe</field> | ||||
|         <field name="key2">client_action_multi</field> | ||||
|         <field name="value" eval="'ir.actions.act_window,' +str(ref('action_wizard_confirm_production'))" /> | ||||
|         <field name="model">sale.order</field> | ||||
|     </record> | ||||
|     --> | ||||
| 
 | ||||
| </odoo> | ||||
		Loading…
	
		Reference in New Issue