Merge lp:~openerp-community-reviewer/e-commerce-addons/move_sale_exception_to_sale_wkfl_branches-jge into lp:~extra-addons-commiter/e-commerce-addons/7.0

Proposed by Joël Grand-Guillaume @ camptocamp
Status: Merged
Merged at revision: 286
Proposed branch: lp:~openerp-community-reviewer/e-commerce-addons/move_sale_exception_to_sale_wkfl_branches-jge
Merge into: lp:~extra-addons-commiter/e-commerce-addons/7.0
Diff against target: 582 lines (+0/-524)
11 files modified
sale_exceptions/__init__.py (+0/-25)
sale_exceptions/__openerp__.py (+0/-48)
sale_exceptions/sale.py (+0/-208)
sale_exceptions/sale_exceptions_data.xml (+0/-19)
sale_exceptions/sale_view.xml (+0/-106)
sale_exceptions/sale_workflow.xml (+0/-9)
sale_exceptions/security/ir.model.access.csv (+0/-3)
sale_exceptions/settings/sale.exception.csv (+0/-5)
sale_exceptions/wizard/__init__.py (+0/-1)
sale_exceptions/wizard/sale_exception_confirm.py (+0/-56)
sale_exceptions/wizard/sale_exception_confirm_view.xml (+0/-44)
To merge this branch: bzr merge lp:~openerp-community-reviewer/e-commerce-addons/move_sale_exception_to_sale_wkfl_branches-jge
Reviewer Review Type Date Requested Status
Nicolas Bessi - Camptocamp (community) Approve
Guewen Baconnier @ Camptocamp Approve
Pedro Manuel Baeza (community) Approve
Review via email: mp+193570@code.launchpad.net

Commit message

[MOVE] Move here the sale_exceptions module to the lp:sale-wkfl branch

Description of the change

Hi,

I suggest to move the sale_exceptions module from e-commerce-addons to lp:sale-wkfl branch because it concern the sales workflow in a more generic way than just the e-commerce context.

I put the branch under the reviewer team so feel free to fix stuff if you'd like. This depends on this merge : https://code.launchpad.net/~openerp-community-reviewer/sale-wkfl/move_sale_exception_module_from_e-commerce-addons-jge/+merge/193567

WARNING : Do not merge this one before ensuring the first one is merged !!!

Regards,

Joël

To post a comment you must log in.
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

As your reasoning on community list, I approve it blindly.

Regards.

review: Approve
Revision history for this message
Sébastien BEAU - http://www.akretion.com (sebastien.beau) wrote :

Hi, I am working on the split of sale_exception in two module "sale_exception" and "exception_rule". The aim is to have the exception on different object like purchase_order, stock_picking, invoice ... (already implemented on purchase_order and soon on picking).
If we put the module sale_exception here where should I put the module "exception_rule" and "purchase_exception" (and later stock_picking_exception)?

I see two solution possible
- Putting exception_rule in "server-env-tools" and than all implementation in sale-wkfl, purchase-wkfl...
- Creating a project "workflow-exception" and put all exception module here

What do you prefers?

Revision history for this message
Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c) wrote :
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

I approve for the move.

