Merge lp:~dorian-kemps/unifield-server/US-5761 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 5300
Proposed branch: lp:~dorian-kemps/unifield-server/US-5761
Merge into: lp:unifield-server
Diff against target: 72 lines (+13/-12)
3 files modified
bin/addons/specific_rules/report/report_stock_inventory.py (+3/-3)
bin/addons/stock/report/stock_expired_damaged_report.py (+9/-8)
bin/addons/stock_override/stock_view.xml (+1/-1)
To merge this branch: bzr merge lp:~dorian-kemps/unifield-server/US-5761
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+363622@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bin/addons/specific_rules/report/report_stock_inventory.py'
--- bin/addons/specific_rules/report/report_stock_inventory.py 2019-02-25 09:43:25 +0000
+++ bin/addons/specific_rules/report/report_stock_inventory.py 2019-02-26 09:54:52 +0000
@@ -403,12 +403,12 @@
403403
404 cost_price_at_date = {}404 cost_price_at_date = {}
405 if report.stock_level_date and product_ids_to_fetch:405 if report.stock_level_date and product_ids_to_fetch:
406 self.cr.execute("""select distinct on (product_id) product_id, new_standard_price406 self.cr.execute("""select distinct on (product_id) product_id, old_standard_price
407 from standard_price_track_changes407 from standard_price_track_changes
408 where408 where
409 product_id in %s and409 product_id in %s and
410 create_date <= %s410 create_date >= %s
411 order by product_id, create_date desc""", (tuple(product_ids_to_fetch), values['stock_level_date']))411 order by product_id, create_date asc""", (tuple(product_ids_to_fetch), values['stock_level_date']))
412412
413 for x in self.cr.fetchall():413 for x in self.cr.fetchall():
414 cost_price_at_date[x[0]] = x[1]414 cost_price_at_date[x[0]] = x[1]
415415
=== modified file 'bin/addons/stock/report/stock_expired_damaged_report.py'
--- bin/addons/stock/report/stock_expired_damaged_report.py 2019-02-11 09:51:38 +0000
+++ bin/addons/stock/report/stock_expired_damaged_report.py 2019-02-26 09:54:52 +0000
@@ -247,14 +247,16 @@
247 res = []247 res = []
248248
249 for move in move_obj.browse(self.cr, self.uid, self.datas['moves_ids'], context=self.localcontext):249 for move in move_obj.browse(self.cr, self.uid, self.datas['moves_ids'], context=self.localcontext):
250 price_at_date = False250 prod_price = False
251 self.cr.execute("""SELECT distinct on (product_id) product_id, new_standard_price251 self.cr.execute("""SELECT distinct on (product_id) product_id, old_standard_price
252 FROM standard_price_track_changes252 FROM standard_price_track_changes
253 WHERE product_id = %s AND change_date <= %s253 WHERE product_id = %s AND change_date >= %s
254 ORDER BY product_id, change_date desc254 ORDER BY product_id, change_date asc
255 """, (move.product_id.id, move.date))255 """, (move.product_id.id, move.date))
256 for x in self.cr.fetchall():256 for x in self.cr.fetchall():
257 price_at_date = x[1]257 prod_price = x[1]
258 if not prod_price:
259 prod_price = move.product_id.standard_price or move.price_unit
258 res.append({260 res.append({
259 'ref': move.picking_id.name,261 'ref': move.picking_id.name,
260 'reason_type': move.reason_type_id and move.reason_type_id.complete_name or '',262 'reason_type': move.reason_type_id and move.reason_type_id.complete_name or '',
@@ -265,11 +267,10 @@
265 'qty': move.product_qty,267 'qty': move.product_qty,
266 'batch': move.prodlot_id and move.prodlot_id.name or '',268 'batch': move.prodlot_id and move.prodlot_id.name or '',
267 'exp_date': move.expired_date,269 'exp_date': move.expired_date,
268 'unit_price': price_at_date or move.price_unit,270 'unit_price': prod_price,
269 'currency': move.price_currency_id and move.price_currency_id.name or271 'currency': move.price_currency_id and move.price_currency_id.name or
270 move.product_id.currency_id and move.product_id.currency_id.name or '',272 move.product_id.currency_id and move.product_id.currency_id.name or '',
271 'total_price': price_at_date and move.product_qty * price_at_date or273 'total_price': move.product_qty * prod_price,
272 move.product_qty * move.price_unit,
273 'src_loc': move.location_id and move.location_id.name or '',274 'src_loc': move.location_id and move.location_id.name or '',
274 'dest_loc': move.location_dest_id and move.location_dest_id.name or '',275 'dest_loc': move.location_dest_id and move.location_dest_id.name or '',
275 'crea_date': move.picking_id.date,276 'crea_date': move.picking_id.date,
276277
=== modified file 'bin/addons/stock_override/stock_view.xml'
--- bin/addons/stock_override/stock_view.xml 2018-11-12 11:26:37 +0000
+++ bin/addons/stock_override/stock_view.xml 2019-02-26 09:54:52 +0000
@@ -481,7 +481,7 @@
481 <field name="from_manage_expired" invisible="1" />481 <field name="from_manage_expired" invisible="1" />
482 <!-- <button name="return_to_state" string="Return to initial state" states="import" icon="gtk-execute" type="object" />-->482 <!-- <button name="return_to_state" string="Return to initial state" states="import" icon="gtk-execute" type="object" />-->
483 <button name="call_cancel_wizard" states="assigned,confirmed,draft" string="_Cancel" icon="gtk-cancel" type="object" context="{'from_button': True}"/>483 <button name="call_cancel_wizard" states="assigned,confirmed,draft" string="_Cancel" icon="gtk-cancel" type="object" context="{'from_button': True}"/>
484 <button name="draft_force_assign" states="draft,confirmed,assigned" string="Confirm" type="object" icon="gtk-apply" attrs="{'invisible': ['|', '&amp;', ('state', 'in', ['done', 'cancel', 'import']), ('state', '!=', 'draft'), ('has_draft_moves', '=', False)]}" />484 <button name="draft_force_assign" states="draft,confirmed,assigned" string="Confirm" type="object" icon="gtk-apply" attrs="{'invisible': ['|', ('state', 'in', ['done', 'cancel', 'import']), '&amp;', ('state', '!=', 'draft'), ('has_draft_moves', '=', False)]}" />
485 <button name="expired_assign" states="confirmed,assigned" string="Check Expired Products' Availability" type="object" icon="gtk-find" context="{'from_button': True}" attrs="{'invisible': ['|', ('state', 'not in', ['confirmed', 'assigned']), ('from_manage_expired', '=', False)]}" />485 <button name="expired_assign" states="confirmed,assigned" string="Check Expired Products' Availability" type="object" icon="gtk-find" context="{'from_button': True}" attrs="{'invisible': ['|', ('state', 'not in', ['confirmed', 'assigned']), ('from_manage_expired', '=', False)]}" />
486 <button name="check_availability_manually" states="confirmed,assigned" string="Check Availability" type="object" icon="gtk-find" context="{'from_button': True}" attrs="{'invisible': [('from_manage_expired', '=', True)]}"/>486 <button name="check_availability_manually" states="confirmed,assigned" string="Check Availability" type="object" icon="gtk-find" context="{'from_button': True}" attrs="{'invisible': [('from_manage_expired', '=', True)]}"/>
487 <button name="force_assign" states="confirmed,assigned" string="Force Availability" type="object" icon="gtk-jump-to" context="{'from_button': True}" />487 <button name="force_assign" states="confirmed,assigned" string="Force Availability" type="object" icon="gtk-jump-to" context="{'from_button': True}" />

Subscribers

People subscribed via source and target branches