diff --git a/addons/account_anglo_saxon/test/anglo_saxon.yml b/addons/account_anglo_saxon/test/anglo_saxon.yml index 0a2dcf5f5fc..ca7195cb754 100644 --- a/addons/account_anglo_saxon/test/anglo_saxon.yml +++ b/addons/account_anglo_saxon/test/anglo_saxon.yml @@ -192,7 +192,7 @@ - company_id: base.main_company location_id: stock.stock_location_stock product_id: product.product_product_3 - product_qty: 1.0 + product_uom_qty: 1.0 product_uom: product.product_uom_unit location_dest_id: stock.stock_location_customers invoice_state: 2binvoiced @@ -235,9 +235,7 @@ !python {model: stock.invoice.onshipping}: | wiz_id = self.create(cr, uid, {'invoice_date': '2013-03-04', 'journal_id': ref('account.sales_journal')}, {'active_ids': [ref("stock_picking_out001")], "active_model": "stock.picking"}) - self.create_invoice(cr, uid, [wiz_id], {"lang": "en_US", - "search_default_available": 1, "tz": False, "active_model": "stock.picking", - "contact_display": "partner", "active_ids": [ref("stock_picking_out001")], "active_id": ref("stock_picking_out001")}) + self.create_invoice(cr, uid, [wiz_id], {"active_ids": [ref("stock_picking_out001")], "active_id": ref("stock_picking_out001")}) - I check that the customer invoice is created successfully. - diff --git a/addons/delivery/__openerp__.py b/addons/delivery/__openerp__.py index 089dc3e14d7..6201668bd90 100644 --- a/addons/delivery/__openerp__.py +++ b/addons/delivery/__openerp__.py @@ -32,7 +32,7 @@ You can define your own carrier and delivery grids for prices. When creating invoices from picking, OpenERP is able to add and compute the shipping line. """, 'author': 'OpenERP SA', - 'depends': ['sale', 'purchase', 'stock_account'], + 'depends': ['sale_stock', 'purchase'], 'data': [ 'security/ir.model.access.csv', 'delivery_report.xml', diff --git a/addons/delivery/report/shipping.py b/addons/delivery/report/shipping.py index 53bdad807c0..6f313c14b11 100644 --- a/addons/delivery/report/shipping.py +++ b/addons/delivery/report/shipping.py @@ -28,8 +28,19 @@ class shipping(report_sxw.rml_parse): super(shipping, self).__init__(cr, uid, name, context=context) self.localcontext.update({ 'time': time, + 'get_partner_invoice_info': self.get_partner_invoice_info, }) + def get_partner_invoice_info(self, origin): + """This method is used to get information of invoiced partner. + :param: origin: origin of picking + :return: tuple contaning partner name and address of invoiced partner + """ + sale_obj = self.pool.get('sale.order') + sale_id = sale_obj.search(self.cr, self.uid, [('name', '=', origin)])[0] + partner_invoice_id = sale_obj.browse(self.cr, self.uid, sale_id).partner_invoice_id + return partner_invoice_id.name, self.pool.get('res.partner')._display_address(self.cr, self.uid, partner_invoice_id) + report_sxw.report_sxw('report.sale.shipping','stock.picking','addons/delivery/report/shipping.rml',parser=shipping) # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/delivery/report/shipping.rml b/addons/delivery/report/shipping.rml index 5a3750e64a8..d9d90c1b3bd 100644 --- a/addons/delivery/report/shipping.rml +++ b/addons/delivery/report/shipping.rml @@ -107,14 +107,11 @@ - + Description - - Lot - Quantity @@ -130,12 +127,12 @@ Invoiced to - [[ o.sale_id and o.sale_id.partner_invoice_id and o.sale_id.partner_invoice_id.name or '']] - [[ o.sale_id and o.sale_id.partner_invoice_id and display_address(o.sale_id.partner_invoice_id) ]] + [[ o.origin and get_partner_invoice_info(o.origin)[0] or '' ]] + [[ o.origin and get_partner_invoice_info(o.origin)[1] or '' ]] - [[ o.partner_id and o.partner_id and o.partner_id.name or '' ]] - [[ o.partner_id and o.partner_id and display_address(o.partner_id) ]] + [[ o.partner_id and o.partner_id.name or '' ]] + [[ o.partner_id and display_address(o.partner_id) ]] @@ -165,7 +162,7 @@ - [[ o.sale_id and o.sale_id.name ]] + [[ o.origin or '' ]] [[ formatLang(o.date,date_time=True) ]] @@ -184,14 +181,11 @@ - + Description - - Lot - Quantity @@ -199,14 +193,11 @@
[[repeatIn(o.move_lines,'line')]] - + [[line.product_id.code ]] [[ line.product_id and line.product_id.name or '']] - - [[ (line.prodlot_id and (line.prodlot_id.name + (line.prodlot_id.ref and ('/' + line.prodlot_id.ref) or ''))) or ' ' ]] - [[ formatLang(line.product_qty) ]] [[ line.product_uom and line.product_uom.name ]] diff --git a/addons/delivery/stock.py b/addons/delivery/stock.py index 3c1440cf951..3512f08825e 100644 --- a/addons/delivery/stock.py +++ b/addons/delivery/stock.py @@ -30,7 +30,6 @@ class stock_picking(osv.osv): def _cal_weight(self, cr, uid, ids, name, args, context=None): res = {} - uom_obj = self.pool.get('product.uom') for picking in self.browse(cr, uid, ids, context=context): total_weight = total_weight_net = 0.00 @@ -119,26 +118,22 @@ class stock_picking(osv.osv): 'invoice_line_tax_id': [(6, 0, taxes_ids)], } - def action_invoice_create(self, cr, uid, ids, journal_id=False, - group=False, type='out_invoice', context=None): - invoice_obj = self.pool.get('account.invoice') - picking_obj = self.pool.get('stock.picking') + def _create_invoice_from_picking(self, cr, uid, picking, vals, context=None): + ''' This function simply creates the invoice from the given values. It is overriden in delivery module to add the delivery costs. picking is a browse_record + ''' invoice_line_obj = self.pool.get('account.invoice.line') - result = super(stock_picking, self).action_invoice_create(cr, uid, - ids, journal_id=journal_id, group=group, type=type, - context=context) - for picking in picking_obj.browse(cr, uid, result, context=context): - invoice = invoice_obj.browse(cr, uid, picking.id, context=context) - invoice_line = self._prepare_shipping_invoice_line(cr, uid, picking, invoice, context=context) - if invoice_line: - invoice_line_obj.create(cr, uid, invoice_line) - invoice_obj.button_compute(cr, uid, [invoice.id], context=context) - return result - def _get_default_uom(self,cr,uid,c): + invoice_id = super(stock_picking, self)._create_invoice_from_picking(cr, uid, picking, vals, context=context) + invoice = self.browse(cr, uid, invoice_id, context=context) + invoice_line = self._prepare_shipping_invoice_line(cr, uid, picking, invoice, context=context) + if invoice_line: + invoice_line_obj.create(cr, uid, invoice_line) + return invoice_id + + def _get_default_uom(self, cr, uid, c): uom_categ, uom_categ_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'product', 'product_uom_categ_kgm') - return self.pool.get('product.uom').search(cr, uid, [('category_id', '=', uom_categ_id),('factor','=',1)])[0] + return self.pool.get('product.uom').search(cr, uid, [('category_id', '=', uom_categ_id), ('factor', '=', 1)])[0] _defaults = { - 'weight_uom_id': lambda self,cr,uid,c: self._get_default_uom(cr,uid,c) + 'weight_uom_id': lambda self, cr, uid, c: self._get_default_uom(cr, uid, c) } diff --git a/addons/hr_expense/hr_expense_installer_view.xml b/addons/hr_expense/hr_expense_installer_view.xml index b897673f4ec..e5187650e1c 100644 --- a/addons/hr_expense/hr_expense_installer_view.xml +++ b/addons/hr_expense/hr_expense_installer_view.xml @@ -27,7 +27,7 @@ product.product form tree,form - + [('hr_expense_ok','=',True)] Define one product for each expense type allowed for an employee (travel by car, hostel, restaurant, etc). If you reimburse the employees at a fixed rate, set a cost and a unit of measure on the product. If you reimburse based on real costs, set the cost at 0.00. The user will set the real price when recording his expense sheet. diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index 15d034e0010..273647fc186 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -187,7 +187,7 @@ class mrp_bom(osv.osv): result[bom.id] = [] if bom.bom_lines: continue - ok = ((name=='child_complete_ids') and (bom.product_id.supply_method=='produce')) + ok = ((name=='child_complete_ids')) if (bom.type=='phantom' or ok): sids = bom_obj.search(cr, uid, [('bom_id','=',False),('product_id','=',bom.product_id.id)]) if sids: @@ -209,11 +209,10 @@ class mrp_bom(osv.osv): continue if line.bom_lines or line.type == 'phantom': continue - if line.product_id.supply_method == 'produce': - if line.product_id.procure_method == 'make_to_stock': - res[line.id] = 'stock' - else: - res[line.id] = 'order' + if line.product_id.procure_method == 'make_to_stock': + res[line.id] = 'stock' + else: + res[line.id] = 'order' return res _columns = { @@ -454,11 +453,12 @@ class mrp_production(osv.osv): def _moves_assigned(self, cr, uid, ids, name, arg, context=None): """ Test whether all the consume lines are assigned """ - res = True + res = {} for production in self.browse(cr, uid, ids, context=context): + res[production.id] = True states = [x.state != 'assigned' for x in production.move_lines if x] if any(states) or len(states) == 0: - return False + res[production.id] = False return res diff --git a/addons/mrp/mrp_data.xml b/addons/mrp/mrp_data.xml index a6b65b7c475..42290edde38 100644 --- a/addons/mrp/mrp_data.xml +++ b/addons/mrp/mrp_data.xml @@ -27,5 +27,21 @@ This application supports complete integration and production scheduling for sto 1 + + + + Manufacture + 5 + + + + Manufacture to stock + manufacture + + + + diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml index 583669277e2..0e47396cfbd 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -347,7 +347,7 @@
- +