review: Approve
Revision history for this message
Nicolas Bessi - Camptocamp (nbessi-c2c-deactivatedaccount) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== removed directory 'sale_exceptions'
=== removed file 'sale_exceptions/__init__.py'
--- sale_exceptions/__init__.py 2012-02-24 09:31:32 +0000
+++ sale_exceptions/__init__.py 1970-01-01 00:00:00 +0000
@@ -1,25 +0,0 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22import sale
23import wizard
24# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
25
260
=== removed file 'sale_exceptions/__openerp__.py'
--- sale_exceptions/__openerp__.py 2012-12-26 13:05:09 +0000
+++ sale_exceptions/__openerp__.py 1970-01-01 00:00:00 +0000
@@ -1,48 +0,0 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2011 Akretion LTDA.
6# authors: Raphaël Valyi, Renato Lima
7# Copyright (C) 2010-2012 Akretion Sébastien BEAU <sebastien.beau@akretion.com>
8# Copyright (C) 2012 Camptocamp SA (Guewen Baconnier)
9#
10# This program is free software: you can redistribute it and/or modify
11# it under the terms of the GNU Affero General Public License as
12# published by the Free Software Foundation, either version 3 of the
13# License, or (at your option) any later version.
14#
15# This program is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18# GNU Affero General Public License for more details.
19#
20# You should have received a copy of the GNU Affero General Public License
21# along with this program. If not, see <http://www.gnu.org/licenses/>.
22#
23##############################################################################
24
25
26{
27 'name': 'Sale Exceptions',
28 'version': '0.1',
29 'category': 'Generic Modules/Sale',
30 'description': """
31This module allows you attach several customizable exceptions to your sale order in a way that you can filter orders by exceptions type and fix them.
32This is especially useful in an order importation scenario such as with the base_sale_multi_channels module, because it's likely a few orders have errors when you import them (like product not found in OpenERP, wrong line format etc...)
33""",
34 'author': 'Akretion',
35 'website': 'http://www.akretion.com',
36 'depends': ['sale'],
37 'init_xml': [
38 'settings/sale.exception.csv',
39 ],
40 'update_xml': ['sale_workflow.xml',
41 'sale_view.xml',
42 'sale_exceptions_data.xml',
43 'wizard/sale_exception_confirm_view.xml',
44 'security/ir.model.access.csv'],
45 'demo_xml': [],
46 'installable': True,
47}
48# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
490
=== removed file 'sale_exceptions/sale.py'
--- sale_exceptions/sale.py 2012-12-26 13:05:09 +0000
+++ sale_exceptions/sale.py 1970-01-01 00:00:00 +0000
@@ -1,208 +0,0 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2011 Akretion LTDA.
6# Copyright (C) 2010-2012 Akretion Sébastien BEAU <sebastien.beau@akretion.com>
7# Copyright (C) 2012 Camptocamp SA (Guewen Baconnier)
8#
9# This program is free software: you can redistribute it and/or modify
10# it under the terms of the GNU Affero General Public License as
11# published by the Free Software Foundation, either version 3 of the
12# License, or (at your option) any later version.
13#
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU Affero General Public License for more details.
18#
19# You should have received a copy of the GNU Affero General Public License
20# along with this program. If not, see <http://www.gnu.org/licenses/>.
21#
22##############################################################################
23
24import time
25import netsvc
26
27from openerp.osv.orm import Model
28from openerp.osv import fields
29from openerp.osv.osv import except_osv
30from tools.safe_eval import safe_eval as eval
31from tools.translate import _
32
33class sale_exception(Model):
34 _name = "sale.exception"
35 _description = "Sale Exceptions"
36 _order="active desc, sequence asc"
37 _columns = {
38 'name': fields.char('Exception Name', size=64, required=True, translate=True),
39 'description': fields.text('Description', translate=True),
40 'sequence': fields.integer('Sequence', help="Gives the sequence order when applying the test"),
41 'model': fields.selection([('sale.order', 'Sale Order'),
42 ('sale.order.line', 'Sale Order Line')],
43 string='Apply on', required=True),
44 'active': fields.boolean('Active'),
45 'code': fields.text('Python Code',
46 help="Python code executed to check if the exception apply or not. " \
47 "The code must apply block = True to apply the exception."),
48 'sale_order_ids': fields.many2many('sale.order', 'sale_order_exception_rel',
49 'exception_id', 'sale_order_id',
50 string='Sale Orders', readonly=True),
51 }
52
53 _defaults = {
54 'code': """# Python code. Use failed = True to block the sale order.
55# You can use the following variables :
56# - self: ORM model of the record which is checked
57# - order or line: browse_record of the sale order or sale order line
58# - object: same as order or line, browse_record of the sale order or sale order line
59# - pool: ORM model pool (i.e. self.pool)
60# - time: Python time module
61# - cr: database cursor
62# - uid: current user id
63# - context: current context
64"""
65 }
66
67class sale_order(Model):
68 _inherit = "sale.order"
69
70 _order = 'main_exception_id asc, date_order desc, name desc'
71
72 def _get_main_error(self, cr, uid, ids, name, args, context=None):
73 res = {}
74 for sale_order in self.browse(cr, uid, ids, context=context):
75 if sale_order.state == 'draft' and sale_order.exceptions_ids:
76 res[sale_order.id] = sale_order.exceptions_ids[0].id
77 else:
78 res[sale_order.id] = False
79 return res
80
81 _columns = {
82 'main_exception_id': fields.function(_get_main_error,
83 type='many2one',
84 relation="sale.exception",
85 string='Main Exception',
86 store={
87 'sale.order': (lambda self, cr, uid, ids, c={}: ids, ['exceptions_ids', 'state'], 10),
88 }),
89 'exceptions_ids': fields.many2many('sale.exception', 'sale_order_exception_rel',
90 'sale_order_id', 'exception_id',
91 string='Exceptions'),
92 'ignore_exceptions': fields.boolean('Ignore Exceptions'),
93 }
94
95 def test_all_draft_orders(self, cr, uid, context=None):
96 ids = self.search(cr, uid, [('state', '=', 'draft')])
97 self.test_exceptions(cr, uid, ids)
98 return True
99
100 def _popup_exceptions(self, cr, uid, order_id, context=None):
101 model_data_obj = self.pool.get('ir.model.data')
102 list_obj = self.pool.get('sale.exception.confirm')
103 ctx = context.copy()
104 ctx.update({'active_id': order_id,
105 'active_ids': [order_id]})
106 list_id = list_obj.create(cr, uid, {}, context=ctx)
107 view_id = model_data_obj.get_object_reference(
108 cr, uid, 'sale_exceptions', 'view_sale_exception_confirm')[1]
109 action = {
110 'name': _("Exceptions On Sale Order"),
111 'type': 'ir.actions.act_window',
112 'view_type': 'form',
113 'view_mode': 'form',
114 'res_model': 'sale.exception.confirm',
115 'view_id': [view_id],
116 'target': 'new',
117 'nodestroy': True,
118 'res_id': list_id,
119 }
120 return action
121
122 def action_button_confirm(self, cr, uid, ids, context=None):
123 exception_ids = self.detect_exceptions(cr, uid, ids, context=context)
124 if exception_ids:
125 return self._popup_exceptions(cr, uid, ids[0], context=context)
126 else:
127 return super(sale_order, self).action_button_confirm(cr, uid, ids, context=context)
128
129 def test_exceptions(self, cr, uid, ids, context=None):
130 """
131 Condition method for the workflow from draft to confirm
132 """
133 exception_ids = self.detect_exceptions(cr, uid, ids, context=context)
134 if exception_ids:
135 return False
136 return True
137
138 def detect_exceptions(self, cr, uid, ids, context=None):
139 exception_obj = self.pool.get('sale.exception')
140 order_exception_ids = exception_obj.search(cr, uid,
141 [('model', '=', 'sale.order')], context=context)
142 line_exception_ids = exception_obj.search(cr, uid,
143 [('model', '=', 'sale.order.line')], context=context)
144
145 order_exceptions = exception_obj.browse(cr, uid, order_exception_ids, context=context)
146 line_exceptions = exception_obj.browse(cr, uid, line_exception_ids, context=context)
147
148 exception_ids = False
149 for order in self.browse(cr, uid, ids):
150 if order.ignore_exceptions:
151 continue
152 exception_ids = self._detect_exceptions(cr, uid, order,
153 order_exceptions, line_exceptions, context=context)
154
155 self.write(cr, uid, [order.id], {'exceptions_ids': [(6, 0, exception_ids)]})
156 return exception_ids
157
158 def _exception_rule_eval_context(self, cr, uid, obj_name, obj, context=None):
159 if context is None:
160 context = {}
161
162 return {obj_name: obj,
163 'self': self.pool.get(obj._name),
164 'object': obj,
165 'obj': obj,
166 'pool': self.pool,
167 'cr': cr,
168 'uid': uid,
169 'user': self.pool.get('res.users').browse(cr, uid, uid),
170 'time': time,
171 # copy context to prevent side-effects of eval
172 'context': dict(context),}
173
174 def _rule_eval(self, cr, uid, rule, obj_name, obj, context):
175 expr = rule.code
176 space = self._exception_rule_eval_context(cr, uid, obj_name, obj,
177 context=context)
178 try:
179 eval(expr, space,
180 mode='exec', nocopy=True) # nocopy allows to return 'result'
181 except Exception, e:
182 raise except_osv(_('Error'), _('Error when evaluating the sale exception rule :\n %s \n(%s)') %
183 (rule.name, e))
184 return space.get('failed', False)
185
186 def _detect_exceptions(self, cr, uid, order, order_exceptions, line_exceptions, context=None):
187 exception_ids = []
188 for rule in order_exceptions:
189 if self._rule_eval(cr, uid, rule, 'order', order, context):
190 exception_ids.append(rule.id)
191
192 for order_line in order.order_line:
193 for rule in line_exceptions:
194 if rule.id in exception_ids:
195 continue # we do not matter if the exception as already been
196 # found for an order line of this order
197 if self._rule_eval(cr, uid, rule, 'line', order_line, context):
198 exception_ids.append(rule.id)
199
200 return exception_ids
201
202 def copy(self, cr, uid, id, default=None, context=None):
203 if default is None:
204 default = {}
205 default.update({
206 'ignore_exceptions': False,
207 })
208 return super(sale_order, self).copy(cr, uid, id, default=default, context=context)
2090
=== removed file 'sale_exceptions/sale_exceptions_data.xml'
--- sale_exceptions/sale_exceptions_data.xml 2012-09-06 12:34:40 +0000
+++ sale_exceptions/sale_exceptions_data.xml 1970-01-01 00:00:00 +0000
@@ -1,19 +0,0 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data noupdate="1">
4
5 <record forcecreate="True" id="ir_cron_test_orders" model="ir.cron">
6 <field name="name">Test Draft Orders</field>
7 <field eval="False" name="active"/>
8 <field name="user_id" ref="base.user_root"/>
9 <field name="interval_number">20</field>
10 <field name="interval_type">minutes</field>
11 <field name="numbercall">-1</field>
12 <field eval="False" name="doall"/>
13 <field eval="'sale.order'" name="model"/>
14 <field eval="'test_all_draft_orders'" name="function"/>
15 <field eval="'()'" name="args"/>
16 </record>
17
18 </data>
19</openerp>
200
=== removed file 'sale_exceptions/sale_view.xml'
--- sale_exceptions/sale_view.xml 2012-12-26 13:19:13 +0000
+++ sale_exceptions/sale_view.xml 1970-01-01 00:00:00 +0000
@@ -1,106 +0,0 @@
1<?xml version="1.0" ?>
2<openerp>
3 <data>
4
5 <record id="view_sale_exception_tree" model="ir.ui.view">
6 <field name="name">sale.exception.tree</field>
7 <field name="model">sale.exception</field>
8 <field name="type">tree</field>
9 <field name="arch" type="xml">
10 <tree string="Sale Exception">
11 <field name="active"/>
12 <field name="name"/>
13 <field name="description"/>
14 <field name="model"/>
15 <field name="sequence"/>
16 </tree>
17 </field>
18 </record>
19
20 <record id="view_sale_exception_form" model="ir.ui.view">
21 <field name="name">sale.exception.form</field>
22 <field name="model">sale.exception</field>
23 <field name="type">form</field>
24 <field name="arch" type="xml">
25 <form string="Sale Exception Setup">
26 <group colspan="4" col="2">
27 <field name="name"/>
28 <field name="description"/>
29 </group>
30 <group col="4" colspan="4" groups="base.group_sale_manager">
31 <field name="active"/>
32 <field name="sequence"/>
33 <group colspan="4" col="2" groups="base.group_system">
34 <field name="model"/>
35 <field name="code"/>
36 </group>
37 </group>
38 <group colspan="4" col="2">
39 <separator string="Affected Sales Orders"/>
40 <newline/>
41 <field name="sale_order_ids" nolabel="1" domain="[('state', '=', 'draft')]"/>
42 </group>
43 </form>
44 </field>
45 </record>
46
47 <record id="action_sale_test_tree" model="ir.actions.act_window">
48 <field name="name">Exception Rules</field>
49 <field name="res_model">sale.exception</field>
50 <field name="view_type">form</field>
51 <field name="view_mode">tree,form</field>
52 <field name="view_id" ref="view_sale_exception_tree"/>
53 <field name="context">{'active_test': False}</field>
54 </record>
55
56 <menuitem action="action_sale_test_tree" id="menu_sale_test" parent="base.menu_sale_config_sales" />
57
58
59 <record id="view_order_form" model="ir.ui.view">
60 <field name="name">sale_exceptions.view_order_form</field>
61 <field name="model">sale.order</field>
62 <field name="type">form</field>
63 <field name="priority">100</field>
64 <field name="inherit_id" ref="sale.view_order_form"/>
65 <field name="arch" type="xml">
66 <field name="name" position="after">
67 <field name="main_exception_id" nolabel="1"
68 attrs="{'invisible':[('main_exception_id','=', False)]}"/>
69 </field>
70 <xpath expr="//page[@string='Other Information']/group"
71 position="inside">
72 <group name="exception" colspan="2" col="2">
73 <separator string="Exception" colspan="2"/>
74 <field name="exceptions_ids" colspan="2" nolabel="1"/>
75 </group>
76 </xpath>
77 </field>
78 </record>
79
80 <record id="view_order_tree" model="ir.ui.view">
81 <field name="name">sale_exceptions.view_order_tree</field>
82 <field name="model">sale.order</field>
83 <field name="type">tree</field>
84 <field name="inherit_id" ref="sale.view_order_tree"/>
85 <field name="arch" type="xml">
86 <field name="state" position="after">
87 <field name="main_exception_id"/>
88 </field>
89 </field>
90 </record>
91
92 <record id="view_sales_order_filter" model="ir.ui.view">
93 <field name="name">sale_exceptions.view_sales_order_filter</field>
94 <field name="model">sale.order</field>
95 <field name="inherit_id" ref="sale.view_sales_order_filter" />
96 <field name="type">search</field>
97 <field eval="32" name="priority"/>
98 <field name="arch" type="xml">
99 <filter icon="terp-check" string="Sales" position="after">
100 <separator orientation="vertical"/>
101 <filter icon="terp-emblem-important" name="tofix" string="TO FIX" domain="[('main_exception_id','!=',False)]"/>
102 </filter>
103 </field>
104 </record>
105 </data>
106</openerp>
1070
=== removed file 'sale_exceptions/sale_workflow.xml'
--- sale_exceptions/sale_workflow.xml 2011-03-07 12:19:42 +0000
+++ sale_exceptions/sale_workflow.xml 1970-01-01 00:00:00 +0000
@@ -1,9 +0,0 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <record id="sale.trans_draft_router" model="workflow.transition">
5 <field name="signal">order_confirm</field>
6 <field name="condition">test_exceptions()</field>
7 </record>
8 </data>
9</openerp>
100
=== removed directory 'sale_exceptions/security'
=== removed file 'sale_exceptions/security/ir.model.access.csv'
--- sale_exceptions/security/ir.model.access.csv 2012-02-13 09:31:57 +0000
+++ sale_exceptions/security/ir.model.access.csv 1970-01-01 00:00:00 +0000
@@ -1,3 +0,0 @@
1"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
2"access_sale_exception","sale.exception","model_sale_exception","base.group_user",1,0,0,0
3"access_sale_exception_manager","sale.exception","model_sale_exception","base.group_sale_manager",1,1,1,1
40
=== removed directory 'sale_exceptions/settings'
=== removed file 'sale_exceptions/settings/sale.exception.csv'
--- sale_exceptions/settings/sale.exception.csv 2012-05-19 11:13:51 +0000
+++ sale_exceptions/settings/sale.exception.csv 1970-01-01 00:00:00 +0000
@@ -1,5 +0,0 @@
1"id","name","description","sequence","model","code","active"
2"excep_no_zip","No ZIP code on destination",,50,"sale.order","if not order.partner_shipping_id.zip:
3 failed=True",False
4"excep_no_stock","Not Enough Virtual Stock",,50,"sale.order.line","if line.product_id and line.product_id.type == 'product' and line.product_id.virtual_available < line.product_uom_qty:
5 failed=True",False
60
=== removed directory 'sale_exceptions/wizard'
=== removed file 'sale_exceptions/wizard/__init__.py'
--- sale_exceptions/wizard/__init__.py 2012-02-24 09:31:32 +0000
+++ sale_exceptions/wizard/__init__.py 1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
1import sale_exception_confirm
20
=== removed file 'sale_exceptions/wizard/sale_exception_confirm.py'
--- sale_exceptions/wizard/sale_exception_confirm.py 2012-05-16 12:53:59 +0000
+++ sale_exceptions/wizard/sale_exception_confirm.py 1970-01-01 00:00:00 +0000
@@ -1,56 +0,0 @@
1# -*- encoding: utf-8 -*-
2##############################################################################
3#
4# Copyright Camptocamp SA
5# @author: Guewen Baconnier
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation, either version 3 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22import netsvc
23
24from osv import osv, fields
25
26
27class SaleExceptionConfirm(osv.osv_memory):
28
29 _name = 'sale.exception.confirm'
30
31 _columns = {
32 'sale_id': fields.many2one('sale.order', 'Sale'),
33 'exception_ids': fields.many2many('sale.exception', string='Exceptions to resolve', readonly=True),
34 'ignore': fields.boolean('Ignore Exceptions'),
35 }
36
37 def default_get(self, cr, uid, fields, context=None):
38 res = super(SaleExceptionConfirm, self).default_get(cr, uid, fields, context=context)
39 order_obj = self.pool.get('sale.order')
40 sale_id = context.get('active_id', False)
41 if sale_id:
42 sale = order_obj.browse(cr, uid, sale_id, context=context)
43 exception_ids = [e.id for e in sale.exceptions_ids]
44 res.update({'exception_ids': [(6, 0, exception_ids)]})
45
46 res.update({'sale_id': sale_id})
47 return res
48
49 def action_confirm(self, cr, uid, ids, context=None):
50 form = self.browse(cr, uid, ids[0], context=context)
51 if form.ignore:
52 self.pool.get('sale.order').write(cr, uid, form.sale_id.id,
53 {'ignore_exceptions': True}, context=context)
54 return {'type': 'ir.actions.act_window_close'}
55
56SaleExceptionConfirm()
570
=== removed file 'sale_exceptions/wizard/sale_exception_confirm_view.xml'
--- sale_exceptions/wizard/sale_exception_confirm_view.xml 2012-12-26 09:30:24 +0000
+++ sale_exceptions/wizard/sale_exception_confirm_view.xml 1970-01-01 00:00:00 +0000
@@ -1,44 +0,0 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4
5 <record id="view_sale_exception_confirm" model="ir.ui.view">
6 <field name="name">Sale Exceptions</field>
7 <field name="model">sale.exception.confirm</field>
8 <field name="type">form</field>
9 <field name="arch" type="xml">
10 <form string="Sale Exceptions On Sale Order" version="7.0">
11 <group>
12 <field name="exception_ids" nolabel="1" colspan="4">
13 <form string="Sale Exception">
14 <field name="name" colspan="4"/>
15 <field name="description" colspan="4"/>
16 </form>
17 <tree string="Sale Exceptions">
18 <field name="name"/>
19 <field name="description"/>
20 </tree>
21 </field>
22 <newline/>
23 <field name="ignore" groups='base.group_sale_manager'/>
24 </group>
25 <footer>
26 <button name="action_confirm" string="_Ok"
27 colspan="1" type="object" icon="gtk-ok" />
28 </footer>
29 </form>
30 </field>
31 </record>
32
33 <record id="action_sale_exception_confirm" model="ir.actions.act_window">
34 <field name="name">Sale Exceptions</field>
35 <field name="type">ir.actions.act_window</field>
36 <field name="res_model">sale.exception.confirm</field>
37 <field name="view_type">form</field>
38 <field name="view_mode">form</field>
39 <field name="view_id" ref="view_sale_exception_confirm"/>
40 <field name="target">new</field>
41 </record>
42
43 </data>
44</openerp>

Subscribers

People subscribed via source and target branches