diff --git a/addons/point_of_sale/__openerp__.py b/addons/point_of_sale/__openerp__.py index 27707bcf0e0..b83834d0677 100644 --- a/addons/point_of_sale/__openerp__.py +++ b/addons/point_of_sale/__openerp__.py @@ -67,14 +67,14 @@ Main features : # 'pos_wizard.xml', 'pos_view.xml', 'pos_sequence.xml', - 'posrule_data.xml', + #'posrule_data.xml', 'pos_data.xml', 'pos_workflow.xml', 'statement_view.xml', 'statement_report.xml', - 'statement_data.xml', + #'statement_data.xml', ], - 'demo_xml': ['pos_demo.xml','singer_statement_demo.xml','multi_company_stock_data.xml'], + 'demo_xml': ['pos_demo.xml','singer_statement_demo.xml','multi_company_stock_data.xml',], 'test':['test/pos_test.yml',], 'installable': True, } diff --git a/addons/point_of_sale/pos.py b/addons/point_of_sale/pos.py index 0ec31cb88fe..d31706e1b0e 100644 --- a/addons/point_of_sale/pos.py +++ b/addons/point_of_sale/pos.py @@ -192,11 +192,10 @@ class pos_order(osv.osv): (1-(line.discount or 0.0)/100.0), line.qty), res[order.id]['amount_tax']) else: - res[order.id]['amount_tax'] = reduce(lambda x, y: x+round(y['amount'], 2), - tax_obj.compute_all(cr, uid, line.product_id.taxes_id, + res[order.id]['amount_tax'] = tax_obj.compute_all(cr, uid, line.product_id.taxes_id, line.price_unit * \ - (1-(line.discount or 0.0)/100.0), line.qty), - res[order.id]['amount_tax']) + (1-(line.discount or 0.0)/100.0), line.qty)['total_included'] + return res @@ -1058,9 +1057,7 @@ class pos_order_line(osv.osv): for line in self.browse(cr, uid, ids): tax_amount = 0.0 taxes = [t for t in line.product_id.taxes_id] - computed_taxes = account_tax_objcompute_all(cr, uid, taxes, line.price_unit, line.qty) - for tax in computed_taxes: - tax_amount += tax['amount'] + tax_amount = account_tax_obj.compute_all(cr, uid, taxes, line.price_unit, line.qty)['total_included'] price = self.price_by_product(cr, uid, ids, line.order_id.pricelist_id.id, line.product_id.id, line.qty, line.order_id.partner_id.id) if line.discount!=0.0: res[line.id] = line.price_unit * line.qty * (1 - (line.discount or 0.0) / 100.0) diff --git a/addons/point_of_sale/test/pos_test.yml b/addons/point_of_sale/test/pos_test.yml index a96a792c711..3019b49144d 100644 --- a/addons/point_of_sale/test/pos_test.yml +++ b/addons/point_of_sale/test/pos_test.yml @@ -119,7 +119,7 @@ I create Sales Account. - !record {model: account.account, id: account_account_sales0}: - code: S + code: Sale company_id: base.main_company currency_mode: current name: Sales @@ -473,4 +473,9 @@ self.action_confirm(cr, uid, [ref("pos_confirm_0")], {"lang": "en_US", "active_model": "pos.order", "active_ids": [ref("pos_order_pos0")], "tz": False, "active_id": ref("pos_order_pos0"), }) - +- + I check order state is done. +- + !python {model: pos.order}: | + order=self.browse(cr,uid,ref("pos_order_pos0")) + assert(order.state=='done'), "Order is not done"