From 977d1acc7c3d80339cd9b0868ce869ab90f3b544 Mon Sep 17 00:00:00 2001 From: Mansi Trivedi Date: Wed, 3 Feb 2016 13:01:28 +0530 Subject: [PATCH] [IMP] sale_stock,delivery: Various imp on delivery slips and picking reports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ON THE DELIVERY SLIP :  1. CUSTOMER REFERENCE - If a customer reference is filled in the SO, on the delivery slip, under Customer Address, add a section Customer Reference : - Display every customer information in the header 2. SO NUMBER  - Display the SO reference under the origin instead on the picking type name. Do not display it if unset 3. LOCATIONS AND STATUS - remove the columns locations and status 4. ORDERED QUANTITY - add a column (between product and quantity) named Ordered Quantity. It contains the quantity of the initial demand. Rename Quantity into Delivered Quantity 5. BACKORDER - If the delivery is a backorder, add the string : This shipment is a backorder of "stock.picking.name". - If a backorder has been created, add the string  : All items couldn't be shipped, the remaining ones will be shipped as soon as they become available. - If it is a backorder and another backorder has been created, both strings should be printed. 6. SCHEDULE DATE - Should be the date when the delivery order is validated. - Rename Scheduled Date into "Date"  - If the DO is not yet validated, display the scheduled date. - If the DO is validated : display the date it was validated. 7. WEIGHT - Add the unit of measure after the weight value - Display only if set 8. CARRIER - Display only if set 9. LOT/SERIAL NUMBERS - Keep the header of the column + rename it into Serial Number / Lot 10. CUSTOMER/CONTACT ADDRESS - Should be displayed on the right, keep only minimal information: Customer name, phone number ON THE PICKING REPORT - picking: https://drive.google.com/file/d/0Bx4JWs1efCreX1FrZUhaZDEtblU/view?usp=drivesdk - form: https://drive.google.com/a/openerp.com/file/d/0B5BDHVRYo-q5X3VGVWI1aThWcWM/view?usp=drivesdk --- addons/delivery/views/report_deliveryslip.xml | 9 ++- addons/delivery/views/report_shipping.xml | 9 ++- addons/sale_stock/__openerp__.py | 1 + .../sale_stock/views/report_deliveryslip.xml | 13 ++++ addons/stock/stock.py | 7 ++ addons/stock/stock_view.xml | 1 + addons/stock/views/report_deliveryslip.xml | 78 ++++++++++--------- .../views/report_stockpicking_operations.xml | 50 ++++++------ 8 files changed, 100 insertions(+), 68 deletions(-) create mode 100644 addons/sale_stock/views/report_deliveryslip.xml diff --git a/addons/delivery/views/report_deliveryslip.xml b/addons/delivery/views/report_deliveryslip.xml index 9af3ec48385..3c3895600a5 100644 --- a/addons/delivery/views/report_deliveryslip.xml +++ b/addons/delivery/views/report_deliveryslip.xml @@ -1,15 +1,16 @@ diff --git a/addons/delivery/views/report_shipping.xml b/addons/delivery/views/report_shipping.xml index eabe88ae585..dd795a1f5ac 100644 --- a/addons/delivery/views/report_shipping.xml +++ b/addons/delivery/views/report_shipping.xml @@ -1,15 +1,16 @@ diff --git a/addons/sale_stock/__openerp__.py b/addons/sale_stock/__openerp__.py index a2672e107f9..d26776813fa 100644 --- a/addons/sale_stock/__openerp__.py +++ b/addons/sale_stock/__openerp__.py @@ -34,6 +34,7 @@ You can choose flexible invoicing methods: 'stock_view.xml', 'res_config_view.xml', 'account_invoice_view.xml', + 'views/report_deliveryslip.xml', ], 'demo': ['sale_stock_demo.xml'], 'installable': True, diff --git a/addons/sale_stock/views/report_deliveryslip.xml b/addons/sale_stock/views/report_deliveryslip.xml new file mode 100644 index 00000000000..ea8ca1c0612 --- /dev/null +++ b/addons/sale_stock/views/report_deliveryslip.xml @@ -0,0 +1,13 @@ + + + + diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 4575fc97c4f..5423c2674c0 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -2009,6 +2009,7 @@ class stock_move(osv.osv): 'restrict_partner_id': fields.many2one('res.partner', 'Owner ', help="Technical field used to depict a restriction on the ownership of quants to consider when marking this move as 'done'"), 'route_ids': fields.many2many('stock.location.route', 'stock_location_route_move', 'move_id', 'route_id', 'Destination route', help="Preferred route to be followed by the procurement order"), 'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse', help="Technical field depicting the warehouse to consider for the route selection on the next procurement (if any)."), + 'ordered_qty': fields.float('Ordered Quantity', digits_compute=dp.get_precision('Product Unit of Measure')), } def _default_destination_address(self, cr, uid, context=None): @@ -2139,6 +2140,7 @@ class stock_move(osv.osv): if track: picking = picking_obj.browse(cr, uid, vals['picking_id'], context=context) initial_values = {picking.id: {'state': picking.state}} + vals['ordered_qty'] = vals.get('product_uom_qty') res = super(stock_move, self).create(cr, uid, vals, context=context) if track: picking_obj.message_track(cr, uid, [vals['picking_id']], picking_obj.fields_get(cr, uid, ['state'], context=context), initial_values, context=context) @@ -4480,6 +4482,7 @@ class stock_pack_operation(osv.osv): ('assigned', 'Available'), ('done', 'Done'), ]), + 'ordered_qty': fields.float('Ordered Quantity', digits_compute=dp.get_precision('Product Unit of Measure')), } _defaults = { @@ -4501,6 +4504,10 @@ class stock_pack_operation(osv.osv): raise UserError(_('The quantity to split should be smaller than the quantity To Do. ')) return True + def create(self, cr, uid, vals, context=None): + vals['ordered_qty'] = vals.get('product_qty') + return super(stock_pack_operation, self).create(cr, uid, vals, context=context) + def write(self, cr, uid, ids, vals, context=None): vals['fresh_record'] = False context = context or {} diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index c6ad06e8249..446ae786093 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -889,6 +889,7 @@