Merge lp:~openerp-dev/openobject-addons/trunk_module_rename-pza into lp:openobject-addons
- trunk_module_rename-pza
- Merge into trunk
Status: | Approved |
---|---|
Approved by: | Mustufa Rangwala (Open ERP) |
Approved revision: | 8966 |
Proposed branch: | lp:~openerp-dev/openobject-addons/trunk_module_rename-pza |
Merge into: | lp:openobject-addons |
Diff against target: |
759 lines (+298/-217) 24 files modified
mrp/res_config.py (+2/-2) mrp/res_config_view.xml (+2/-2) mrp/test/order_process.yml (+1/-1) procurement/procurement.py (+4/-4) procurement_jit/__openerp__.py (+2/-2) procurement_jit/test/procurement_jit.yml (+1/-1) project/res_config.py (+2/-2) project/res_config_view.xml (+2/-2) project_mrp/project_mrp.py (+0/-126) project_mrp/project_mrp_view.xml (+0/-63) sale/res_config.py (+1/-1) sale/sale_unit_test.xml (+1/-1) sale_service/__init__.py (+24/-0) sale_service/__openerp__.py (+3/-3) sale_service/demo/sale_service_demo.xml (+1/-1) sale_service/models/__init__.py (+4/-2) sale_service/models/product.py (+30/-0) sale_service/models/project.py (+63/-0) sale_service/models/sale.py (+79/-0) sale_service/views/procurement_view.xml (+15/-0) sale_service/views/product_view.xml (+32/-0) sale_service/views/project_view.xml (+25/-0) sale_stock/res_config.py (+3/-3) sale_stock/res_config_view.xml (+1/-1) |
To merge this branch: | bzr merge lp:~openerp-dev/openobject-addons/trunk_module_rename-pza |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mustufa Rangwala (Open ERP) (community) | Needs Fixing | ||
Review via email: mp+190597@code.launchpad.net |
Commit message
Description of the change
Hello,
I have done following changes:
-> rename "project_mrp" with "sale_service"
-> rename "mrp_jit" with "procurement_jit"
-> Re-organize modules project_mrp and mrp_jit
Thank You.
- 8943. By Pooja Zankhariya(OpenERP)
-
[IMP]Improved Copyright
- 8944. By Pooja Zankhariya(OpenERP)
-
[MERGE]Merge with trunk
- 8945. By Pooja Zankhariya(OpenERP)
-
[MERGE]Merge with Trunk
- 8946. By Pooja Zankhariya(OpenERP)
-
[MERGE]Merge with Trunk
- 8947. By Pooja Zankhariya(OpenERP)
-
[MERGE]Merge with Trunk
- 8948. By Pooja Zankhariya(OpenERP)
-
[MERGE]Merge with Trunk
- 8949. By Pooja Zankhariya(OpenERP)
-
[MERGE]Merge with Trunk
- 8950. By Pooja Zankhariya(OpenERP)
-
[MERGE]Merge with Trunk
- 8951. By Pooja Zankhariya(OpenERP)
-
[MERGE]Merge with Trunk
- 8952. By Pooja Zankhariya(OpenERP)
-
[MERGE]Merge with Trunk
- 8953. By Pooja Zankhariya(OpenERP)
-
[MERGE]Mergw with Trunk
- 8954. By Pooja Zankhariya(OpenERP)
-
[MERGE]Merge with Trunk
- 8955. By Pooja Zankhariya(OpenERP)
-
[MERGE]Merge with Trunk
- 8956. By Pooja Zankhariya(OpenERP)
-
[MERGE]Merge with Trunk
- 8957. By Pooja Zankhariya(OpenERP)
-
[MERGE]Sync with Trunk
- 8958. By Pooja Zankhariya(OpenERP)
-
[MERGE]Sync with Trunk
- 8959. By Pooja Zankhariya(OpenERP)
-
[MERGE]Sync with Trunk
- 8960. By Jitendra Prajapati(OpenERP)
-
[MERGE]with lp:openobject-addons
- 8961. By Jitendra Prajapati(OpenERP)
-
[MERGE]with main branch
- 8962. By Jitendra Prajapati(OpenERP)
-
[MERGE]with main branch
- 8963. By Jaydeep Barot(OpenERP)
-
[MERGE] Merge with main branch
- 8964. By Jaydeep Barot(OpenERP)
-
[IMP] minor changes rename to mrp_jit to procurement_jit and project_mrp to sale_service
- 8965. By Jaydeep Barot(OpenERP)
-
[MERGE] Merge with addons
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote : | # |
Changes seems ok.
Improve the Copyright years.
Regards,
Mustufa
- 8966. By Jaydeep Barot(OpenERP)
-
[IMP] minor changes apply for Copyright msg add text 2004 instead of 2013
- 8967. By Jaydeep Barot(OpenERP)
-
[MERGE] Merge with addons
Unmerged revisions
- 8967. By Jaydeep Barot(OpenERP)
-
[MERGE] Merge with addons
- 8966. By Jaydeep Barot(OpenERP)
-
[IMP] minor changes apply for Copyright msg add text 2004 instead of 2013
- 8965. By Jaydeep Barot(OpenERP)
-
[MERGE] Merge with addons
- 8964. By Jaydeep Barot(OpenERP)
-
[IMP] minor changes rename to mrp_jit to procurement_jit and project_mrp to sale_service
- 8963. By Jaydeep Barot(OpenERP)
-
[MERGE] Merge with main branch
- 8962. By Jitendra Prajapati(OpenERP)
-
[MERGE]with main branch
- 8961. By Jitendra Prajapati(OpenERP)
-
[MERGE]with main branch
- 8960. By Jitendra Prajapati(OpenERP)
-
[MERGE]with lp:openobject-addons
- 8959. By Pooja Zankhariya(OpenERP)
-
[MERGE]Sync with Trunk
- 8958. By Pooja Zankhariya(OpenERP)
-
[MERGE]Sync with Trunk
Preview Diff
1 | === modified file 'mrp/res_config.py' |
2 | --- mrp/res_config.py 2013-10-27 12:31:04 +0000 |
3 | +++ mrp/res_config.py 2014-05-02 13:01:32 +0000 |
4 | @@ -44,11 +44,11 @@ |
5 | 'Without this module: A + B + C -> D.\n' |
6 | 'With this module: A + B + C -> D + E.\n' |
7 | '-This installs the module mrp_byproduct.'), |
8 | - 'module_mrp_jit': fields.boolean("Generate procurement in real time", |
9 | + 'module_procurement_jit': fields.boolean("Generate procurement in real time", |
10 | help='This allows Just In Time computation of procurement orders.\n' |
11 | 'All procurement orders will be processed immediately, which could in some ' |
12 | 'cases entail a small performance impact.\n' |
13 | - '-This installs the module mrp_jit.'), |
14 | + '-This installs the module procurement_jit.'), |
15 | 'module_stock_no_autopicking': fields.boolean("Manage manual picking to fulfill manufacturing orders ", |
16 | help='This module allows an intermediate picking process to provide raw materials to production orders.\n' |
17 | 'For example to manage production made by your suppliers (sub-contracting).\n' |
18 | |
19 | === modified file 'mrp/res_config_view.xml' |
20 | --- mrp/res_config_view.xml 2012-11-29 22:26:45 +0000 |
21 | +++ mrp/res_config_view.xml 2014-05-02 13:01:32 +0000 |
22 | @@ -45,8 +45,8 @@ |
23 | <label for="id" string="Planning"/> |
24 | <div> |
25 | <div> |
26 | - <field name="module_mrp_jit" class="oe_inline"/> |
27 | - <label for="module_mrp_jit"/> |
28 | + <field name="module_procurement_jit" class="oe_inline"/> |
29 | + <label for="module_procurement_jit"/> |
30 | </div> |
31 | <div> |
32 | <field name="group_mrp_routings" class="oe_inline"/> |
33 | |
34 | === modified file 'mrp/test/order_process.yml' |
35 | --- mrp/test/order_process.yml 2014-04-07 16:33:18 +0000 |
36 | +++ mrp/test/order_process.yml 2014-05-02 13:01:32 +0000 |
37 | @@ -110,7 +110,7 @@ |
38 | procurement_ids = procurement.search(cr, uid, [('move_id','=',move_line.id)]) |
39 | assert procurement_ids, "Procurement should be created for shipment line of raw materials." |
40 | shipment_procurement = procurement.browse(cr, uid, procurement_ids[0], context=context) |
41 | - # procurement state should be `confirmed` at this stage, except if mrp_jit is installed, in which |
42 | + # procurement state should be `confirmed` at this stage, except if procurement_jit is installed, in which |
43 | # case it could already be in `running` or `exception` state (not enough stock) |
44 | expected_states = ('confirmed', 'running', 'exception') |
45 | assert shipment_procurement.state in expected_states, 'Procurement state is `%s` for %s, expected one of %s' % \ |
46 | |
47 | === modified file 'procurement/procurement.py' |
48 | --- procurement/procurement.py 2014-04-24 12:35:38 +0000 |
49 | +++ procurement/procurement.py 2014-05-02 13:01:32 +0000 |
50 | @@ -247,7 +247,7 @@ |
51 | |
52 | def check_produce_service(self, cr, uid, procurement, context=None): |
53 | """ Depicts the capacity of the procurement workflow to deal with production of services. |
54 | - By default, it's False. Overwritten by project_mrp module. |
55 | + By default, it's False. Overwritten by sale_service module. |
56 | """ |
57 | return False |
58 | |
59 | @@ -312,9 +312,9 @@ |
60 | return True |
61 | return False |
62 | |
63 | - #Initialize get_phantom_bom_id method as it is raising an error from yml of mrp_jit |
64 | - #when one install first mrp and after that, mrp_jit. get_phantom_bom_id defined in mrp module |
65 | - #which is not dependent for mrp_jit. |
66 | + #Initialize get_phantom_bom_id method as it is raising an error from yml of procurement_jit |
67 | + #when one install first mrp and after that, procurement_jit. get_phantom_bom_id defined in mrp module |
68 | + #which is not dependent for procurement_jit. |
69 | def get_phantom_bom_id(self, cr, uid, ids, context=None): |
70 | return False |
71 | |
72 | |
73 | === renamed directory 'mrp_jit' => 'procurement_jit' |
74 | === modified file 'procurement_jit/__openerp__.py' |
75 | --- mrp_jit/__openerp__.py 2012-11-29 22:26:45 +0000 |
76 | +++ procurement_jit/__openerp__.py 2014-05-02 13:01:32 +0000 |
77 | @@ -40,9 +40,9 @@ |
78 | """, |
79 | 'author': 'OpenERP SA', |
80 | 'depends': ['procurement'], |
81 | - 'data': ['mrp_jit.xml'], |
82 | + 'data': ['procurement_jit.xml'], |
83 | 'demo': [], |
84 | - 'test': ['test/mrp_jit.yml'], |
85 | + 'test': ['test/procurement_jit.yml'], |
86 | 'installable': True, |
87 | 'auto_install': False, |
88 | } |
89 | |
90 | === renamed file 'mrp_jit/i18n/mrp_jit.pot' => 'procurement_jit/i18n/procurement_jit.pot' |
91 | === renamed file 'mrp_jit/mrp_jit.xml' => 'procurement_jit/procurement_jit.xml' |
92 | === renamed file 'mrp_jit/test/mrp_jit.yml' => 'procurement_jit/test/procurement_jit.yml' |
93 | --- mrp_jit/test/mrp_jit.yml 2012-11-29 22:26:45 +0000 |
94 | +++ procurement_jit/test/procurement_jit.yml 2014-05-02 13:01:32 +0000 |
95 | @@ -1,5 +1,5 @@ |
96 | - |
97 | - In order to test mrp_jit module with OpenERP, I create procurement order for |
98 | + In order to test procurement_jit module with OpenERP, I create procurement order for |
99 | Computer Case product and check whether it runs without scheduler or not. |
100 | - |
101 | !record {model: procurement.order, id: procurement_order_test1}: |
102 | |
103 | === modified file 'project/res_config.py' |
104 | --- project/res_config.py 2014-04-09 11:17:38 +0000 |
105 | +++ project/res_config.py 2014-05-02 13:01:32 +0000 |
106 | @@ -27,11 +27,11 @@ |
107 | _inherit = 'res.config.settings' |
108 | |
109 | _columns = { |
110 | - 'module_project_mrp': fields.boolean('Generate tasks from sale orders', |
111 | + 'module_sale_service': fields.boolean('Generate tasks from sale orders', |
112 | help='This feature automatically creates project tasks from service products in sale orders. ' |
113 | 'More precisely, tasks are created for procurement lines with product of type \'Service\', ' |
114 | 'procurement method \'Make to Order\', and supply method \'Manufacture\'.\n' |
115 | - '-This installs the module project_mrp.'), |
116 | + '-This installs the module sale_service.'), |
117 | 'module_pad': fields.boolean("Use integrated collaborative note pads on task", |
118 | help='Lets the company customize which Pad installation should be used to link to new pads ' |
119 | '(for example: http://ietherpad.com/).\n' |
120 | |
121 | === modified file 'project/res_config_view.xml' |
122 | --- project/res_config_view.xml 2014-04-09 11:17:38 +0000 |
123 | +++ project/res_config_view.xml 2014-05-02 13:01:32 +0000 |
124 | @@ -33,8 +33,8 @@ |
125 | <label for="module_project_timesheet"/> |
126 | </div> |
127 | <div> |
128 | - <field name="module_project_mrp" class="oe_inline"/> |
129 | - <label for="module_project_mrp"/> |
130 | + <field name="module_sale_service" class="oe_inline"/> |
131 | + <label for="module_sale_service"/> |
132 | </div> |
133 | <div> |
134 | <field name="module_pad" class="oe_inline"/> |
135 | |
136 | === removed file 'project_mrp/project_mrp.py' |
137 | --- project_mrp/project_mrp.py 2013-11-27 15:32:57 +0000 |
138 | +++ project_mrp/project_mrp.py 1970-01-01 00:00:00 +0000 |
139 | @@ -1,126 +0,0 @@ |
140 | -# -*- coding: utf-8 -*- |
141 | -############################################################################## |
142 | -# |
143 | -# OpenERP, Open Source Management Solution |
144 | -# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). |
145 | -# |
146 | -# This program is free software: you can redistribute it and/or modify |
147 | -# it under the terms of the GNU Affero General Public License as |
148 | -# published by the Free Software Foundation, either version 3 of the |
149 | -# License, or (at your option) any later version. |
150 | -# |
151 | -# This program is distributed in the hope that it will be useful, |
152 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of |
153 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
154 | -# GNU Affero General Public License for more details. |
155 | -# |
156 | -# You should have received a copy of the GNU Affero General Public License |
157 | -# along with this program. If not, see <http://www.gnu.org/licenses/>. |
158 | -# |
159 | -############################################################################## |
160 | - |
161 | -from openerp.osv import fields, osv |
162 | -from openerp import workflow |
163 | - |
164 | - |
165 | -class ProjectTaskStageMrp(osv.Model): |
166 | - """ Override project.task.type model to add a 'closed' boolean field allowing |
167 | - to know that tasks in this stage are considered as closed. Indeed since |
168 | - OpenERP 8.0 status is not present on tasks anymore, only stage_id. """ |
169 | - _name = 'project.task.type' |
170 | - _inherit = 'project.task.type' |
171 | - |
172 | - _columns = { |
173 | - 'closed': fields.boolean('Close', help="Tasks in this stage are considered as closed."), |
174 | - } |
175 | - |
176 | - _defaults = { |
177 | - 'closed': False, |
178 | - } |
179 | - |
180 | - |
181 | -class project_task(osv.osv): |
182 | - _name = "project.task" |
183 | - _inherit = "project.task" |
184 | - _columns = { |
185 | - 'procurement_id': fields.many2one('procurement.order', 'Procurement', ondelete='set null'), |
186 | - 'sale_line_id': fields.related('procurement_id', 'sale_line_id', type='many2one', relation='sale.order.line', store=True, string='Sales Order Line'), |
187 | - } |
188 | - |
189 | - def _validate_subflows(self, cr, uid, ids, context=None): |
190 | - for task in self.browse(cr, uid, ids): |
191 | - if task.procurement_id: |
192 | - workflow.trg_write(uid, 'procurement.order', task.procurement_id.id, cr) |
193 | - |
194 | - def write(self, cr, uid, ids, values, context=None): |
195 | - """ When closing tasks, validate subflows. """ |
196 | - res = super(project_task, self).write(cr, uid, ids, values, context=context) |
197 | - if values.get('stage_id'): |
198 | - stage = self.pool.get('project.task.type').browse(cr, uid, values.get('stage_id'), context=context) |
199 | - if stage.closed: |
200 | - self._validate_subflows(cr, uid, ids, context=context) |
201 | - return res |
202 | - |
203 | - |
204 | -class product_product(osv.osv): |
205 | - _inherit = "product.product" |
206 | - _columns = { |
207 | - 'project_id': fields.many2one('project.project', 'Project', ondelete='set null',) |
208 | - } |
209 | - |
210 | - |
211 | -class sale_order(osv.osv): |
212 | - _inherit = 'sale.order' |
213 | - |
214 | - def _prepare_order_line_procurement(self, cr, uid, order, line, move_id, date_planned, context=None): |
215 | - proc_data = super(sale_order, self)._prepare_order_line_procurement(cr, |
216 | - uid, order, line, move_id, date_planned, context=context) |
217 | - proc_data['sale_line_id'] = line.id |
218 | - return proc_data |
219 | - |
220 | - def _picked_rate(self, cr, uid, ids, name, arg, context=None): |
221 | - if not ids: |
222 | - return {} |
223 | - res_sale = {} |
224 | - res = super(sale_order, self)._picked_rate(cr, uid, ids, name, arg, context=context) |
225 | - cr.execute('''select sol.order_id as sale_id, stage.closed as task_closed , |
226 | - t.id as task_id, sum(sol.product_uom_qty) as total |
227 | - from project_task as t |
228 | - left join sale_order_line as sol on sol.id = t.sale_line_id |
229 | - left join project_task_type as stage on stage.id = t.stage_id |
230 | - where sol.order_id in %s group by sol.order_id,stage.closed,t.id ''',(tuple(ids),)) |
231 | - sale_task_data = cr.dictfetchall() |
232 | - |
233 | - if not sale_task_data: |
234 | - return res |
235 | - |
236 | - for id in ids: |
237 | - res_sale[id] = { |
238 | - 'number_of_done': 0, |
239 | - 'total_no_task': 0, |
240 | - } |
241 | - #compute the sum of quantity for each SO |
242 | - cr.execute('''select sol.order_id as sale_id, sum(sol.product_uom_qty) as total |
243 | - from sale_order_line sol where sol.order_id in %s group by sol.order_id''',(tuple(ids),)) |
244 | - total_qtty_ref = cr.dictfetchall() |
245 | - for item in total_qtty_ref: |
246 | - res_sale[item['sale_id']]['number_of_stockable'] = item['total'] |
247 | - |
248 | - for item in sale_task_data: |
249 | - res_sale[item['sale_id']]['total_no_task'] += item['total'] |
250 | - if item['task_closed']: |
251 | - res_sale[item['sale_id']]['number_of_done'] += item['total'] |
252 | - |
253 | - for sale in self.browse(cr, uid, ids, context=context): |
254 | - if 'number_of_stockable' in res_sale[sale.id]: |
255 | - res_sale[sale.id]['number_of_stockable'] -= res_sale[sale.id]['total_no_task'] |
256 | - #adjust previously percentage because now we must also count the product of type service |
257 | - res[sale.id] = res[sale.id] * float(res_sale[sale.id]['number_of_stockable']) / (res_sale[sale.id]['number_of_stockable'] + res_sale[sale.id]['total_no_task']) |
258 | - #add the task |
259 | - res[sale.id] += res_sale[sale.id]['number_of_done'] * 100 / (res_sale[sale.id]['number_of_stockable'] + res_sale[sale.id]['total_no_task']) |
260 | - return res |
261 | - |
262 | - _columns = { |
263 | - 'picked_rate': fields.function(_picked_rate, method=True, string='Picked', type='float'), |
264 | - } |
265 | - |
266 | |
267 | === removed file 'project_mrp/project_mrp_view.xml' |
268 | --- project_mrp/project_mrp_view.xml 2013-10-27 12:31:04 +0000 |
269 | +++ project_mrp/project_mrp_view.xml 1970-01-01 00:00:00 +0000 |
270 | @@ -1,63 +0,0 @@ |
271 | -<?xml version="1.0" encoding="utf-8"?> |
272 | -<openerp> |
273 | - <data> |
274 | - <record id="view_procurement_task_form" model="ir.ui.view"> |
275 | - <field name="name">procurement.procurement.form.view.inherit</field> |
276 | - <field name="model">procurement.order</field> |
277 | - <field name="inherit_id" ref="procurement.procurement_form_view"/> |
278 | - <field name="arch" type="xml"> |
279 | - <field name="close_move" position="after"> |
280 | - <field name="task_id"/> |
281 | - </field> |
282 | - </field> |
283 | - </record> |
284 | - <record id="view_product_task_form" model="ir.ui.view"> |
285 | - <field name="name">product.form.view.inherit</field> |
286 | - <field name="model">product.product</field> |
287 | - <field name="inherit_id" ref="stock.view_normal_procurement_locations_form"/> |
288 | - <field name="arch" type="xml"> |
289 | - <field name="type" position="after"> |
290 | - <field name="project_id" attrs="{'invisible':[('type','!=','service')]}" /> |
291 | - </field> |
292 | - </field> |
293 | - </record> |
294 | - <record id="task_type_edit_mrp_inherit" model="ir.ui.view"> |
295 | - <field name="name">project.task.type.mrp.inherit</field> |
296 | - <field name="model">project.task.type</field> |
297 | - <field name="inherit_id" ref="project.task_type_edit"/> |
298 | - <field name="arch" type="xml"> |
299 | - <field name="case_default" position="after"> |
300 | - <field name="closed"/> |
301 | - </field> |
302 | - </field> |
303 | - </record> |
304 | - <record id="view_project_mrp_inherit_form2" model="ir.ui.view"> |
305 | - <field name="name">project.mrp.form.view.inherit</field> |
306 | - <field name="model">project.task</field> |
307 | - <field name="inherit_id" ref="project.view_task_form2"/> |
308 | - <field name="arch" type="xml"> |
309 | - <field name="company_id" position="before"> |
310 | - <field name="sale_line_id" string="Order Line"/> |
311 | - </field> |
312 | - </field> |
313 | - </record> |
314 | - <record id="product_product_normal_form_supply_view" model="ir.ui.view"> |
315 | - <field name="name">product.normal.form.project_mrp.inherit</field> |
316 | - <field name="model">product.product</field> |
317 | - <field name="inherit_id" ref="procurement.product_form_view_procurement_button"/> |
318 | - <field name="arch" type="xml"> |
319 | - <xpath expr="//field[@name='supply_method']" position="attributes"> |
320 | - <attribute name="invisible">False</attribute> |
321 | - </xpath> |
322 | - <group name="procurement_help" position="inside"> |
323 | - <p attrs="{'invisible': ['|','|',('type','<>','service'),('procure_method','<>','make_to_order'),('supply_method','<>','produce')]}"> |
324 | - When you sell this service to a customer, <b>a task</b> will be |
325 | - created to follow up the job to do. This task will appear |
326 | - in the project related to the contract of the sales order. |
327 | - </p> |
328 | - </group> |
329 | - </field> |
330 | - </record> |
331 | - </data> |
332 | -</openerp> |
333 | - |
334 | |
335 | === modified file 'sale/res_config.py' |
336 | --- sale/res_config.py 2014-01-29 08:32:09 +0000 |
337 | +++ sale/res_config.py 2014-05-02 13:01:32 +0000 |
338 | @@ -152,7 +152,7 @@ |
339 | def onchange_task_work(self, cr, uid, ids, task_work, context=None): |
340 | return {'value': { |
341 | 'module_project_timesheet': task_work, |
342 | - 'module_project_mrp': task_work, |
343 | + 'module_sale_service': task_work, |
344 | }} |
345 | |
346 | def onchange_timesheet(self, cr, uid, ids, timesheet, context=None): |
347 | |
348 | === modified file 'sale/sale_unit_test.xml' |
349 | --- sale/sale_unit_test.xml 2013-10-27 12:31:04 +0000 |
350 | +++ sale/sale_unit_test.xml 2014-05-02 13:01:32 +0000 |
351 | @@ -84,7 +84,7 @@ |
352 | |
353 | <assert id="test_order_1" model="sale.order" severity="error" string="the sales order's picking will be sent to the good address and is already confirmed"> |
354 | <test expr="picking_ids[0].partner_id == partner_shipping_id"/> |
355 | - <!-- test expr="picking_ids[0].state">confirmed</test # Desactivated because of MRP_JIT --> |
356 | + <!-- test expr="picking_ids[0].state">confirmed</test # Desactivated because of procurement_jit --> |
357 | </assert> |
358 | |
359 | <!-- Here we need to use the function tag because action_assign is a method of stock_picking and not part of the workflow --> |
360 | |
361 | === renamed directory 'project_mrp' => 'sale_service' |
362 | === added file 'sale_service/__init__.py' |
363 | --- sale_service/__init__.py 1970-01-01 00:00:00 +0000 |
364 | +++ sale_service/__init__.py 2014-05-02 13:01:32 +0000 |
365 | @@ -0,0 +1,24 @@ |
366 | +# -*- coding: utf-8 -*- |
367 | +############################################################################## |
368 | +# |
369 | +# OpenERP, Open Source Management Solution |
370 | +# Copyright (C) 2004-today OpenERP SA (<http://www.openerp.com>). |
371 | +# |
372 | +# This program is free software: you can redistribute it and/or modify |
373 | +# it under the terms of the GNU Affero General Public License as |
374 | +# published by the Free Software Foundation, either version 3 of the |
375 | +# License, or (at your option) any later version. |
376 | +# |
377 | +# This program is distributed in the hope that it will be useful, |
378 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
379 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
380 | +# GNU Affero General Public License for more details. |
381 | +# |
382 | +# You should have received a copy of the GNU Affero General Public License |
383 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
384 | +# |
385 | +############################################################################## |
386 | + |
387 | +import models |
388 | + |
389 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
390 | |
391 | === modified file 'sale_service/__openerp__.py' |
392 | --- project_mrp/__openerp__.py 2014-02-10 08:48:03 +0000 |
393 | +++ sale_service/__openerp__.py 2014-05-02 13:01:32 +0000 |
394 | @@ -49,9 +49,9 @@ |
395 | 'author': 'OpenERP SA', |
396 | 'website': 'http://www.openerp.com', |
397 | 'images': ['images/product.jpeg', 'images/task_from_SO.jpeg'], |
398 | - 'depends': ['project', 'procurement', 'sale', 'mrp_jit'], |
399 | - 'data': ['project_mrp_workflow.xml', 'project_mrp_view.xml'], |
400 | - 'demo': ['project_mrp_demo.xml'], |
401 | + 'depends': ['project', 'procurement', 'sale', 'procurement_jit'], |
402 | + 'data': ['sale_service_workflow.xml', 'views/procurement_view.xml', 'views/project_view.xml', 'views/product_view.xml'], |
403 | + 'demo': ['demo/sale_service_demo.xml'], |
404 | 'test': ['test/project_task_procurement.yml'], |
405 | 'installable': True, |
406 | 'auto_install': False, |
407 | |
408 | === added directory 'sale_service/demo' |
409 | === renamed file 'project_mrp/project_mrp_demo.xml' => 'sale_service/demo/sale_service_demo.xml' |
410 | --- project_mrp/project_mrp_demo.xml 2013-10-27 12:31:04 +0000 |
411 | +++ sale_service/demo/sale_service_demo.xml 2014-05-02 13:01:32 +0000 |
412 | @@ -14,7 +14,7 @@ |
413 | </record> |
414 | |
415 | <record id="project.project_tt_deployment" model="project.task.type"> |
416 | - <field name="closed" eval="True"/> |
417 | + <field name="closed" eval="True"/> |
418 | </record> |
419 | </data> |
420 | </openerp> |
421 | |
422 | === renamed file 'project_mrp/i18n/project_mrp.pot' => 'sale_service/i18n/sale_service.pot' |
423 | === added directory 'sale_service/models' |
424 | === renamed file 'project_mrp/__init__.py' => 'sale_service/models/__init__.py' |
425 | --- project_mrp/__init__.py 2011-12-19 16:54:40 +0000 |
426 | +++ sale_service/models/__init__.py 2014-05-02 13:01:32 +0000 |
427 | @@ -19,7 +19,9 @@ |
428 | # |
429 | ############################################################################## |
430 | |
431 | -import project_procurement |
432 | -import project_mrp |
433 | +import procurement |
434 | +import product |
435 | +import project |
436 | +import sale |
437 | |
438 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
439 | |
440 | === renamed file 'project_mrp/project_procurement.py' => 'sale_service/models/procurement.py' |
441 | === added file 'sale_service/models/product.py' |
442 | --- sale_service/models/product.py 1970-01-01 00:00:00 +0000 |
443 | +++ sale_service/models/product.py 2014-05-02 13:01:32 +0000 |
444 | @@ -0,0 +1,30 @@ |
445 | +# -*- coding: utf-8 -*- |
446 | +############################################################################## |
447 | +# |
448 | +# OpenERP, Open Source Management Solution |
449 | +# Copyright (C) 2004-today OpenERP SA (<http://www.openerp.com>). |
450 | +# |
451 | +# This program is free software: you can redistribute it and/or modify |
452 | +# it under the terms of the GNU Affero General Public License as |
453 | +# published by the Free Software Foundation, either version 3 of the |
454 | +# License, or (at your option) any later version. |
455 | +# |
456 | +# This program is distributed in the hope that it will be useful, |
457 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
458 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
459 | +# GNU Affero General Public License for more details. |
460 | +# |
461 | +# You should have received a copy of the GNU Affero General Public License |
462 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
463 | +# |
464 | +############################################################################## |
465 | + |
466 | +from openerp.osv import fields, osv |
467 | + |
468 | +class product_product(osv.osv): |
469 | + _inherit = "product.product" |
470 | + _columns = { |
471 | + 'project_id': fields.many2one('project.project', 'Project', ondelete='set null',) |
472 | + } |
473 | + |
474 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
475 | |
476 | === added file 'sale_service/models/project.py' |
477 | --- sale_service/models/project.py 1970-01-01 00:00:00 +0000 |
478 | +++ sale_service/models/project.py 2014-05-02 13:01:32 +0000 |
479 | @@ -0,0 +1,63 @@ |
480 | +# -*- coding: utf-8 -*- |
481 | +############################################################################## |
482 | +# |
483 | +# OpenERP, Open Source Management Solution |
484 | +# Copyright (C) 2004-today OpenERP SA (<http://www.openerp.com>). |
485 | +# |
486 | +# This program is free software: you can redistribute it and/or modify |
487 | +# it under the terms of the GNU Affero General Public License as |
488 | +# published by the Free Software Foundation, either version 3 of the |
489 | +# License, or (at your option) any later version. |
490 | +# |
491 | +# This program is distributed in the hope that it will be useful, |
492 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
493 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
494 | +# GNU Affero General Public License for more details. |
495 | +# |
496 | +# You should have received a copy of the GNU Affero General Public License |
497 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
498 | +# |
499 | +############################################################################## |
500 | + |
501 | +from openerp.osv import fields, osv |
502 | +from openerp import workflow |
503 | + |
504 | +class ProjectTaskStageMrp(osv.Model): |
505 | + """ Override project.task.type model to add a 'closed' boolean field allowing |
506 | + to know that tasks in this stage are considered as closed. Indeed since |
507 | + OpenERP 8.0 status is not present on tasks anymore, only stage_id. """ |
508 | + _name = 'project.task.type' |
509 | + _inherit = 'project.task.type' |
510 | + |
511 | + _columns = { |
512 | + 'closed': fields.boolean('Close', help="Tasks in this stage are considered as closed."), |
513 | + } |
514 | + |
515 | + _defaults = { |
516 | + 'closed': False, |
517 | + } |
518 | + |
519 | + |
520 | +class project_task(osv.osv): |
521 | + _name = "project.task" |
522 | + _inherit = "project.task" |
523 | + _columns = { |
524 | + 'procurement_id': fields.many2one('procurement.order', 'Procurement', ondelete='set null'), |
525 | + 'sale_line_id': fields.related('procurement_id', 'sale_line_id', type='many2one', relation='sale.order.line', store=True, string='Sales Order Line'), |
526 | + } |
527 | + |
528 | + def _validate_subflows(self, cr, uid, ids, context=None): |
529 | + for task in self.browse(cr, uid, ids): |
530 | + if task.procurement_id: |
531 | + workflow.trg_write(uid, 'procurement.order', task.procurement_id.id, cr) |
532 | + |
533 | + def write(self, cr, uid, ids, values, context=None): |
534 | + """ When closing tasks, validate subflows. """ |
535 | + res = super(project_task, self).write(cr, uid, ids, values, context=context) |
536 | + if values.get('stage_id'): |
537 | + stage = self.pool.get('project.task.type').browse(cr, uid, values.get('stage_id'), context=context) |
538 | + if stage.closed: |
539 | + self._validate_subflows(cr, uid, ids, context=context) |
540 | + return res |
541 | + |
542 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
543 | |
544 | === added file 'sale_service/models/sale.py' |
545 | --- sale_service/models/sale.py 1970-01-01 00:00:00 +0000 |
546 | +++ sale_service/models/sale.py 2014-05-02 13:01:32 +0000 |
547 | @@ -0,0 +1,79 @@ |
548 | +# -*- coding: utf-8 -*- |
549 | +############################################################################## |
550 | +# |
551 | +# OpenERP, Open Source Management Solution |
552 | +# Copyright (C) 2004-today OpenERP SA (<http://www.openerp.com>). |
553 | +# |
554 | +# This program is free software: you can redistribute it and/or modify |
555 | +# it under the terms of the GNU Affero General Public License as |
556 | +# published by the Free Software Foundation, either version 3 of the |
557 | +# License, or (at your option) any later version. |
558 | +# |
559 | +# This program is distributed in the hope that it will be useful, |
560 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
561 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
562 | +# GNU Affero General Public License for more details. |
563 | +# |
564 | +# You should have received a copy of the GNU Affero General Public License |
565 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
566 | +# |
567 | +############################################################################## |
568 | + |
569 | +from openerp.osv import fields, osv |
570 | + |
571 | +class sale_order(osv.osv): |
572 | + _inherit = 'sale.order' |
573 | + |
574 | + def _prepare_order_line_procurement(self, cr, uid, order, line, move_id, date_planned, context=None): |
575 | + proc_data = super(sale_order, self)._prepare_order_line_procurement(cr, |
576 | + uid, order, line, move_id, date_planned, context=context) |
577 | + proc_data['sale_line_id'] = line.id |
578 | + return proc_data |
579 | + |
580 | + def _picked_rate(self, cr, uid, ids, name, arg, context=None): |
581 | + if not ids: |
582 | + return {} |
583 | + res_sale = {} |
584 | + res = super(sale_order, self)._picked_rate(cr, uid, ids, name, arg, context=context) |
585 | + cr.execute('''select sol.order_id as sale_id, stage.closed as task_closed , |
586 | + t.id as task_id, sum(sol.product_uom_qty) as total |
587 | + from project_task as t |
588 | + left join sale_order_line as sol on sol.id = t.sale_line_id |
589 | + left join project_task_type as stage on stage.id = t.stage_id |
590 | + where sol.order_id in %s group by sol.order_id,stage.closed,t.id ''',(tuple(ids),)) |
591 | + sale_task_data = cr.dictfetchall() |
592 | + |
593 | + if not sale_task_data: |
594 | + return res |
595 | + |
596 | + for id in ids: |
597 | + res_sale[id] = { |
598 | + 'number_of_done': 0, |
599 | + 'total_no_task': 0, |
600 | + } |
601 | + #compute the sum of quantity for each SO |
602 | + cr.execute('''select sol.order_id as sale_id, sum(sol.product_uom_qty) as total |
603 | + from sale_order_line sol where sol.order_id in %s group by sol.order_id''',(tuple(ids),)) |
604 | + total_qtty_ref = cr.dictfetchall() |
605 | + for item in total_qtty_ref: |
606 | + res_sale[item['sale_id']]['number_of_stockable'] = item['total'] |
607 | + |
608 | + for item in sale_task_data: |
609 | + res_sale[item['sale_id']]['total_no_task'] += item['total'] |
610 | + if item['task_closed']: |
611 | + res_sale[item['sale_id']]['number_of_done'] += item['total'] |
612 | + |
613 | + for sale in self.browse(cr, uid, ids, context=context): |
614 | + if 'number_of_stockable' in res_sale[sale.id]: |
615 | + res_sale[sale.id]['number_of_stockable'] -= res_sale[sale.id]['total_no_task'] |
616 | + #adjust previously percentage because now we must also count the product of type service |
617 | + res[sale.id] = res[sale.id] * float(res_sale[sale.id]['number_of_stockable']) / (res_sale[sale.id]['number_of_stockable'] + res_sale[sale.id]['total_no_task']) |
618 | + #add the task |
619 | + res[sale.id] += res_sale[sale.id]['number_of_done'] * 100 / (res_sale[sale.id]['number_of_stockable'] + res_sale[sale.id]['total_no_task']) |
620 | + return res |
621 | + |
622 | + _columns = { |
623 | + 'picked_rate': fields.function(_picked_rate, method=True, string='Picked', type='float'), |
624 | + } |
625 | + |
626 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
627 | |
628 | === renamed file 'project_mrp/project_mrp_workflow.xml' => 'sale_service/sale_service_workflow.xml' |
629 | === added directory 'sale_service/views' |
630 | === added file 'sale_service/views/procurement_view.xml' |
631 | --- sale_service/views/procurement_view.xml 1970-01-01 00:00:00 +0000 |
632 | +++ sale_service/views/procurement_view.xml 2014-05-02 13:01:32 +0000 |
633 | @@ -0,0 +1,15 @@ |
634 | +<?xml version="1.0" encoding="utf-8"?> |
635 | +<openerp> |
636 | + <data> |
637 | + <record id="view_procurement_task_form" model="ir.ui.view"> |
638 | + <field name="name">procurement.procurement.form.view.inherit</field> |
639 | + <field name="model">procurement.order</field> |
640 | + <field name="inherit_id" ref="procurement.procurement_form_view"/> |
641 | + <field name="arch" type="xml"> |
642 | + <field name="close_move" position="after"> |
643 | + <field name="task_id"/> |
644 | + </field> |
645 | + </field> |
646 | + </record> |
647 | + </data> |
648 | +</openerp> |
649 | |
650 | === added file 'sale_service/views/product_view.xml' |
651 | --- sale_service/views/product_view.xml 1970-01-01 00:00:00 +0000 |
652 | +++ sale_service/views/product_view.xml 2014-05-02 13:01:32 +0000 |
653 | @@ -0,0 +1,32 @@ |
654 | +<?xml version="1.0" encoding="utf-8"?> |
655 | +<openerp> |
656 | + <data> |
657 | + <record id="view_product_task_form" model="ir.ui.view"> |
658 | + <field name="name">product.form.view.inherit</field> |
659 | + <field name="model">product.product</field> |
660 | + <field name="inherit_id" ref="stock.view_normal_procurement_locations_form"/> |
661 | + <field name="arch" type="xml"> |
662 | + <field name="type" position="after"> |
663 | + <field name="project_id" attrs="{'invisible':[('type','!=','service')]}" /> |
664 | + </field> |
665 | + </field> |
666 | + </record> |
667 | + <record id="product_product_normal_form_supply_view" model="ir.ui.view"> |
668 | + <field name="name">product.normal.form.sale_service.inherit</field> |
669 | + <field name="model">product.product</field> |
670 | + <field name="inherit_id" ref="procurement.product_form_view_procurement_button"/> |
671 | + <field name="arch" type="xml"> |
672 | + <xpath expr="//field[@name='supply_method']" position="attributes"> |
673 | + <attribute name="invisible">False</attribute> |
674 | + </xpath> |
675 | + <group name="procurement_help" position="inside"> |
676 | + <p attrs="{'invisible': ['|','|',('type','<>','service'),('procure_method','<>','make_to_order'),('supply_method','<>','produce')]}"> |
677 | + When you sell this service to a customer, <b>a task</b> will be |
678 | + created to follow up the job to do. This task will appear |
679 | + in the project related to the contract of the sales order. |
680 | + </p> |
681 | + </group> |
682 | + </field> |
683 | + </record> |
684 | + </data> |
685 | +</openerp> |
686 | |
687 | === added file 'sale_service/views/project_view.xml' |
688 | --- sale_service/views/project_view.xml 1970-01-01 00:00:00 +0000 |
689 | +++ sale_service/views/project_view.xml 2014-05-02 13:01:32 +0000 |
690 | @@ -0,0 +1,25 @@ |
691 | +<?xml version="1.0" encoding="utf-8"?> |
692 | +<openerp> |
693 | + <data> |
694 | + <record id="task_type_edit_mrp_inherit" model="ir.ui.view"> |
695 | + <field name="name">project.task.type.mrp.inherit</field> |
696 | + <field name="model">project.task.type</field> |
697 | + <field name="inherit_id" ref="project.task_type_edit"/> |
698 | + <field name="arch" type="xml"> |
699 | + <field name="case_default" position="after"> |
700 | + <field name="closed"/> |
701 | + </field> |
702 | + </field> |
703 | + </record> |
704 | + <record id="view_sale_service_inherit_form2" model="ir.ui.view"> |
705 | + <field name="name">sale.service.form.view.inherit</field> |
706 | + <field name="model">project.task</field> |
707 | + <field name="inherit_id" ref="project.view_task_form2"/> |
708 | + <field name="arch" type="xml"> |
709 | + <field name="company_id" position="before"> |
710 | + <field name="sale_line_id" string="Order Line"/> |
711 | + </field> |
712 | + </field> |
713 | + </record> |
714 | + </data> |
715 | +</openerp> |
716 | |
717 | === modified file 'sale_stock/res_config.py' |
718 | --- sale_stock/res_config.py 2014-01-21 08:48:46 +0000 |
719 | +++ sale_stock/res_config.py 2014-05-02 13:01:32 +0000 |
720 | @@ -35,7 +35,7 @@ |
721 | help='Lets you transfer the entries under tasks defined for Project Management to ' |
722 | 'the Timesheet line entries for particular date and particular user with the effect of creating, editing and deleting either ways ' |
723 | 'and to automatically creates project tasks from procurement lines.\n' |
724 | - '-This installs the modules project_timesheet and project_mrp.'), |
725 | + '-This installs the modules project_timesheet and sale_service.'), |
726 | 'default_order_policy': fields.selection( |
727 | [('manual', 'Invoice based on sales orders'), ('picking', 'Invoice based on deliveries')], |
728 | 'The default invoicing method is', default_model='sale.order', |
729 | @@ -50,7 +50,7 @@ |
730 | implied_group='sale.group_mrp_properties', |
731 | help="Allows you to tag sales order lines with properties."), |
732 | 'module_project_timesheet': fields.boolean("Project Timesheet"), |
733 | - 'module_project_mrp': fields.boolean("Project MRP"), |
734 | + 'module_sale_service': fields.boolean("Sale Service"), |
735 | } |
736 | |
737 | _defaults = { |
738 | @@ -60,7 +60,7 @@ |
739 | def default_get(self, cr, uid, fields, context=None): |
740 | res = super(sale_configuration, self).default_get(cr, uid, fields, context) |
741 | # task_work, time_unit depend on other fields |
742 | - res['task_work'] = res.get('module_project_mrp') and res.get('module_project_timesheet') |
743 | + res['task_work'] = res.get('module_sale_service') and res.get('module_project_timesheet') |
744 | return res |
745 | |
746 | def get_default_sale_config(self, cr, uid, ids, context=None): |
747 | |
748 | === modified file 'sale_stock/res_config_view.xml' |
749 | --- sale_stock/res_config_view.xml 2014-01-21 08:48:46 +0000 |
750 | +++ sale_stock/res_config_view.xml 2014-05-02 13:01:32 +0000 |
751 | @@ -39,7 +39,7 @@ |
752 | </xpath> |
753 | <group name='default_options' position="after"> |
754 | <field name="module_project_timesheet" invisible="1"/> |
755 | - <field name="module_project_mrp" invisible="1"/> |
756 | + <field name="module_sale_service" invisible="1"/> |
757 | </group> |
758 | <div name='warehouse_features' position='inside'> |
759 | <div name='default_picking_policy' attrs="{'invisible':[('group_invoice_deli_orders','=',False)]}"> |
Changes seems ok.
Improve the Copyright to today date.
Regards,
Mustufa