Merge lp:~matjaz-6/openerpsl/openerpsl_02_17 into lp:openerpsl/7.0
- openerpsl_02_17
- Merge into 7.0
Proposed by
Matjaz Kalic
Status: | Merged |
---|---|
Merged at revision: | 345 |
Proposed branch: | lp:~matjaz-6/openerpsl/openerpsl_02_17 |
Merge into: | lp:openerpsl/7.0 |
Diff against target: |
181 lines (+51/-41) 4 files modified
m_web_api/static/src/js/core.js (+18/-23) mrp_procurement_qty/mrp_production.py (+26/-15) mrp_procurement_qty/wizard/delivery_order_confirm.py (+6/-2) mrp_procurement_qty/wizard/procurement_order.py (+1/-1) |
To merge this branch: | bzr merge lp:~matjaz-6/openerpsl/openerpsl_02_17 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mentis | Pending | ||
Review via email: mp+208571@code.launchpad.net |
Commit message
Description of the change
[MOD] m_web_api/
To post a comment you must log in.
- 345. By Dušan Laznik (Mentis)
-
[MOD] m_web_api/
static/ src/js/ core.js (load from stock for base products)
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'm_web_api/static/src/js/core.js' |
2 | --- m_web_api/static/src/js/core.js 2014-02-26 17:54:56 +0000 |
3 | +++ m_web_api/static/src/js/core.js 2014-02-27 11:13:17 +0000 |
4 | @@ -337,8 +337,8 @@ |
5 | if (event.data.kat=='Izdelki'||event.data.kat=='Izdelki1'||event.data.kat=='Dodelava') |
6 | kategorije=izdelki; |
7 | else if (event.data.kat=='Hladilnica') |
8 | - //kategorije=polizdelki.concat(izdelki); |
9 | - kategorije=polizdelki; |
10 | + kategorije=polizdelki.concat(izdelki); |
11 | + //kategorije=polizdelki; |
12 | else |
13 | kategorije=polizdelki; |
14 | $("#select1").attr('class','Closed'); |
15 | @@ -365,7 +365,7 @@ |
16 | //------------------------------------------------// |
17 | |
18 | //Prikaz podjetja in verzije |
19 | - $("#podjetje").text('Podjetje: ' + document.getElementById("s1").options[so].text + ', Verzija: v.02.24'); |
20 | + $("#podjetje").text('Podjetje: ' + document.getElementById("s1").options[so].text + ', Verzija: v.02.27'); |
21 | |
22 | openERP_user = ''; |
23 | if (document.getElementById("u").value == 'Testo-Polizdelki'){ |
24 | @@ -881,29 +881,23 @@ |
25 | tStatusValue=['0','1']; |
26 | } |
27 | |
28 | - If (vrstaIzdelka=='Hladilnica') |
29 | - {mrp.query(['id','product_id','product_qty','produced','scrap','produced_phantom','scrap_phantom','produced_stock', |
30 | + mrp.query(['id','product_id','product_qty','produced','scrap','produced_phantom','scrap_phantom','produced_stock', |
31 | 'product_on_bom_qty_available','product_on_bom_qty_stock','product_with_bom_name','product_on_bom_qty_ready', |
32 | - 'product_qty_onstock','created_from_op','product_on_bom_qty_P_ready','product_with_bom_id']) |
33 | - .filter(['|',['product_cat','in',kategorije],['product_on_bom_qty_stock','!=',0],[tStatus,'in',tStatusValue],['dressing','in',dressingT],['state','in',['ready','in_production','confirmed']]]) |
34 | - .order_by('product_id').all().then(functionResults(results);} |
35 | - else |
36 | - {mrp.query(['id','product_id','product_qty','produced','scrap','produced_phantom','scrap_phantom','produced_stock', |
37 | - 'product_on_bom_qty_available','product_on_bom_qty_stock','product_with_bom_name','product_on_bom_qty_ready', |
38 | - 'product_qty_onstock','created_from_op','product_on_bom_qty_P_ready','product_with_bom_id']) |
39 | - .filter([['product_cat','in',kategorije],[tStatus,'in',tStatusValue],['dressing','in',dressingT],['state','in',['ready','in_production','confirmed']]]) |
40 | - .order_by('product_id').all().then(functionResults(results);} |
41 | - |
42 | - function functionResults(results) { |
43 | + 'product_qty_onstock','created_from_op','product_on_bom_qty_P_ready','product_is_product','product_on_bom_qty_O_ready']) |
44 | + .filter([['product_cat','in',kategorije],[tStatus,'in',tStatusValue],['dressing','in',dressingT],['state','in',['ready','in_production','confirmed']]]) |
45 | + .order_by('product_id').all().then(function(results){ |
46 | + |
47 | for(i=0;i<results.length;i++){ |
48 | - if (vrstaIzdelka=='Hladilnica' && results[i].product_on_bom_qty_stock!=0) |
49 | - { |
50 | - results[i].product_qty_onstock=results[i].product_on_bom_qty_stock; |
51 | - results[i].product_id = results[i].product_with_bom_id; |
52 | - |
53 | - } |
54 | - |
55 | + |
56 | product_name = results[i].product_id.toString().substring(results[i].product_id.toString().indexOf(',')+1); |
57 | + |
58 | + if (vrstaIzdelka=='Hladilnica' && results[i].product_is_product != ''){ |
59 | + //results[i].product_name = results[i].product_with_bom_name; |
60 | + //results[i].product_code = ''; |
61 | + results[i].product_qty_onstock=results[i].product_on_bom_qty_stock; |
62 | + results[i].product_on_bom_qty_ready = results[i].product_on_bom_qty_O_ready; |
63 | + product_name = results[i].product_is_product; |
64 | + } |
65 | |
66 | product_code = product_name.substring(0,product_name.indexOf(' ')); |
67 | product_name = product_name.substring(product_name.indexOf(' ')+1); |
68 | @@ -911,6 +905,7 @@ |
69 | results[i].product_name = product_name; |
70 | results[i].product_code = product_code; |
71 | |
72 | + |
73 | //Odstejemo nalozeno kolicino |
74 | results[i].product_qty_onstock = results[i].product_qty_onstock - results[i].product_on_bom_qty_ready |
75 | |
76 | |
77 | === modified file 'mrp_procurement_qty/mrp_production.py' |
78 | --- mrp_procurement_qty/mrp_production.py 2014-02-26 17:54:56 +0000 |
79 | +++ mrp_procurement_qty/mrp_production.py 2014-02-27 11:13:17 +0000 |
80 | @@ -136,7 +136,7 @@ |
81 | ('product_id', '=', order.product_with_bom_relation.id)]) |
82 | for order_ready in self.browse(cr, uid, ready_prod_ids, context=context): |
83 | qty_produced += order_ready.produced - order_ready.scrap - order_ready.produced_stock |
84 | - qty_produced += order_ready.product_on_bom_qty_ready |
85 | + qty_produced += order_ready.product_on_bom_qty_ready #nalozeni izdelki direktno za ta produkt |
86 | |
87 | |
88 | #Po delovnih nalogih kjer je produkt product_with_bom_id produkt |
89 | @@ -148,7 +148,7 @@ |
90 | if order_bom.produced != 0 and order_bom.product_with_bom_factor: |
91 | qty_reserved += (order_bom.produced*order_bom.product_with_bom_factor) |
92 | #qty_from_stock += (order_bom.product_on_bom_qty_ready/order_bom.product_with_bom_factor) #kar je dano iz hladilnice |
93 | - #qty_from_stock += (order_bom.product_on_bom_qty_ready) #ZADNJE |
94 | + qty_from_stock = order_bom.product_on_bom_qty_O_ready #Nalozena zaloga polizdelka na ta P_izdelek |
95 | |
96 | |
97 | res_tmp = {} |
98 | @@ -162,16 +162,25 @@ |
99 | |
100 | #------------------------------------------------------------------------------------- |
101 | #Pogledamo se ali je polizdelek in se kupuje ali pa je izdelek - potem zracunamo zalogo |
102 | - if (order.product_with_bom_relation.product_tmpl_id.categ_id.parent_id.id != 38 and order.product_with_bom_relation.product_tmpl_id.supply_method == 'buy') or order.product_with_bom_relation.product_tmpl_id.categ_id.parent_id.id == 38: |
103 | - context['product_id'] = order.product_with_bom_relation.id |
104 | - |
105 | - stock_values = self.pool.get('stock.location')._product_value(cr, uid, [12], ['stock_real'], arg=None, context=context) |
106 | - #stock_sandi = self.pool.get('product.product').qty_available_location(cr, uid, [order.product_with_bom_relation.id], [12], context=context) |
107 | - res_tmp['product_on_bom_qty_stock'] = int(stock_values[12]['stock_real']) |
108 | - |
109 | - |
110 | - |
111 | - |
112 | + if order.product_with_bom_relation: |
113 | + if (order.product_with_bom_relation.product_tmpl_id.categ_id.parent_id.id == 34 and order.product_with_bom_relation.product_tmpl_id.supply_method == 'buy') or order.product_with_bom_relation.product_tmpl_id.categ_id.parent_id.id == 38: |
114 | + context['product_id'] = order.product_with_bom_relation.id |
115 | + |
116 | + stock_values = self.pool.get('stock.location')._product_value(cr, uid, [12], ['stock_real'], arg=None, context=context) |
117 | + #stock_sandi = self.pool.get('product.product').qty_available_location(cr, uid, [order.product_with_bom_relation.id], [12], context=context) |
118 | + res_tmp['product_on_bom_qty_stock'] = int(stock_values[12]['stock_real']) |
119 | + else: |
120 | + res_tmp['product_on_bom_qty_stock'] = 0 |
121 | + else: |
122 | + res_tmp['product_on_bom_qty_stock'] = 0 |
123 | + |
124 | + if order.product_id.product_tmpl_id.categ_id.parent_id.id == 38: |
125 | + if order.product_with_bom_relation: |
126 | + res_tmp['product_is_product'] = '[' + order.product_with_bom_relation.default_code + '] >'+ order.product_with_bom_relation.name_template + ' - ' + order.product_with_bom_relation.variants |
127 | + else: |
128 | + res_tmp['product_is_product'] = '[' + order.product_id.default_code + '] <'+ order.product_id.name_template + '[Osnova] - ' + order.product_id.variants |
129 | + else: |
130 | + res_tmp['product_is_product'] = '' |
131 | |
132 | #res_tmp['product_on_bom_qty_stock'] = int(qty_available_sandi) - qty_from_stock |
133 | |
134 | @@ -187,10 +196,12 @@ |
135 | 'created_from_op': fields.boolean('Created from orderpoint'), |
136 | 'product_qty_onstock': fields.float('Product qty on stock', digits=(6,2)), |
137 | #'product_qty_available': fields.function(_get_prod_qty_available, string='Product quantity available'), |
138 | - 'product_on_bom_qty_available': fields.function(_get_prod_on_bom_qty_available, string='Product on BOM quantity available'), |
139 | - 'product_on_bom_qty_stock': fields.function(_get_prod_on_bom_qty_available, string='Product on BOM stock available'), |
140 | - 'product_on_bom_qty_ready': fields.float('Load O from stock', digits=(6,2)), |
141 | + 'product_is_product': fields.function(_get_prod_on_bom_qty_available, string='Product is product', multi='prepare0'), |
142 | + 'product_on_bom_qty_available': fields.function(_get_prod_on_bom_qty_available, string='Product on BOM quantity available', multi='prepare0'), |
143 | + 'product_on_bom_qty_stock': fields.function(_get_prod_on_bom_qty_available, string='Product on BOM stock available', multi='prepare0'), |
144 | + 'product_on_bom_qty_ready': fields.float('Load from stock', digits=(6,2)), |
145 | 'product_on_bom_qty_P_ready': fields.float('Load P from stock', digits=(6,2)), |
146 | + 'product_on_bom_qty_O_ready': fields.float('Load O from stock', digits=(6,2)), |
147 | 'product_with_bom_factor': fields.function(_prepare_product_id, digits=(12,4), method=True, store=True, string='BOM factor', multi='prepare1'), |
148 | 'product_with_bom_id': fields.function(_prepare_product_id, type='integer', method=True, store=True, string='Product with BOM id', multi='prepare1'), |
149 | 'product_with_bom_relation': fields.function(_prepare_product_id, type='many2one', obj='product.product', method=True, store=True, string='Product with BOM name', multi='prepare1'), |
150 | |
151 | === modified file 'mrp_procurement_qty/wizard/delivery_order_confirm.py' |
152 | --- mrp_procurement_qty/wizard/delivery_order_confirm.py 2014-02-22 14:28:38 +0000 |
153 | +++ mrp_procurement_qty/wizard/delivery_order_confirm.py 2014-02-27 11:13:17 +0000 |
154 | @@ -44,8 +44,12 @@ |
155 | |
156 | if context is None: |
157 | context = {} |
158 | - |
159 | - sale_override = self.browse(cr,uid,ids)[0].override |
160 | + |
161 | + sale_override = False |
162 | + #for self_line in self.browse(cr,uid,ids): |
163 | + # sale_override = self_line.override |
164 | + |
165 | + #sale_override = self.browse(cr,uid,ids)[0].override |
166 | move_obj = self.pool.get('stock.move') |
167 | picking_obj = self.pool.get('stock.picking') |
168 | |
169 | |
170 | === modified file 'mrp_procurement_qty/wizard/procurement_order.py' |
171 | --- mrp_procurement_qty/wizard/procurement_order.py 2014-02-26 12:24:55 +0000 |
172 | +++ mrp_procurement_qty/wizard/procurement_order.py 2014-02-27 11:13:17 +0000 |
173 | @@ -170,7 +170,7 @@ |
174 | new_cr.rollback() |
175 | new_cr.close() |
176 | |
177 | - raise osv.except_osv('Opozorilo!', u'Napaka lansiranja v %s. krogu. Err: %s' % (str(x+1), str(e)+';'+err)) |
178 | + raise osv.except_osv('Opozorilo!', u'Napaka lansiranja v %s. krogu. Err: %s' % (str(x+1), str(e)+';'+str(err))) |
179 | return{} |
180 | print(datetime.now().strftime("%Y-%m-%d %H:%M:%S") + ' - Close: ' + str(x+1)) |
181 | #------------------------------------------------------------------------------------------------------------------------ |