Merge lp:~syleam/wms/5.0-add-cost-for-delivery into lp:wms

Proposed by Christophe CHAUVET
Status: Merged
Merged at revision: 242
Proposed branch: lp:~syleam/wms/5.0-add-cost-for-delivery
Merge into: lp:wms
Diff against target: 265 lines (+67/-16)
4 files modified
wms/i18n/fr_FR.po (+23/-8)
wms/i18n/wms.pot (+21/-6)
wms/object/picking.py (+7/-1)
wms_scanner/scripts/import_scenario.py (+16/-1)
To merge this branch: bzr merge lp:~syleam/wms/5.0-add-cost-for-delivery
Reviewer Review Type Date Requested Status
Christophe CHAUVET Approve
Review via email: mp+74184@code.launchpad.net

Description of the change

To generator some transporter extraction file, we must fill order price, we add 2 new fields for amount and currency

To post a comment you must log in.
Revision history for this message
Christophe CHAUVET (christophe-chauvet) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'wms/i18n/fr_FR.po'
2--- wms/i18n/fr_FR.po 2011-08-31 06:38:14 +0000
3+++ wms/i18n/fr_FR.po 2011-09-06 09:04:24 +0000
4@@ -6,8 +6,8 @@
5 msgstr ""
6 "Project-Id-Version: OpenERP Server 5.0.15\n"
7 "Report-Msgid-Bugs-To: support@openerp.com\n"
8-"POT-Creation-Date: 2011-08-31 06:30:28+0000\n"
9-"PO-Revision-Date: 2011-08-31 08:36+0100\n"
10+"POT-Creation-Date: 2011-09-06 08:45:35+0000\n"
11+"PO-Revision-Date: 2011-09-06 10:46+0100\n"
12 "Last-Translator: Christophe Chauvet <christophe.chauvet@syleam.fr>\n"
13 "Language-Team: \n"
14 "MIME-Version: 1.0\n"
15@@ -232,9 +232,9 @@
16 msgstr "Forcer le mouvement de produit vers en emplacement de réservation"
17
18 #. module: wms
19-#: help:stock.move,order_qty:0
20-msgid "Usefull when sale module not installed"
21-msgstr "Utile lorsque le module vente n'est pas installé"
22+#: help:stock.picking,delivery_amount:0
23+msgid "Fill the cost price for this delivery"
24+msgstr "Renseigner le montant pour cette livraison"
25
26 #. module: wms
27 #: model:stock.analysis,name:wms.stock_analysis_2
28@@ -362,12 +362,22 @@
29 msgstr "Invalid XML for View Architecture!"
30
31 #. module: wms
32+#: field:stock.picking,delivery_amount:0
33+msgid "Delivery amount"
34+msgstr "Valeur Livraison"
35+
36+#. module: wms
37 #: field:stock.burst.line,remark_id:0
38 #: wizard_field:wms.burst,init,remark_id:0
39 msgid "Observation"
40 msgstr "Observation"
41
42 #. module: wms
43+#: model:ir.model,name:wms.model_stock_analysis
44+msgid "Provide ABC class concept"
45+msgstr "Fournit le concept de classe ABC"
46+
47+#. module: wms
48 #: field:product.ul,width:0
49 msgid "Width"
50 msgstr "Largeur"
51@@ -418,6 +428,11 @@
52 msgstr "Type"
53
54 #. module: wms
55+#: help:stock.move,order_qty:0
56+msgid "Usefull when sale module not installed"
57+msgstr "Utile lorsque le module vente n'est pas installé"
58+
59+#. module: wms
60 #: field:product.product,qty_physical:0
61 msgid "Real Physical Stock"
62 msgstr "Stock physique réel"
63@@ -813,9 +828,9 @@
64 msgstr "Saisisser une observation pour ce produit"
65
66 #. module: wms
67-#: model:ir.model,name:wms.model_stock_analysis
68-msgid "Provide ABC class concept"
69-msgstr "Fournit le concept de classe ABC"
70+#: field:stock.picking,delivery_amount_currency_id:0
71+msgid "Amount currency"
72+msgstr "Devise Valeur"
73
74 #. module: wms
75 #: help:stock.warehouse,check_tracking_burst:0
76
77=== modified file 'wms/i18n/wms.pot'
78--- wms/i18n/wms.pot 2011-08-31 06:38:14 +0000
79+++ wms/i18n/wms.pot 2011-09-06 09:04:24 +0000
80@@ -6,8 +6,8 @@
81 msgstr ""
82 "Project-Id-Version: OpenERP Server 5.0.12\n"
83 "Report-Msgid-Bugs-To: support@openerp.com\n"
84-"POT-Creation-Date: 2011-08-31 06:30:28+0000\n"
85-"PO-Revision-Date: 2011-08-31 06:30:28+0000\n"
86+"POT-Creation-Date: 2011-09-06 08:45:35+0000\n"
87+"PO-Revision-Date: 2011-09-06 08:45:35+0000\n"
88 "Last-Translator: <>\n"
89 "Language-Team: \n"
90 "MIME-Version: 1.0\n"
91@@ -232,8 +232,8 @@
92 msgstr ""
93
94 #. module: wms
95-#: help:stock.move,order_qty:0
96-msgid "Usefull when sale module not installed"
97+#: help:stock.picking,delivery_amount:0
98+msgid "Fill the cost price for this delivery"
99 msgstr ""
100
101 #. module: wms
102@@ -362,12 +362,22 @@
103 msgstr ""
104
105 #. module: wms
106+#: field:stock.picking,delivery_amount:0
107+msgid "Delivery amount"
108+msgstr ""
109+
110+#. module: wms
111 #: field:stock.burst.line,remark_id:0
112 #: wizard_field:wms.burst,init,remark_id:0
113 msgid "Observation"
114 msgstr ""
115
116 #. module: wms
117+#: model:ir.model,name:wms.model_stock_analysis
118+msgid "Provide ABC class concept"
119+msgstr ""
120+
121+#. module: wms
122 #: field:product.ul,width:0
123 msgid "Width"
124 msgstr ""
125@@ -418,6 +428,11 @@
126 msgstr ""
127
128 #. module: wms
129+#: help:stock.move,order_qty:0
130+msgid "Usefull when sale module not installed"
131+msgstr ""
132+
133+#. module: wms
134 #: field:product.product,qty_physical:0
135 msgid "Real Physical Stock"
136 msgstr ""
137@@ -796,8 +811,8 @@
138 msgstr ""
139
140 #. module: wms
141-#: model:ir.model,name:wms.model_stock_analysis
142-msgid "Provide ABC class concept"
143+#: field:stock.picking,delivery_amount_currency_id:0
144+msgid "Amount currency"
145 msgstr ""
146
147 #. module: wms
148
149=== modified file 'wms/object/picking.py'
150--- wms/object/picking.py 2011-08-31 15:37:52 +0000
151+++ wms/object/picking.py 2011-09-06 09:04:24 +0000
152@@ -64,6 +64,8 @@
153 'round_id': fields.many2one('stock.round', 'Round', help='Use for manage deliveries'),
154 'state': fields.selection(_picking_state, 'Status', readonly=True),
155 'relay_address_id': fields.many2one('res.partner.address', 'Relay address', help='If the customer prefer to receive the delevery in a relay center, choose this address'),
156+ 'delivery_amount': fields.float('Delivery amount', help='Fill the cost price for this delivery'),
157+ 'delivery_amount_currency_id': fields.many2one('res.currency', 'Amount currency'),
158 }
159
160 _defaults = {
161@@ -74,6 +76,8 @@
162 'round_id': lambda *a: False,
163 'state': lambda *a: 'draft',
164 'relay_address_id': lambda *a: False,
165+ 'delivery_amount': lambda *a: 0.0,
166+ 'delivery_amount_currency_id': lambda *a: False,
167 }
168
169 def default_get(self, cr, uid, fields_list, context=None):
170@@ -127,11 +131,13 @@
171 if values.get('type', '') == 'delivery' and values.get('name'):
172 p_ids = self.search(cr, uid, [('type', '=', 'out'), ('name', '=', values['name'])], context=context)
173 if p_ids and len(p_ids) == 1:
174- transp = self.read(cr, uid, p_ids[0], ['transporter_id', 'transporter_weight', 'relay_address_id'], context=context)
175+ transp = self.read(cr, uid, p_ids[0], ['transporter_id', 'transporter_weight', 'relay_address_id', 'delivery_amount', 'delivery_amount_currency_id'], context=context)
176 if transp:
177 values['transporter_id'] = transp.get('transporter_id') and transp['transporter_id'][0] or False
178 values['transporter_weight'] = transp.get('transporter_weight', 0.0)
179 values['relay_address_id'] = transp.get('relay_address_id', False)
180+ values['delivery_amount'] = transp.get('delivery_amount', 0.0)
181+ values['delivery_amount_currency_id'] = transp.get('delivery_amount_currency_id', False)
182
183 return super(StockPicking, self).create(cr, uid, values, context=context)
184
185
186=== modified file 'wms_scanner/scripts/import_scenario.py'
187--- wms_scanner/scripts/import_scenario.py 2011-08-30 14:36:29 +0000
188+++ wms_scanner/scripts/import_scenario.py 2011-09-06 09:04:24 +0000
189@@ -43,7 +43,7 @@
190 parser.add_option_group(group)
191 opts, args = parser.parse_args()
192
193-logger = logging.getLogger("check_parent_store")
194+logger = logging.getLogger("import_scenario")
195 ch = logging.StreamHandler()
196 if opts.verbose:
197 logger.setLevel(logging.DEBUG)
198@@ -79,6 +79,7 @@
199 step_obj = Object(cnx, 'scanner.scenario.step')
200 trans_obj = Object(cnx, 'scanner.scenario.transition')
201 xml_file = open('scenario.xml', 'r')
202+logger.info('Scenario file found, process reading!')
203 scenario_xml = xml_file.read()
204 xml_file.close()
205 xml_doc = StringIO(scenario_xml)
206@@ -87,12 +88,15 @@
207 step = []
208 transition = []
209 scen_vals = {}
210+
211 # parse of the scenario
212 for node in root.getchildren():
213 #the node of the Step and Transition are put in other list
214 if node.tag == 'Step':
215+ logger.info('Step found')
216 step.append(node)
217 elif node.tag == 'Transition':
218+ logger.info('Transition found')
219 transition.append(node)
220 elif node.tag == 'warehouse_ids':
221 if not 'warehouse_ids' in scen_vals:
222@@ -104,18 +108,26 @@
223 scen_vals[node.tag] = eval(node.text) or False
224 else:
225 scen_vals[node.tag] = node.text or False
226+
227+logger.info('Search model: %s' % scen_vals['model_id'])
228 scen_vals['model_id'] = model_obj.search([('model', '=', scen_vals['model_id'])], 0, None, None, {'active_test': False}) or False
229 if scen_vals['model_id']:
230+ logger.info('Model found')
231 scen_vals['model_id'] = scen_vals['model_id'][0]
232+
233 # create or update
234 scenario_ids = scenario_obj.search([('resid', '=', scen_vals['resid'])], 0, None, None, {'active_test': False})
235 if scenario_ids:
236+ logger.info('Scenario exists, update it')
237 del scen_vals['resid']
238 scenario_obj.write(scenario_ids, scen_vals)
239 scenario_id = scenario_ids[0]
240 else:
241+ logger.info('Scenario not exists, create it')
242 scenario_id = scenario_obj.create(scen_vals)
243+
244 #parse step
245+logger.info('Update steps')
246 resid = {}
247 for node in step:
248 step_vals = {}
249@@ -137,7 +149,9 @@
250 step_obj.write(step_ids, step_vals)
251 else:
252 resid[step_vals['resid']] = step_obj.create(step_vals)
253+
254 #parse transition
255+logger.info('Update transitions')
256 for node in transition:
257 trans_vals = {}
258 for key, item in node.items():
259@@ -152,5 +166,6 @@
260 else:
261 trans_obj.create(trans_vals)
262
263+logger.info('Import scenario done!')
264
265 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

Subscribers

People subscribed via source and target branches