From 5a61a9400780236054ddcd62461ccfac74cca6e5 Mon Sep 17 00:00:00 2001 From: "uco (OpenERP)" Date: Thu, 20 May 2010 18:22:26 +0530 Subject: [PATCH 001/191] [IMP] mrp: Improved yamls for mrp. bzr revid: uco@tinyerp.com-20100520125226-spm7d20nbaarwe7u --- addons/mrp/test/mrp_phantom_bom.yml | 22 +++++++++++++++++++--- addons/mrp/test/mrp_procurement.yml | 24 ++++++++++++++++++++---- addons/mrp/test/mrp_production_order.yml | 18 ++++++++++++------ 3 files changed, 51 insertions(+), 13 deletions(-) diff --git a/addons/mrp/test/mrp_phantom_bom.yml b/addons/mrp/test/mrp_phantom_bom.yml index 5475d54ffd4..66f0183faaf 100644 --- a/addons/mrp/test/mrp_phantom_bom.yml +++ b/addons/mrp/test/mrp_phantom_bom.yml @@ -9,6 +9,8 @@ factor: 1.0 name: Litre rounding: 0.01 +- + I create record for product Orange Juice. - !record {model: product.product, id: product_product_orangejuice0}: categ_id: product.cat1 @@ -18,6 +20,8 @@ type: product uom_id: product_uom_litre0 uom_po_id: product_uom_litre0 +- + I create record for product Orange. - !record {model: product.product, id: product_product_orange0}: categ_id: product.cat1 @@ -31,6 +35,8 @@ type: product uom_id: product.product_uom_kgm uom_po_id: product.product_uom_kgm +- + I create record for product Sugar. - !record {model: product.product, id: product_product_sugar0}: categ_id: product.cat1 @@ -44,6 +50,8 @@ type: product uom_id: product.product_uom_kgm uom_po_id: product.product_uom_kgm +- + I create record for product Water. - !record {model: product.product, id: product_product_water0}: categ_id: product.cat1 @@ -64,6 +72,8 @@ product_qty: 1.0 product_uom: product_uom_litre0 type: phantom +- + I create bom lines for BoM for Orange Juice. - !record {model: mrp.bom, id: mrp_bom_orangejuice0}: bom_lines: @@ -92,7 +102,7 @@ product_uom: product_uom_litre0 type: normal - - I define Minimum stock rules for my stockable products orange and sugar + I define Minimum stock rules for my stockable products Orange. - !record {model: stock.warehouse.orderpoint, id: stock_warehouse_orderpoint_op0}: company_id: base.main_company @@ -105,6 +115,8 @@ product_uom: product.product_uom_kgm qty_multiple: 1 warehouse_id: stock.warehouse0 +- + I define Minimum stock rules for my stockable products Sugar. - !record {model: stock.warehouse.orderpoint, id: stock_warehouse_orderpoint_op1}: company_id: base.main_company @@ -177,14 +189,14 @@ - !function {model: mrp.procurement, name: run_scheduler}: - model: mrp.procurement - search: "[('origin','=',':MO/00002')]" + search: "[('state','!=','cofirmed')]" - I am checking Internal picking. I see one picking for Orange juice and its stock moves for Oranges, Sugar and Water made correctly. - !python {model: stock.picking}: | from tools.translate import _ - pick_ids = self.search(cr, uid, [('origin','=',':MO/00002'),('type','=','internal')]) + pick_ids = self.search(cr, uid, [('type','=','internal')]) assert pick_ids, _('No Internal Pickings!') - According to minimum stock rules. I have 2 purchase orders for @@ -220,11 +232,15 @@ assert pick_ids, _('No Incoming Shipments found!') - I receive both the products. My incoming pickings are done. +- + I create record for the incoming picking wizard. - !record {model: stock.partial.picking, id: stock_partial_picking0}: date: '2010-04-30 16:53:36' partner_id: base.res_partner_asus address_id: base.res_partner_address_tang +- + I make my pickings done. - !python {model: stock.partial.picking}: | pick_obj = self.pool.get('stock.picking') diff --git a/addons/mrp/test/mrp_procurement.yml b/addons/mrp/test/mrp_procurement.yml index 37d0de5c5a9..db7ccc1b211 100644 --- a/addons/mrp/test/mrp_procurement.yml +++ b/addons/mrp/test/mrp_procurement.yml @@ -4,7 +4,7 @@ - I am creating products. - - Creating a product.product record + I create record for product Shirt. - !record {model: product.product, id: product_product_shirt0}: categ_id: product.cat1 @@ -27,7 +27,7 @@ weight: 0.0 weight_net: 0.0 - - Creating a product.product record + I create record for product Cloth. - !record {model: product.product, id: product_product_cloth0}: categ_id: product.cat1 @@ -53,7 +53,7 @@ weight: 0.0 weight_net: 0.0 - - Creating a product.product record + I create record for product Buttons. - !record {model: product.product, id: product_product_buttons0}: categ_id: product.cat1 @@ -81,7 +81,7 @@ - I am creating bills of material for 'Shirt'. - - Creating a mrp.bom record + I create bills of material for Shirt. - !record {model: mrp.bom, id: mrp_bom_shirt0}: bom_lines: @@ -216,11 +216,15 @@ from tools.translate import _ pick_ids = self.search(cr, uid, [('address_id.name','=','Wong'),('state','=','assigned')]) assert pick_ids, _('No Incoming Shipments found!') +- + I create record for partial picking. - !record {model: stock.partial.picking, id: stock_partial_picking0}: date: '2010-04-30 16:53:36' partner_id: base.res_partner_maxtor address_id: base.res_partner_address_wong +- + I make my picking done. - !python {model: stock.partial.picking}: | pick_obj = self.pool.get('stock.picking') @@ -251,11 +255,15 @@ from tools.translate import _ pick_ids = self.search(cr, uid, [('address_id.name','=','Tang'),('state','=','assigned')]) assert pick_ids, _('No Incoming Shipments found!') +- + I create record for partial picking. - !record {model: stock.partial.picking, id: stock_partial_picking0}: date: '2010-04-30 16:53:36' partner_id: base.res_partner_maxtor address_id: base.res_partner_address_wong +- + I make my picking done. - !python {model: stock.partial.picking}: | pick_obj = self.pool.get('stock.picking') @@ -303,22 +311,30 @@ wf_service = netsvc.LocalService("workflow") for p_id in prod_ids: wf_service.trg_validate(uid, 'mrp.production', p_id, 'button_produce', cr) +- + I create record for producing products with quantity 5.00. - !record {model: mrp.product.produce, id: mrp_product_produce0}: product_qty: 5.00 mode: 'consume_produce' +- + I produce 2 products with 5.00 quantities each. - !python {model: mrp.product.produce}: | from tools.translate import _ prod_obj = self.pool.get('mrp.production') prod_ids = prod_obj.search(cr, uid, [('product_id.name','=','Shirt')]) self.do_produce(cr, uid, [1], context={'active_ids': prod_ids}) +- + I create record for remaining products with quantity 35.00. - !record {model: stock.move.consume, id: stock_move_consume0}: product_id: product_product_buttons0 product_qty: 35.00 product_uom: product.product_uom_unit location_id: stock.stock_location_stock +- + I produce remaining product Buttons with 35.00 quantity. - !python {model: stock.move.consume}: | from tools.translate import _ diff --git a/addons/mrp/test/mrp_production_order.yml b/addons/mrp/test/mrp_production_order.yml index 5de26180723..2c60a808742 100644 --- a/addons/mrp/test/mrp_production_order.yml +++ b/addons/mrp/test/mrp_production_order.yml @@ -18,7 +18,7 @@ product_uom: product.product_uom_unit product_uos_qty: 0.0 - - Creating a mrp.production.workcenter.line record + I create a record for Workcenter line. - !record {model: mrp.production.workcenter.line, id: mrp_production_workcenter_line_assemblyline0}: cycle: 5.0 @@ -28,7 +28,7 @@ sequence: 0.0 workcenter_id: mrp.mrp_workcenter_0 - - Creating a mrp.production.product.line record + I create second record for Workcenter line. - !record {model: mrp.production.product.line, id: mrp_production_product_line_regularprocessorconfig0}: name: Regular processor config @@ -38,7 +38,7 @@ product_uos_qty: 0.0 production_id: mrp_production_mo0 - - Creating a mrp.production.product.line record + I create third record for Workcenter line. - !record {model: mrp.production.product.line, id: mrp_production_product_line_hddseagategb0}: name: HDD Seagate 7200.8 80GB @@ -48,7 +48,7 @@ product_uos_qty: 0.0 production_id: mrp_production_mo0 - - Creating a mrp.production.product.line record + I create fourth record for Workcenter line. - !record {model: mrp.production.product.line, id: mrp_production_product_line_atxmidsizetower0}: name: ATX Mid-size Tower @@ -58,7 +58,7 @@ product_uos_qty: 0.0 production_id: mrp_production_mo0 - - Creating a mrp.production.product.line record + I create a record for production line. - !record {model: mrp.production.product.line, id: mrp_production_product_line_mouse0}: name: Mouse @@ -68,7 +68,7 @@ product_uos_qty: 0.0 production_id: mrp_production_mo0 - - Creating a mrp.production.product.line record + I create second record for production line. - !record {model: mrp.production.product.line, id: mrp_production_product_line_keyboard0}: name: Keyboard @@ -110,10 +110,14 @@ assert order_ids, _('No manufacturing order!') - I start producing that product first. So I marked it as started. +- + I create record for producing products with quantity 5.00. - !record {model: mrp.product.produce, id: mrp_product_produce0}: product_qty: 5.00 mode: 'consume_produce' +- + I produce the product. - !python {model: mrp.product.produce}: | prod_obj = self.pool.get('mrp.production') @@ -131,6 +135,8 @@ I start producing the product PC1. - !workflow {model: mrp.production, action: button_produce, ref: mrp_production_mo0} +- + Finally my production order is done. - !python {model: mrp.product.produce}: | from tools.translate import _ From cbe03042ef21ae66bffdd2c9f80e25f8e0fca9cd Mon Sep 17 00:00:00 2001 From: "uco (OpenERP)" Date: Thu, 20 May 2010 18:23:50 +0530 Subject: [PATCH 002/191] [IMP] mrp_repair: Corrected warning message. bzr revid: uco@tinyerp.com-20100520125350-w4zg37ta70e9pt3q --- addons/mrp_repair/wizard/cancel_repair.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mrp_repair/wizard/cancel_repair.py b/addons/mrp_repair/wizard/cancel_repair.py index d866d70cb6a..de6e8095569 100644 --- a/addons/mrp_repair/wizard/cancel_repair.py +++ b/addons/mrp_repair/wizard/cancel_repair.py @@ -44,7 +44,7 @@ class repair_cancel(osv.osv_memory): if repair_order.invoiced or repair_order.invoice_method == 'none': repair_order_obj.action_cancel(cr, uid, [record_id], context=context) else: - raise osv.except_osv(_('Warning!'),_('Repair is not cancelled. It is not invoiced.')) + raise osv.except_osv(_('Warning!'),_('Repair order is not invoiced.')) return {} From 5c8af6372470a5eb89a9079defd3e4856de23b05 Mon Sep 17 00:00:00 2001 From: "uco (OpenERP)" Date: Thu, 20 May 2010 18:48:29 +0530 Subject: [PATCH 003/191] [IMP] sale: Improved yaml. bzr revid: uco@tinyerp.com-20100520131829-gz859ovq7knljjbm --- addons/sale/test/sale_procurement.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/sale/test/sale_procurement.yml b/addons/sale/test/sale_procurement.yml index c9d26baec9f..a5e78117674 100644 --- a/addons/sale/test/sale_procurement.yml +++ b/addons/sale/test/sale_procurement.yml @@ -3,6 +3,8 @@ products with different supply method and procurement method. - I create two products. +- + I create one product Table. - !record {model: product.product, id: product_product_table0}: categ_id: product.cat1 @@ -12,6 +14,8 @@ type: product uom_id: product.product_uom_unit uom_po_id: product.product_uom_unit +- + I create another product Wood. - !record {model: product.product, id: product_product_wood0}: categ_id: product.cat1 From ff9c1df8db1ef773d86bf20913e74f31ecf77d2a Mon Sep 17 00:00:00 2001 From: "uco (OpenERP)" Date: Fri, 21 May 2010 14:43:08 +0530 Subject: [PATCH 004/191] [ADD] project_mrp: Added a yaml. bzr revid: uco@tinyerp.com-20100521091308-00b8v8fenysdtc7s --- addons/project_mrp/__openerp__.py | 1 + .../test/project_task_procurement.yml | 75 +++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 addons/project_mrp/test/project_task_procurement.yml diff --git a/addons/project_mrp/__openerp__.py b/addons/project_mrp/__openerp__.py index ee5a94208aa..342ff9e3d91 100644 --- a/addons/project_mrp/__openerp__.py +++ b/addons/project_mrp/__openerp__.py @@ -53,6 +53,7 @@ automatically created via sale orders. #'process/project_mrp_process.xml', ], 'demo_xml': [], + 'test': ['test/project_task_procurement.yml'], 'installable': True, 'active': False, 'certificate': '0031976495453', diff --git a/addons/project_mrp/test/project_task_procurement.yml b/addons/project_mrp/test/project_task_procurement.yml new file mode 100644 index 00000000000..dda382a128a --- /dev/null +++ b/addons/project_mrp/test/project_task_procurement.yml @@ -0,0 +1,75 @@ +- + In order to test project_mrp module with OpenERP I want to create sale orders + with product type 'service' so when procurement runs one task is created. +- + I create record for a service type product. +- + !record {model: product.product, id: product_product_partnerstraining0}: + categ_id: product.product_category_7 + cost_method: standard + mes_type: fixed + name: Partners Training + procure_method: make_to_order + supply_method: produce + type: service + uom_id: product.uom_day + uom_po_id: product.uom_day + warranty: 0.0 +- + I create a sale order for product Partners Training which has type 'Service'. +- + !record {model: sale.order, id: sale_order_so0}: + date_order: '2010-05-21' + invoice_quantity: order + name: SO006 + order_policy: manual + partner_id: base.res_partner_asus + partner_invoice_id: base.res_partner_address_tang + partner_order_id: base.res_partner_address_tang + partner_shipping_id: base.res_partner_address_tang + order_line: + - state: draft + delay: 7.0 + name: Partners Training + price_unit: 1.0 + product_id: product_product_partnerstraining0 + product_uom: product.uom_day + product_uom_qty: 5.0 + th_weight: 0.0 + type: make_to_order + picking_policy: direct + pricelist_id: product.list0 + shop_id: sale.shop + user_id: base.user_demo +- + I confirm this sale order. +- + !workflow {model: sale.order, action: order_confirm, ref: sale_order_so0} +- + I check the procurements. +- + !python {model: mrp.procurement}: | + from tools.translate import _ + orderline_obj = self.pool.get('sale.order.line') + line_ids = orderline_obj.search(cr, uid, [('order_id','=', ref('sale_order_so0'))]) + orders = orderline_obj.browse(cr, uid, line_ids) + proc_ids = map(lambda x: x.procurement_id.id, orders) + assert proc_ids, _('No Procurements!') +- + The scheduler runs. +- + !function {model: mrp.procurement, name: run_scheduler}: + - model: mrp.procurement + search: "[('state','=','confirmed')]" +- + Now I check the tasks. +- + I see that one task is created for my sale order. +- + !python {model: project.task}: | + from tools.translate import _ + order_obj = self.pool.get('sale.order') + order = order_obj.browse(cr, uid, ref('sale_order_so0')) + task_id = self.search(cr, uid, [('project_id.name','=', order.name)]) + assert task_id, _('No Task is created!') + \ No newline at end of file From 03dd9bd079e840bd424965fa464003f0561d2f8a Mon Sep 17 00:00:00 2001 From: mso Date: Fri, 21 May 2010 17:51:05 +0530 Subject: [PATCH 005/191] [ADD] sale: yml for make invoice wizards has been added and few modifications in existing ymls bzr revid: mso@mso-20100521122105-2u3a2zdju1x3uzl7 --- addons/sale/__openerp__.py | 2 + .../sale/test/shipping_manual_sale_order.yml | 4 +- addons/sale/test/so_make_invoice.yml | 341 +++++++++++++++++ addons/sale/test/so_make_line_invoice.yml | 342 ++++++++++++++++++ addons/sale/wizard/sale_line_invoice.py | 1 + 5 files changed, 688 insertions(+), 2 deletions(-) create mode 100644 addons/sale/test/so_make_invoice.yml create mode 100644 addons/sale/test/so_make_line_invoice.yml diff --git a/addons/sale/__openerp__.py b/addons/sale/__openerp__.py index 651945752a7..d43278381f5 100644 --- a/addons/sale/__openerp__.py +++ b/addons/sale/__openerp__.py @@ -65,6 +65,8 @@ 'test/shipping_manual_sale_order.yml', 'test/prepaid_sale_order.yml', 'test/advance_invoice.yml', + 'test/so_make_line_invoice.yml', + 'test/so_make_invoice.yml', 'test/sale_procurement.yml', ], 'installable': True, diff --git a/addons/sale/test/shipping_manual_sale_order.yml b/addons/sale/test/shipping_manual_sale_order.yml index 4bbbbb74dc5..c030a80c64a 100644 --- a/addons/sale/test/shipping_manual_sale_order.yml +++ b/addons/sale/test/shipping_manual_sale_order.yml @@ -211,7 +211,7 @@ !record {model: product.category, id: product_category_services0}: name: Mobile Services - - I define LG Viewty Smart product template. + I define New Chocolate Slider Mobile template. - !record {model: product.template, id: product_template_newchocolateslidermobile0}: categ_id: product_category_allproductssellable0 @@ -226,7 +226,7 @@ uom_id: product.product_uom_unit uom_po_id: product.product_uom_unit - - I define LG Viewty Smart product. + I define New Chocolate Slider Mobile. - !record {model: product.product, id: product_product_newchocolateslidermobile0}: categ_id: product_category_allproductssellable0 diff --git a/addons/sale/test/so_make_invoice.yml b/addons/sale/test/so_make_invoice.yml new file mode 100644 index 00000000000..e34b11ffb2b --- /dev/null +++ b/addons/sale/test/so_make_invoice.yml @@ -0,0 +1,341 @@ +- + In order to test the sale module in the Open-ERP, I need to configure details regarding product & customer. +- + I am going to sell my Mobile products to the customer with name Cleartrail +- + I create View Account Type. +- + !record {model: account.account.type, id: account_account_type_view0}: + close_method: none + code: View + name: View + sign: 1 +- + I create Income Account Type. +- + !record {model: account.account.type, id: account_account_type_income0}: + close_method: unreconciled + code: Income + name: Income + sign: 1 +- + I create Expense Account Type. +- + !record {model: account.account.type, id: account_account_type_expense0}: + close_method: unreconciled + code: Expense + name: Expense + sign: 1 +- + I create Cash Account Type. +- + !record {model: account.account.type, id: account_account_type_cash0}: + close_method: balance + code: Cash + name: Cash + sign: 1 +- + I create Minimal Chart Account. +- + !record {model: account.account, id: account_account_minimalchart0}: + code: '0' + company_id: base.main_company + currency_mode: current + name: Minimal Chart + parent_left: 1 + parent_right: 12 + type: view + user_type: account_account_type_view0 +- + I create Payable Account. +- + !record {model: account.account, id: account_account_payable1}: + code: AP + company_id: base.main_company + currency_mode: current + name: Payable + parent_id: account_account_minimalchart0 + parent_left: 2 + parent_right: 3 + reconcile: true + type: payable + user_type: account_account_type_expense0 +- + I create Receivable Account. +- + !record {model: account.account, id: account_account_receivable0}: + code: AR + company_id: base.main_company + currency_mode: current + name: Receivable + parent_id: account_account_minimalchart0 + parent_left: 4 + parent_right: 5 + reconcile: true + type: receivable + user_type: account_account_type_income0 +- + I create Cash Account. +- + !record {model: account.account, id: account_account_cash0}: + code: C + company_id: base.main_company + currency_mode: current + name: Cash + parent_id: account_account_minimalchart0 + parent_left: 6 + parent_right: 7 + type: other + user_type: account_account_type_cash0 +- + I create Purchases Account. +- + !record {model: account.account, id: account_account_purchases0}: + code: P + company_id: base.main_company + currency_mode: current + name: Purchases + parent_id: account_account_minimalchart0 + parent_left: 8 + parent_right: 9 + type: other + user_type: account_account_type_expense0 +- + I create Sales Account. +- + !record {model: account.account, id: account_account_sales0}: + code: S + company_id: base.main_company + currency_mode: current + name: Sales + parent_id: account_account_minimalchart0 + parent_left: 10 + parent_right: 11 + type: other + user_type: account_account_type_income0 +- + I create Purchase Journal. +- + !record {model: account.journal, id: account_journal_purchasejournal0}: + code: PUJ + company_id: base.main_company + default_credit_account_id: account_account_purchases0 + default_debit_account_id: account_account_purchases0 + name: Purchase Journal + sequence_id: account.sequence_purchase_journal + type: purchase + view_id: account.account_journal_view +- + I create Sale Journal. +- + !record {model: account.journal, id: account_journal_salejournal0}: + code: SAJ + company_id: base.main_company + default_credit_account_id: account_account_sales0 + default_debit_account_id: account_account_sales0 + name: Sale Journal + sequence_id: account.sequence_sale_journal + type: sale + view_id: account.account_journal_view +- + I create Bank Journal. +- + !record {model: account.journal, id: account_journal_bankjournal0}: + code: BNK + company_id: base.main_company + default_credit_account_id: account_account_cash0 + default_debit_account_id: account_account_cash0 + name: Bank Journal + sequence_id: account.sequence_journal + type: cash + view_id: account.account_journal_bank_view +- + I create ir.property for account payable. +- + !record {model: ir.property, id: ir_property_propertyaccountexpensecateg0}: + company_id: base.main_company + fields_id: account.field_res_partner_property_account_payable + name: property_account_expense_categ + value_reference: account.account,5 +- + I create ir.property for account receivable. +- + !record {model: ir.property, id: ir_property_propertyaccountincomecateg0}: + company_id: base.main_company + fields_id: account.field_res_partner_property_account_receivable + name: property_account_income_categ + value_reference: account.account,6 +- + I create Partner category Customers. +- + !record {model: res.partner.category, id: res_partner_category_customers0}: + name: Customers +- + I create Cleartrail Customer. +- + !record {model: res.partner, id: res_partner_cleartrail0}: + category_id: + - res_partner_category_customers0 + name: Cleartrail +- + I create contact address for Cleartrail. +- + !record {model: res.partner.address, id: res_partner_address_1}: + partner_id: res_partner_cleartrail0 + street: onam plaza, 14 B palasia A B Road + type: contact +- + I create invoice address for Cleartrail. +- + !record {model: res.partner.address, id: res_partner_address_2}: + partner_id: res_partner_cleartrail0 + street: sarda house 24 B palasia, A B Road + type: invoice +- + I create delivery address for Cleartrail. +- + !record {model: res.partner.address, id: res_partner_address_3}: + partner_id: res_partner_cleartrail0 + street: sangam house 15 B palasia, A B Road + type: delivery +- + Customer Cleartrail has specific instrument requirement regarding the stockable products. +- + I define product category Mobile Products Sellable. +- + !record {model: product.category, id: product_category_allproductssellable0}: + name: Mobile Products Sellable +- + I define product category Mobile Services. +- + !record {model: product.category, id: product_category_services0}: + name: Mobile Services +- + I define LG Viewty Smart product template. +- + !record {model: product.template, id: product_template_lgviewtysmart0}: + categ_id: product_category_allproductssellable0 + cost_method: standard + list_price: 170.0 + mes_type: fixed + name: LG Viewty Smart + procure_method: make_to_order + standard_price: 160.0 + supply_method: produce + type: product + uom_id: product.product_uom_unit + uom_po_id: product.product_uom_unit +- + I define LG Viewty Smart product. +- + !record {model: product.product, id: product_product_lgviewtysmart0}: + categ_id: product_category_allproductssellable0 + cost_method: standard + list_price: 170.0 + mes_type: fixed + name: LG Viewty Smart + pricelist_purchase: 'Default Purchase Pricelist (0.00) : 160.00\n' + pricelist_sale: 'Public Pricelist (0.00) : 170.00\n' + procure_method: make_to_order + property_account_expense: sale.account_account_payable1 + property_account_income: sale.account_account_receivable0 + seller_delay: '1' + standard_price: 160.0 + supply_method: produce + type: product + uom_id: product.product_uom_unit + uom_po_id: product.product_uom_unit +- + I define New Chocolate Slider Mobile template. +- + !record {model: product.template, id: product_template_newchocolateslidermobile0}: + categ_id: product_category_allproductssellable0 + cost_method: standard + list_price: 200.0 + mes_type: fixed + name: New Chocolate Slider Mobile + procure_method: make_to_order + standard_price: 189.0 + supply_method: buy + type: product + uom_id: product.product_uom_unit + uom_po_id: product.product_uom_unit +- + I define New Chocolate Slider Mobile. +- + !record {model: product.product, id: product_product_newchocolateslidermobile0}: + categ_id: product_category_allproductssellable0 + cost_method: standard + list_price: 200.0 + mes_type: fixed + name: New Chocolate Slider Mobile + pricelist_purchase: 'Default Purchase Pricelist (0.00) : 189.00\n' + pricelist_sale: 'Public Pricelist (0.00) : 200.00\n' + procure_method: make_to_order + property_account_expense: sale.account_account_payable1 + property_account_income: sale.account_account_receivable0 + seller_delay: '1' + standard_price: 189.0 + supply_method: buy + type: product + uom_id: product.product_uom_unit + uom_po_id: product.product_uom_unit +- + I create a Sale Order for LG Viewty Smart for qty 500 having order_policy manual. +- + !record {model: sale.order, id: sale_order_so4}: + date_order: '2010-05-12' + invoice_quantity: order + name: Test_SO004 + order_line: + - name: New Chocolate Slider Mobile + price_unit: 200.0 + product_uom: product.product_uom_unit + product_uom_qty: 500.0 + state: draft + delay: 7.0 + product_id: sale.product_product_newchocolateslidermobile0 + product_uos_qty: 500.0 + type: make_to_order + - name: LG Viewty Smart + price_unit: 170.0 + product_uom: product.product_uom_unit + product_uom_qty: 500.0 + state: draft + delay: 7.0 + product_id: sale.product_product_lgviewtysmart0 + product_uos_qty: 500.0 + th_weight: 0.0 + type: make_to_order + order_policy: manual + partner_id: sale.res_partner_cleartrail0 + partner_invoice_id: sale.res_partner_address_2 + partner_order_id: sale.res_partner_address_1 + partner_shipping_id: sale.res_partner_address_3 + picking_policy: direct + pricelist_id: product.list0 + shop_id: sale.shop +- + I confirm the Sale Order. +- + !workflow {model: sale.order, action: order_confirm, ref: sale_order_so4} +- + I create an invoice on sale order. +- + !record {model: sale.make.invoice, id: sale_make_invoice_1}: + {} +- + Invoice is created for specific sale order. +- + !python {model: sale.make.invoice}: | + self.make_invoices(cr, uid, [ref("sale_make_invoice_1")], {"lang": 'en_US', "search_default_user_id": + 1, "tz": False, "active_model": 'sale.order', "active_ids": [ref("sale_order_so4")], "active_id": + ref("sale_order_so4"), }) +- + I verify that invoice regarding sale order has been created. +- + !python {model: sale.order}: | + so = self.browse(cr, uid, ref("sale_order_so4")) + assert so.invoice_ids, "Invoices has not been generated for sale_order_so0" + + \ No newline at end of file diff --git a/addons/sale/test/so_make_line_invoice.yml b/addons/sale/test/so_make_line_invoice.yml new file mode 100644 index 00000000000..de5782c8517 --- /dev/null +++ b/addons/sale/test/so_make_line_invoice.yml @@ -0,0 +1,342 @@ +- + In order to test the sale module in the Open-ERP, I need to configure details regarding product & customer. +- + I am going to sell my Mobile products to the customer with name Cleartrail +- + I create View Account Type. +- + !record {model: account.account.type, id: account_account_type_view0}: + close_method: none + code: View + name: View + sign: 1 +- + I create Income Account Type. +- + !record {model: account.account.type, id: account_account_type_income0}: + close_method: unreconciled + code: Income + name: Income + sign: 1 +- + I create Expense Account Type. +- + !record {model: account.account.type, id: account_account_type_expense0}: + close_method: unreconciled + code: Expense + name: Expense + sign: 1 +- + I create Cash Account Type. +- + !record {model: account.account.type, id: account_account_type_cash0}: + close_method: balance + code: Cash + name: Cash + sign: 1 +- + I create Minimal Chart Account. +- + !record {model: account.account, id: account_account_minimalchart0}: + code: '0' + company_id: base.main_company + currency_mode: current + name: Minimal Chart + parent_left: 1 + parent_right: 12 + type: view + user_type: account_account_type_view0 +- + I create Payable Account. +- + !record {model: account.account, id: account_account_payable1}: + code: AP + company_id: base.main_company + currency_mode: current + name: Payable + parent_id: account_account_minimalchart0 + parent_left: 2 + parent_right: 3 + reconcile: true + type: payable + user_type: account_account_type_expense0 +- + I create Receivable Account. +- + !record {model: account.account, id: account_account_receivable0}: + code: AR + company_id: base.main_company + currency_mode: current + name: Receivable + parent_id: account_account_minimalchart0 + parent_left: 4 + parent_right: 5 + reconcile: true + type: receivable + user_type: account_account_type_income0 +- + I create Cash Account. +- + !record {model: account.account, id: account_account_cash0}: + code: C + company_id: base.main_company + currency_mode: current + name: Cash + parent_id: account_account_minimalchart0 + parent_left: 6 + parent_right: 7 + type: other + user_type: account_account_type_cash0 +- + I create Purchases Account. +- + !record {model: account.account, id: account_account_purchases0}: + code: P + company_id: base.main_company + currency_mode: current + name: Purchases + parent_id: account_account_minimalchart0 + parent_left: 8 + parent_right: 9 + type: other + user_type: account_account_type_expense0 +- + I create Sales Account. +- + !record {model: account.account, id: account_account_sales0}: + code: S + company_id: base.main_company + currency_mode: current + name: Sales + parent_id: account_account_minimalchart0 + parent_left: 10 + parent_right: 11 + type: other + user_type: account_account_type_income0 +- + I create Purchase Journal. +- + !record {model: account.journal, id: account_journal_purchasejournal0}: + code: PUJ + company_id: base.main_company + default_credit_account_id: account_account_purchases0 + default_debit_account_id: account_account_purchases0 + name: Purchase Journal + sequence_id: account.sequence_purchase_journal + type: purchase + view_id: account.account_journal_view +- + I create Sale Journal. +- + !record {model: account.journal, id: account_journal_salejournal0}: + code: SAJ + company_id: base.main_company + default_credit_account_id: account_account_sales0 + default_debit_account_id: account_account_sales0 + name: Sale Journal + sequence_id: account.sequence_sale_journal + type: sale + view_id: account.account_journal_view +- + I create Bank Journal. +- + !record {model: account.journal, id: account_journal_bankjournal0}: + code: BNK + company_id: base.main_company + default_credit_account_id: account_account_cash0 + default_debit_account_id: account_account_cash0 + name: Bank Journal + sequence_id: account.sequence_journal + type: cash + view_id: account.account_journal_bank_view +- + I create ir.property for account payable. +- + !record {model: ir.property, id: ir_property_propertyaccountexpensecateg0}: + company_id: base.main_company + fields_id: account.field_res_partner_property_account_payable + name: property_account_expense_categ + value_reference: account.account,5 +- + I create ir.property for account receivable. +- + !record {model: ir.property, id: ir_property_propertyaccountincomecateg0}: + company_id: base.main_company + fields_id: account.field_res_partner_property_account_receivable + name: property_account_income_categ + value_reference: account.account,6 +- + I create Partner category Customers. +- + !record {model: res.partner.category, id: res_partner_category_customers0}: + name: Customers +- + I create Cleartrail Customer. +- + !record {model: res.partner, id: res_partner_cleartrail0}: + category_id: + - res_partner_category_customers0 + name: Cleartrail +- + I create contact address for Cleartrail. +- + !record {model: res.partner.address, id: res_partner_address_1}: + partner_id: res_partner_cleartrail0 + street: onam plaza, 14 B palasia A B Road + type: contact +- + I create invoice address for Cleartrail. +- + !record {model: res.partner.address, id: res_partner_address_2}: + partner_id: res_partner_cleartrail0 + street: sarda house 24 B palasia, A B Road + type: invoice +- + I create delivery address for Cleartrail. +- + !record {model: res.partner.address, id: res_partner_address_3}: + partner_id: res_partner_cleartrail0 + street: sangam house 15 B palasia, A B Road + type: delivery +- + Customer Cleartrail has specific instrument requirement regarding the stockable products. +- + I define product category Mobile Products Sellable. +- + !record {model: product.category, id: product_category_allproductssellable0}: + name: Mobile Products Sellable +- + I define product category Mobile Services. +- + !record {model: product.category, id: product_category_services0}: + name: Mobile Services +- + I define LG Viewty Smart product template. +- + !record {model: product.template, id: product_template_lgviewtysmart0}: + categ_id: product_category_allproductssellable0 + cost_method: standard + list_price: 170.0 + mes_type: fixed + name: LG Viewty Smart + procure_method: make_to_order + standard_price: 160.0 + supply_method: produce + type: product + uom_id: product.product_uom_unit + uom_po_id: product.product_uom_unit +- + I define LG Viewty Smart product. +- + !record {model: product.product, id: product_product_lgviewtysmart0}: + categ_id: product_category_allproductssellable0 + cost_method: standard + list_price: 170.0 + mes_type: fixed + name: LG Viewty Smart + pricelist_purchase: 'Default Purchase Pricelist (0.00) : 160.00\n' + pricelist_sale: 'Public Pricelist (0.00) : 170.00\n' + procure_method: make_to_order + property_account_expense: sale.account_account_payable1 + property_account_income: sale.account_account_receivable0 + seller_delay: '1' + standard_price: 160.0 + supply_method: produce + type: product + uom_id: product.product_uom_unit + uom_po_id: product.product_uom_unit +- + I define New Chocolate Slider Mobile template. +- + !record {model: product.template, id: product_template_newchocolateslidermobile0}: + categ_id: product_category_allproductssellable0 + cost_method: standard + list_price: 200.0 + mes_type: fixed + name: New Chocolate Slider Mobile + procure_method: make_to_order + standard_price: 189.0 + supply_method: buy + type: product + uom_id: product.product_uom_unit + uom_po_id: product.product_uom_unit +- + I define New Chocolate Slider Mobile. +- + !record {model: product.product, id: product_product_newchocolateslidermobile0}: + categ_id: product_category_allproductssellable0 + cost_method: standard + list_price: 200.0 + mes_type: fixed + name: New Chocolate Slider Mobile + pricelist_purchase: 'Default Purchase Pricelist (0.00) : 189.00\n' + pricelist_sale: 'Public Pricelist (0.00) : 200.00\n' + procure_method: make_to_order + property_account_expense: sale.account_account_payable1 + property_account_income: sale.account_account_receivable0 + seller_delay: '1' + standard_price: 189.0 + supply_method: buy + type: product + uom_id: product.product_uom_unit + uom_po_id: product.product_uom_unit +- + I create a Sale Order for LG Viewty Smart for qty 500 having order_policy manual. +- + !record {model: sale.order, id: sale_order_so3}: + date_order: '2010-05-12' + invoice_quantity: order + name: Test_SO003 + order_line: + - name: New Chocolate Slider Mobile + price_unit: 200.0 + product_uom: product.product_uom_unit + product_uom_qty: 500.0 + state: draft + delay: 7.0 + product_id: sale.product_product_newchocolateslidermobile0 + product_uos_qty: 500.0 + type: make_to_order + - name: LG Viewty Smart + price_unit: 170.0 + product_uom: product.product_uom_unit + product_uom_qty: 500.0 + state: draft + delay: 7.0 + product_id: sale.product_product_lgviewtysmart0 + product_uos_qty: 500.0 + th_weight: 0.0 + type: make_to_order + order_policy: manual + partner_id: sale.res_partner_cleartrail0 + partner_invoice_id: sale.res_partner_address_2 + partner_order_id: sale.res_partner_address_1 + partner_shipping_id: sale.res_partner_address_3 + picking_policy: direct + pricelist_id: product.list0 + shop_id: sale.shop +- + I confirm the Sale Order. +- + !workflow {model: sale.order, action: order_confirm, ref: sale_order_so3} +- + I create an invoice on sale order line. +- + !record {model: sale.order.line.make.invoice, id: sale_order_line_make_invoice_0}: + {} +- + invoice is created for specific sale order line. +- + !python {model: sale.order.line.make.invoice}: | + sale_order_obj = self.pool.get('sale.order') + so = sale_order_obj.browse(cr, uid, ref("sale_order_so3")) + sol = so.order_line[0] + self.make_invoices(cr, uid, [ref("sale_order_line_make_invoice_0")], {"lang": + 'en_US', "active_model": "sale.order.line", "active_ids": [ref(sol.id)], "tz": + False, "active_id": ref(sol.id), }) +- + I verify that invoice regarding sale order line has been created. +- + !python {model: sale.order}: | + so = self.browse(cr, uid, ref("sale_order_so3")) + assert so.invoice_ids, "Invoices has not been generated for sale_order_so0" diff --git a/addons/sale/wizard/sale_line_invoice.py b/addons/sale/wizard/sale_line_invoice.py index 15405f07874..195931ecb04 100644 --- a/addons/sale/wizard/sale_line_invoice.py +++ b/addons/sale/wizard/sale_line_invoice.py @@ -21,6 +21,7 @@ from osv import fields, osv from tools.translate import _ +import netsvc class sale_order_line_make_invoice(osv.osv_memory): _name = "sale.order.line.make.invoice" From 9d14989a554817298edb856acddfb5d04c2afcc4 Mon Sep 17 00:00:00 2001 From: mtr Date: Fri, 21 May 2010 18:47:17 +0530 Subject: [PATCH 006/191] [ADD] auction: Added yaml for auction bzr revid: mtr@mtr-20100521131717-ajfs9k78xl79akp5 --- addons/auction/__openerp__.py | 1 + addons/auction/test/auction.yml | 207 +++++++++++++++++ addons/auction/test/auction_wizard.yml | 297 +++++++++++++++++++++++++ 3 files changed, 505 insertions(+) create mode 100644 addons/auction/test/auction.yml create mode 100644 addons/auction/test/auction_wizard.yml diff --git a/addons/auction/__openerp__.py b/addons/auction/__openerp__.py index cd27c60fdb7..0959d6a4dd9 100644 --- a/addons/auction/__openerp__.py +++ b/addons/auction/__openerp__.py @@ -60,6 +60,7 @@ 'auction_wizard.xml' ], 'demo_xml': ['auction_demo.xml'], +# 'test' : ['test/auction.yml','test/auction_wizard.yml'], 'installable': True, 'active': False, 'certificate': '0039333102717', diff --git a/addons/auction/test/auction.yml b/addons/auction/test/auction.yml new file mode 100644 index 00000000000..febcae2b3f3 --- /dev/null +++ b/addons/auction/test/auction.yml @@ -0,0 +1,207 @@ +- + In order to test the auction module in the Open-ERP I start the process by creating a product +- + Creating a product.product record +- + !record {model: product.product, id: product_product_furniture0}: + categ_id: product.cat1 + cost_method: standard + mes_type: fixed + name: Furniture + procure_method: make_to_stock + standard_price: 1.0 + supply_method: buy + type: product + uom_id: product.product_uom_unit + uom_po_id: product.product_uom_unit + volume: 0.0 + warranty: 0.0 + weight: 0.0 + weight_net: 0.0 +- + Creating a new artist +- + Creating a auction.artists record +- + !record {model: auction.artists, id: auction_artists_vincentvangogh0}: + birth_death_dates: 1853-1900 + name: Vincent van Gogh +- + Now I want to associate an object with the auction so for that I create an auction record +- + I create a new auction record +- + Creating a auction.dates record +- + !record {model: auction.dates, id: auction_dates_antiquefurnitureexhibition0}: + acc_expense: account.a_pay + acc_income: account.a_recv + account_analytic_id: account.analytic_root + auction1: '2010-05-20' + auction2: '2010-05-21' + expo1: '2010-05-18' + expo2: '2010-05-19' + journal_id: account.expenses_journal + journal_seller_id: account.sales_journal + name: Antique furniture exhibition +- + I create a seller's deposit record +- + Creating a auction.deposit record +- + !record {model: auction.deposit, id: auction_deposit_ad0}: + date_dep: '2010-05-18' + method: keep + name: AD/006 + partner_id: base.res_partner_4 +- + I create a bid record +- + Creating a auction.bid record +- + !record {model: auction.bid, id: auction_bid_bid0}: + auction_id: auction_dates_antiquefurnitureexhibition0 + contact_tel: (+32)2 211 34 83 + name: bid/004 + partner_id: auction.partner_record1 +- + Creating a auction.bid record +- + !record {model: auction.bid, id: auction_bid_bid1}: + auction_id: auction_dates_antiquefurnitureexhibition0 + name: bid/005 + partner_id: base.res_partner_2 +- + I create a new object record +- + Creating a auction.lots record +- + !record {model: auction.lots, id: auction_lots_woodenchair0}: + ach_uid: base.res_partner_2 + artist_id: auction_artists_vincentvangogh0 + auction_id: auction_dates_antiquefurnitureexhibition0 + bid_lines: + - bid_id: auction_bid_bid1 + call: 1 + price: 5000.0 + - bid_id: auction_bid_bid0 + price: 4500.0 + bord_vnd_id: auction_deposit_ad0 + lot_est1: 3000.0 + lot_est2: 5000.0 + lot_num: 1 + name: wooden-chair + name2: antique wooden chair + obj_num: 1 + obj_price: 4000.0 + obj_ret: 5000.0 + product_id: 'product_product_furniture0' + state: draft + vnd_lim: 5000.0 +- + I check that buyer price and seller price gets bind with the value +- + !python {model: auction.lots}: | + from tools.translate import _ + auc_id=self.browse(cr, uid, ref("auction_lots_woodenchair0")) + assert(auc_id.buyer_price,auc_id.seller_price), _('Buyer price and seller price are not available!') +- + I check that a record gets created in the report.seller.auction object +- + !python {model: auction.lots}: | + from tools.translate import _ + auc_id=self.browse(cr, uid, ref("auction_lots_woodenchair0")) + auc_deposit_obj=self.pool.get('auction.deposit') + rep_sell_obj = self.pool.get('report.seller.auction') + ids =rep_sell_obj.search(cr, uid, [('auction', '=', auc_id.auction_id.id),('seller', '=',auc_id.bord_vnd_id.partner_id.id)]) + assert ids, _('No record found!') +- + I check that a record gets created in the report.seller.auction2 object +- + !python {model: auction.lots}: | + from tools.translate import _ + auc_id=self.browse(cr, uid, ref("auction_lots_woodenchair0")) + auc_deposit_obj=self.pool.get('auction.deposit') + rep_sell_obj = self.pool.get('report.seller.auction2') + ids =rep_sell_obj.search(cr, uid, [('auction', '=', auc_id.auction_id.id),('seller', '=',auc_id.bord_vnd_id.partner_id.id)]) + assert ids, _('No record found!') +- + I check that a record gets created in the report.buyer.auction object +- + !python {model: auction.lots}: | + from tools.translate import _ + auc_id1=self.browse(cr, uid, ref("auction_lots_woodenchair0")) + rep_buy_obj1 = self.pool.get('report.buyer.auction') + ids1=rep_buy_obj1.search(cr, uid, [('auction', '=', auc_id1.auction_id.id),('buyer', '=',auc_id1.ach_uid.id)]) + assert ids1, _('No record found!') +- + I check that a record gets created in the report.buyer.auction2 object +- + !python {model: auction.lots}: | + from tools.translate import _ + auc_id1=self.browse(cr, uid, ref("auction_lots_woodenchair0")) + rep_buy_obj1 = self.pool.get('report.buyer.auction2') + ids1=rep_buy_obj1.search(cr, uid, [('auction', '=', auc_id1.auction_id.id),('buyer', '=',auc_id1.ach_uid.id)]) + assert ids1, _('No record found!') +- + I check that a record gets created in the report.auction.view object +- + !python {model: auction.lots}: | + from tools.translate import _ + auc_id2=self.browse(cr, uid, ref("auction_lots_woodenchair0")) + rep_auc_obj1 = self.pool.get('report.auction.view') + ids2=rep_auc_obj1.search(cr, uid, [('auction_id', '=', auc_id2.auction_id.id)]) + assert ids2, _('No record found!') +- + I check that a record gets created in the report.auction.view2 object +- + !python {model: auction.lots}: | + from tools.translate import _ + auc_id3=self.browse(cr, uid, ref("auction_lots_woodenchair0")) + rep_auc_obj1 = self.pool.get('report.auction.view2') + ids3=rep_auc_obj1.search(cr, uid, [('auction', '=', auc_id3.auction_id.id)]) + assert ids3, _('No record found!') +- + Performing an osv_memory action button_bought on module auction.lots +- + !python {model: auction.lots}: | + self.button_bought(cr, uid, [ref("auction_lots_woodenchair0")], {"lang": "en_US", "tz": + False, "active_model": "ir.ui.menu", "active_ids": [ref("auction.auction_lots_woodenchair0")], + "active_id": ref("auction.auction_lots_woodenchair0")}) +- + I check that the order which was initially in the draft state has transit to sold state +- + !python {model: auction.lots}: | + from tools.translate import _ + auc_id=self.browse(cr, uid, ref("auction_lots_woodenchair0")) + assert(auc_id.state == 'sold'), _('State not changed!') +- + Performing an osv_memory action button_taken_away on module auction.lots +- + !python {model: auction.lots}: | + self.button_taken_away(cr, uid, [ref("auction_lots_woodenchair0")], {"lang": + "en_US", "tz": False, "active_model": "ir.ui.menu", "active_ids": [ref("auction.auction_all_objects_menu")], + "active_id": ref("auction.auction_all_objects_menu")}) +- + I check that the order which was initially in the draft state has transit to taken away state. +- + !python {model: auction.lots}: | + from tools.translate import _ + auc_id=self.browse(cr, uid, ref("auction_lots_woodenchair0")) + assert(auc_id.state == 'taken_away'), _('State not changed!') +- + I click on the "Close + Create all invoices" button +- + Performing an osv_memory action close on module auction.dates +- + !python {model: auction.dates}: | + self.close(cr, uid, [ref("auction.auction_dates_antiquefurnitureexhibition0")], + {"lang": "en_US", "tz": False, "active_model": "ir.ui.menu", "active_ids": + [ref("auction.menu_auction_dates_next1")], "active_id": ref("auction.menu_auction_dates_next1")}) +- + I check that a record gets created in the "Supplier Invoices" +- + !python {model: auction.lots}: | + from tools.translate import _ + auc_id=self.browse(cr, uid, ref("auction_lots_woodenchair0")) + assert(auc_id.sel_inv_id), _('Seller Invoice has not been created!') diff --git a/addons/auction/test/auction_wizard.yml b/addons/auction/test/auction_wizard.yml new file mode 100644 index 00000000000..9c6eff31913 --- /dev/null +++ b/addons/auction/test/auction_wizard.yml @@ -0,0 +1,297 @@ +- + In order to test the wizards of auction module I create a new record +- + I start the process by creating a new product +- + Creating a product.product record +- + !record {model: product.product, id: product_product_paintings0}: + categ_id: product.cat1 + cost_method: standard + mes_type: fixed + name: Paintings + procure_method: make_to_stock + standard_price: 1.0 + supply_method: buy + type: product + uom_id: product.product_uom_unit + uom_po_id: product.product_uom_unit + volume: 0.0 + warranty: 0.0 + weight: 0.0 + weight_net: 0.0 +- + Creating a new artist +- + Creating a auction.artists record +- + !record {model: auction.artists, id: auction_artists_picasso0}: + birth_death_dates: 1881-1973 + name: Picasso +- + I create a new auction record +- + Creating a auction.dates record +- + !record {model: auction.dates, id: auction_dates_picassospaintingexhibition0}: + acc_expense: account.a_pay + acc_income: account.a_recv + account_analytic_id: account.analytic_root + auction1: '2010-05-24' + auction2: '2010-05-25' + expo1: '2010-05-21' + expo2: '2010-05-22' + journal_id: account.expenses_journal + journal_seller_id: account.sales_journal + name: Picasso's painting exhibition +- + I create a seller's deposit record +- + Creating a auction.deposit record +- + !record {model: auction.deposit, id: auction_deposit_ad1}: + date_dep: '2010-05-18' + method: keep + name: AD/007 + partner_id: base.res_partner_9 +- + I create a bid record +- + Creating a auction.bid record +- + !record {model: auction.bid, id: auction_bid_bid0}: + auction_id: auction_dates_picassospaintingexhibition0 + name: bid/003 + partner_id: base.res_partner_agrolait +- + Creating a auction.bid record +- + !record {model: auction.bid, id: auction_bid_bid1}: + auction_id: auction_dates_picassospaintingexhibition0 + name: bid/004 + partner_id: base.res_partner_3 +- + I create a new object record +- + I create a new auction.lots record +- + Creating a auction.lots record +- + !record {model: auction.lots, id: auction_lots_painting0}: + ach_login: 'Mr.Chang' + artist_id: auction.auction_artists_picasso0 + auction_id: auction_dates_picassospaintingexhibition0 + bid_lines: + - bid_id: auction_bid_bid1 + call: 1 + price: 4000.0 + - bid_id: auction_bid_bid0 + price: 3500.0 + bord_vnd_id: auction_deposit_ad1 + lot_est1: 2000.0 + lot_est2: 4000.0 + lot_num: 2 + name: painting + name2: picasso_painting + obj_num: 2 + obj_price: 3500.0 + obj_ret: 4000.0 + product_id: auction.product_product_paintings0 + state: draft + vnd_lim: 4000.0 +- + I assign the buyer through "Map buyer username to Partners" wizard +- + Creating a auction.lots.buyer_map record +- + !record {model: auction.lots.buyer_map, id: auction_lots_buyer_map_0}: + ach_login: 'Mr.Chang' + ach_uid: base.res_partner_3 +- + Performing an osv_memory action buyer_map_set on module auction.lots.buyer_map +- + !python {model: auction.lots.buyer_map}: | + auc_obj=self.pool.get('auction.lots') + ids=self.browse(cr, uid, ref("auction_lots_painting0")) + self.buyer_map_set(cr, uid, [ref("auction_lots_buyer_map_0")], {"lang": "en_US", + "tz": False, "active_model": "auction.lots", "active_ids": [ref("auction_lots_painting0")], + "active_id": ref("auction_lots_painting0")}) +- + I check that the buyer field gets bind with the value +- + !python {model: auction.lots}: | + from tools.translate import _ + auc_id=self.browse(cr, uid, ref("auction_lots_painting0")) + assert(auc_id.ach_uid), _('Buyer not assigned!') +- + I mark that a seller has been paid by using the "Mark as paid for seller" wizard +- + Creating a auction.payer.sel record +- + !record {model: auction.payer.sel, id: auction_payer_sel_0}: + {} +- + Performing an osv_memory action payer_sel on module auction.payer.sel +- + !python {model: auction.payer.sel}: | + self.payer_sel(cr, uid, [ref("auction_payer_sel_0")], {"lang": "en_US", "tz": + False, "active_model": "auction.lots", "active_ids": [ref("auction_lots_painting0")], "active_id": ref("auction_lots_painting0")}) +- + I check that the Seller paid field is set to True +- + !python {model: auction.lots}: | + from tools.translate import _ + auc_id=self.browse(cr, uid, ref("auction_lots_painting0")) + assert(auc_id.paid_vnd == True), _('Seller paid is not marked!') +- + I use the "Mark as taken away" wizard to indicate that an object is taken away +- + Creating a auction.lots.able record +- + !record {model: auction.lots.able, id: auction_lots_able_0}: + {} +- + Performing an osv_memory action confirm_able on module auction.lots.able +- + !python {model: auction.lots.able}: | + self.confirm_able(cr, uid, [ref("auction_lots_able_0")], {"lang":"en_US", "tz": + False, "active_model": "auction.lots", "active_ids": [ref("auction_lots_painting0")], + "active_id": ref("auction_lots_painting0")}) +- + I check that Taken away field is set to True +- + !python {model: auction.lots}: | + from tools.translate import _ + auc_id=self.browse(cr, uid, ref("auction_lots_painting0")) + assert(auc_id.ach_emp == True), _('Taken away is not marked!') +- + I use the "Unmark as taken away" wizard to unmark the Taken Away field +- + Creating a auction.lots.enable record +- + !record {model: auction.lots.enable, id: auction_lots_enable_0}: + confirm_en: 0.0 +- + Performing an osv_memory action confirm_enable on module auction.lots.enable +- + !python {model: auction.lots.enable}: | + self.confirm_enable(cr, uid, [ref("auction_lots_enable_0")], {"lang": "en_US", + "tz": False, "active_model": "auction.lots", "active_ids": [ref("auction_lots_painting0")], + "active_id": ref("auction_lots_painting0"),}) +- + I check that Taken away field is set to False +- + !python {model: auction.lots}: | + from tools.translate import _ + auc_id=self.browse(cr, uid, ref("auction_lots_painting0")) + assert(auc_id.ach_emp == False), _('Taken away is marked!') +- + + I create statement lines for an object's payment by using the "Pay objects of the buyer" wizard +- + Creating a account.bank.statement record +- + !record {model: account.bank.statement, id: account_bank_statement_st0}: + balance_end_real: 0.0 + date: '2010-05-19' + journal_id: account.bank_journal + name: St. 05/19 + period_id: account.period_5 + state: draft +- + Creating a auction.pay.buy record +- + !record {model: auction.pay.buy, id: auction_pay_buy_0}: + amount: 2000.0 + amount2: 1000.0 + amount3: 1000.0 + buyer_id: base.res_partner_2 + statement_id1: account_bank_statement_st0 + statement_id2: account_bank_statement_st0 + statement_id3: account_bank_statement_st0 + total: 4000.0 +- + Performing an osv_memory action pay_and_reconcile on module auction.pay.buy +- + !python {model: auction.pay.buy}: | + self.pay_and_reconcile(cr, uid, [ref("auction_pay_buy_0")], {"lang": "en_US", "tz": + False, "active_model": "auction.lots", "active_ids": [ref("auction_lots_painting0")], + "active_id": ref("auction_lots_painting0"),}) +- + I check that a record gets created in the 'auction_statement_line_rel' table +- + !python {model: auction.lots}: | + from tools.translate import _ + cr.execute("select statement from auction_statement_line_rel,auction_lots where auction_lots.id=auction_statement_line_rel.auction_id AND auction_lots.name='painting'") + ans=cr.fetchall() + assert ans, _('statement_id not found!') +- + I create the seller's invoice by using the "Invoice Seller objects" wizard +- + Creating a auction.lots.make.invoice record +- + !record {model: auction.lots.make.invoice, id: auction_lots_make_invoice_0}: + amount: 3500.0 + number: 2010/002 + objects: 1 +- + Performing an osv_memory action makeInvoices on module auction.lots.make.invoice +- + !python {model: auction.lots.make.invoice}: | + self.makeInvoices(cr, uid, [ref("auction_lots_make_invoice_0")], {"lang": "en_US", + "active_model": "auction.lots", "active_ids": [ref("auction_lots_painting0")], + "tz": False, "active_id": ref("auction_lots_painting0"),}) +- + I check that a "Seller Invoice" field gets bind with the value +- + !python {model: auction.lots}: | + from tools.translate import _ + auc_id=self.browse(cr, uid, ref("auction_lots_painting0")) + assert(auc_id.sel_inv_id), _('Seller Invoice has not been created!') +- + I create a buyer's invoice by using the "Invoice Buyer objects" wizard +- + Creating a auction.lots.make.invoice.buyer record +- + !record {model: auction.lots.make.invoice.buyer, id: auction_lots_make_invoice_buyer_0}: + amount: 3500.0 + buyer_id: base.res_partner_3 + number: 2010/003 + objects: 1 +- + Performing an osv_memory action makeInvoices on module auction.lots.make.invoice.buyer +- + !python {model: auction.lots.make.invoice.buyer}: | + self.makeInvoices(cr, uid, [ref("auction_lots_make_invoice_buyer_0")], {"lang": + "en_US", "active_model": "auction.lots", "active_ids": [ref("auction_lots_painting0")], + "tz": False, "active_id": ref("auction_lots_painting0"), }) +- + I check that a "Buyer Invoice" field gets bind with the value +- + !python {model: auction.lots}: | + from tools.translate import _ + auc_id=self.browse(cr, uid, ref("auction_lots_painting0")) + assert(auc_id.ach_inv_id), _('Seller Invoice has not been created!') +- + In order to change the auction for an object I use the "Change auction date" wizard +- + Creating a auction.lots.auction.move record +- + !record {model: auction.lots.auction.move, id: auction_lots_auction_move_0}: + auction_id: auction.auction_date_2 +- + Performing an osv_memory action auction_move_set on module auction.lots.auction.move +- + !python {model: auction.lots.auction.move}: | + self.auction_move_set(cr, uid, [ref("auction_lots_auction_move_0")], {"lang": + "en_US", "tz": False, "active_model": "auction.lots", "active_ids": [ref("auction_lots_painting0")], + "active_id": ref("auction_lots_painting0"), }) +- + I check that a record gets created in the auction.lot.history +- + !python {model: auction.lots}: | + from tools.translate import _ + auc_id=self.browse(cr, uid, ref("auction_lots_painting0")) + auc_lot_his=self.pool.get('auction.lot.history') + ids=auc_lot_his.search(cr, uid, [('lot_id', '=', auc_id.id)]) + assert ids, _('Auction history does not exists!') From 6ac363ae0149da9ae401f50c3abeeefdc238815d Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Mon, 24 May 2010 11:00:38 +0530 Subject: [PATCH 007/191] [Fix] point_of_sale: fix the problem of pricelist bzr revid: sbh@tinyerp.com-20100524053038-tkavbvj42x7jgz1b --- addons/point_of_sale/pos.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/addons/point_of_sale/pos.py b/addons/point_of_sale/pos.py index dcc2086eb26..2ad9319e371 100644 --- a/addons/point_of_sale/pos.py +++ b/addons/point_of_sale/pos.py @@ -1086,17 +1086,18 @@ class pos_order_line(osv.osv): raise osv.except_osv(_('No Pricelist !'), _('You have to select a pricelist in the sale form !\n' \ 'Please set one before choosing a product.')) - p_obj = self.pool.get('product.product').browse(cr,uid,product_id).list_price + p_obj = self.pool.get('product.product').browse(cr,uid,[product_id])[0] + uom_id=p_obj.uom_po_id.id price = self.pool.get('product.pricelist').price_get(cr, uid, - [pricelist], product_id, qty or 1.0, partner_id)[pricelist] - # Todo need to check -# if price is False: -# raise osv.except_osv(_('No valid pricelist line found !'), -# _("Couldn't find a pricelist line matching this product" \ -# " and quantity.\nYou have to change either the product," \ -# " the quantity or the pricelist.")) - return price or p_obj - + [pricelist], product_id, qty or 1.0, partner_id,{'uom': uom_id})[pricelist] + + if price is False: + raise osv.except_osv(_('No valid pricelist line found !'), + _("Couldn't find a pricelist line matching this product" \ + " and quantity.\nYou have to change either the product," \ + " the quantity or the pricelist.")) + return price + def onchange_product_id(self, cr, uid, ids, pricelist, product_id, qty=0, partner_id=False): price = self.price_by_product(cr, uid, ids, pricelist, product_id, qty, partner_id) self.write(cr,uid,ids,{'price_unit':price}) From f59249fd8a5debe3cfed70913bdd8bf2302ccdcc Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Mon, 24 May 2010 12:40:03 +0530 Subject: [PATCH 008/191] [IMP]:point_of_sale:small changed in pricelist bzr revid: sbh@tinyerp.com-20100524071003-345hzzt2e61mvrh4 --- addons/point_of_sale/pos.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/pos.py b/addons/point_of_sale/pos.py index 2ad9319e371..c559f99c4ff 100644 --- a/addons/point_of_sale/pos.py +++ b/addons/point_of_sale/pos.py @@ -1090,7 +1090,7 @@ class pos_order_line(osv.osv): uom_id=p_obj.uom_po_id.id price = self.pool.get('product.pricelist').price_get(cr, uid, [pricelist], product_id, qty or 1.0, partner_id,{'uom': uom_id})[pricelist] - + price=price or p_obj.list_price if price is False: raise osv.except_osv(_('No valid pricelist line found !'), _("Couldn't find a pricelist line matching this product" \ From ccd6981b369e60c554a63a80cd399043f722c296 Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Mon, 24 May 2010 12:46:41 +0530 Subject: [PATCH 009/191] [Fix] point_of_sale:Fix the name of picking bzr revid: sbh@tinyerp.com-20100524071641-81do5dwrhnnzq95e --- addons/point_of_sale/pos.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/point_of_sale/pos.py b/addons/point_of_sale/pos.py index c559f99c4ff..c5845afb984 100644 --- a/addons/point_of_sale/pos.py +++ b/addons/point_of_sale/pos.py @@ -463,12 +463,13 @@ class pos_order(osv.osv): """Create a picking for each order and validate it.""" picking_obj = self.pool.get('stock.picking') - + pick_name=self.pool.get('ir.sequence').get(cr, uid, 'stock.picking.out') orders = self.browse(cr, uid, ids, context) for order in orders: if not order.picking_id: new = True picking_id = picking_obj.create(cr, uid, { + 'name':pick_name, 'origin': order.name, 'type': 'out', 'state': 'draft', From 196972157a654519bffebb5ea5059f89fbc9476a Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Mon, 24 May 2010 13:17:07 +0530 Subject: [PATCH 010/191] [Fix] point_of_sale:Fix the problem of stock_move bzr revid: sbh@tinyerp.com-20100524074707-1hb2so5bea1aatto --- addons/point_of_sale/pos.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/point_of_sale/pos.py b/addons/point_of_sale/pos.py index c5845afb984..97b5085139f 100644 --- a/addons/point_of_sale/pos.py +++ b/addons/point_of_sale/pos.py @@ -505,7 +505,7 @@ class pos_order(osv.osv): if line.qty < 0: location_id, stock_dest_id = stock_dest_id, location_id - self.pool.get('stock.move').create(cr, uid, { + self.pool.get('stock.move').create(cr, uid, { 'name': 'Stock move (POS %d)' % (order.id, ), 'product_uom': line.product_id.uom_id.id, 'product_uos': line.product_id.uom_id.id, From bb793483f03be0bada99d18c265f463b618736d5 Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Mon, 24 May 2010 13:32:24 +0530 Subject: [PATCH 011/191] [IMP] point_of_sale:small change price name bzr revid: sbh@tinyerp.com-20100524080224-4n3s0twr0j5ur07l --- addons/point_of_sale/pos.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/point_of_sale/pos.py b/addons/point_of_sale/pos.py index 97b5085139f..597be8eaea7 100644 --- a/addons/point_of_sale/pos.py +++ b/addons/point_of_sale/pos.py @@ -1091,13 +1091,13 @@ class pos_order_line(osv.osv): uom_id=p_obj.uom_po_id.id price = self.pool.get('product.pricelist').price_get(cr, uid, [pricelist], product_id, qty or 1.0, partner_id,{'uom': uom_id})[pricelist] - price=price or p_obj.list_price - if price is False: + unit_price=price or p_obj.list_price + if unit_price is False: raise osv.except_osv(_('No valid pricelist line found !'), _("Couldn't find a pricelist line matching this product" \ " and quantity.\nYou have to change either the product," \ " the quantity or the pricelist.")) - return price + return unit_price def onchange_product_id(self, cr, uid, ids, pricelist, product_id, qty=0, partner_id=False): price = self.price_by_product(cr, uid, ids, pricelist, product_id, qty, partner_id) From dae3f0f3491aa6cd91ecd880ed808e5a6faafcbe Mon Sep 17 00:00:00 2001 From: "uco (OpenERP)" Date: Mon, 24 May 2010 14:49:56 +0530 Subject: [PATCH 012/191] [IMP] mrp: Task id_583: Set bom_lines visible/invisible according to multi_level_bom field. bzr revid: uco@tinyerp.com-20100524091956-t617a5yb1o0bz3fi --- addons/mrp/mrp.py | 18 +++++++++++++++++ addons/mrp/mrp_view.xml | 44 +++++++++++++++++++++-------------------- 2 files changed, 41 insertions(+), 21 deletions(-) diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index 966572f772c..b3ced960cbe 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -248,6 +248,24 @@ class mrp_bom(osv.osv): return {'value': v} return {} + def onchange_multi_level_bom(self, cr, uid, ids, multi_level_bom, context={}): + """ Changes UoM and name if product_id changes. + @param name: Name of the field + @param product_id: Changed product_id + @return: Dictionary of changed values + """ + value = {} + bom_ids = ids and ids[0] + bom = self.browse(cr, uid, bom_ids) + line_ids = bom and map(lambda x:x.id, bom.bom_lines) + value['bom_lines'] = line_ids + if multi_level_bom: + self.write(cr, uid, line_ids, {'multi_level_bom': multi_level_bom}) + return {'value': value} + else: + self.write(cr, uid, line_ids, {'multi_level_bom': multi_level_bom}) + return {'value': {}} + def _bom_find(self, cr, uid, product_id, product_uom, properties=[]): """ Finds BoM for particular product and product uom. @param product_id: Selected product. diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml index 02841b64b03..581330ae655 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -254,30 +254,32 @@ - + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + From f9625c9cf3ff1d24d71017c9ee6f0c1dd992e98d Mon Sep 17 00:00:00 2001 From: "mso (Open ERP)" <> Date: Mon, 24 May 2010 15:02:50 +0530 Subject: [PATCH 013/191] [FIX] stock: Sequence name corrected for Picking. bzr revid: uco@tinyerp.com-20100524093250-llauvx4e78pbq5te --- addons/stock/stock.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 27930c8a3e7..65115cf646f 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -470,7 +470,8 @@ class stock_picking(osv.osv): def create(self, cr, user, vals, context=None): if ('name' not in vals) or (vals.get('name')=='/'): - vals['name'] = self.pool.get('ir.sequence').get(cr, user, 'stock.picking') + seq_obj_name = 'stock.picking.' + vals['type'] + vals['name'] = self.pool.get('ir.sequence').get(cr, user, seq_obj_name) type_list = { 'out':_('Packing List'), 'in':_('Reception'), From 5874fe8f3e3e039c754be6de88848ff093b62f1d Mon Sep 17 00:00:00 2001 From: "uco (OpenERP)" Date: Mon, 24 May 2010 15:33:39 +0530 Subject: [PATCH 014/191] [IMP] mrp: Task id_583: Code optimization. bzr revid: uco@tinyerp.com-20100524100339-pt75qnz9lbtianfd --- addons/mrp/mrp.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index b3ced960cbe..b62331481a4 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -254,14 +254,12 @@ class mrp_bom(osv.osv): @param product_id: Changed product_id @return: Dictionary of changed values """ - value = {} bom_ids = ids and ids[0] bom = self.browse(cr, uid, bom_ids) line_ids = bom and map(lambda x:x.id, bom.bom_lines) - value['bom_lines'] = line_ids if multi_level_bom: self.write(cr, uid, line_ids, {'multi_level_bom': multi_level_bom}) - return {'value': value} + return {'value': {'bom_lines': line_ids}} else: self.write(cr, uid, line_ids, {'multi_level_bom': multi_level_bom}) return {'value': {}} From e9a8f9a1f96374f0c9e7751350f096e14a96314f Mon Sep 17 00:00:00 2001 From: mso Date: Mon, 24 May 2010 15:34:48 +0530 Subject: [PATCH 015/191] [FIX] purchase: changes in the yml. bzr revid: mso@mso-20100524100448-m47jgo0kxdgx8ep3 --- addons/purchase/test/purchase_from_manual.yml | 46 +++++++---------- addons/purchase/test/purchase_from_order.yml | 48 +++++++----------- .../purchase/test/purchase_from_picking.yml | 50 ++++++++----------- 3 files changed, 57 insertions(+), 87 deletions(-) diff --git a/addons/purchase/test/purchase_from_manual.yml b/addons/purchase/test/purchase_from_manual.yml index e0b1a8b806c..c3d8cf35d02 100644 --- a/addons/purchase/test/purchase_from_manual.yml +++ b/addons/purchase/test/purchase_from_manual.yml @@ -1,5 +1,5 @@ - - In order to test the purchase flow,I start by creating a new product 'iPod' + In order to test the purchase flow,I start by creating a new product 'iPod' - !record {model: product.product, id: product_product_ipod0}: categ_id: 'product.product_category_3' @@ -22,9 +22,9 @@ weight: 0.0 weight_net: 0.0 - - In order to test the purchase flow,I create a new record where "invoice_method" is From Manual + In order to test the purchase flow,I create a new record where "invoice_method" is From Manual - - Creating an purchase.order record + I create purchase order for iPod. - !record {model: purchase.order, id: purchase_order_po1}: company_id: base.main_company @@ -44,26 +44,21 @@ partner_id: base.res_partner_4 pricelist_id: purchase.list0 - - Initially purchase order is in the draft state + Initially purchase order is in the draft state - !assert {model: purchase.order, id: purchase_order_po1}: - state == 'draft' - - Then an order is confirmed by clicking on the "Confirm Purchase Order" button -- - !python {model: purchase.order}: | - self.wkf_confirm_order(cr, uid, [ref("purchase_order_po1")]) -- - Performing a workflow action purchase_confirm on module purchase.order + I confirm the purchase order. - !workflow {model: purchase.order, action: purchase_confirm, ref: purchase_order_po1} - - I check that the order which was initially in the draft state has transit to confirm state. + I check that the order which was initially in the draft state has transit to confirm state. - !assert {model: purchase.order, id: purchase_order_po1}: - state == 'confirmed' - - I check that an entry gets created in the "Lines to Invoice" of Invoice Control on the basis of purchase order line + I check that an entry gets created in the "Lines to Invoice" of Invoice Control on the basis of purchase order line - !python {model: purchase.order}: | from tools.translate import _ @@ -72,14 +67,14 @@ search_ids=pur_line.search(cr, uid, [('order_id', '=', pur_order_obj.name) ]) assert search_ids, _('Purchase order line is not created!') - - To check that wizard "Create Invoices" gets opened + To check that wizard "Create Invoices" gets opened - - Creating a purchase.order.line_invoice record + I create purchase order line invoice entry. - !record {model: purchase.order.line_invoice, id: purchase_order_line_invoice_0}: {} - - Performing an osv_memory action makeInvoices on module purchase.order.line_invoice + I create invoice for products in the purchase order. - !python {model: purchase.order.line_invoice}: | pur_obj=self.pool.get('purchase.order') @@ -89,7 +84,7 @@ ids.append(line.id) self.makeInvoices(cr, uid, [1], context={'active_ids': ids}) - - I check that invoice gets created + I check that invoice gets created. - !python {model: purchase.order}: | from tools.translate import _ @@ -98,7 +93,7 @@ search_ids=pur_line.search(cr, uid, [('order_id', '=', pur_order_obj.name),('invoiced', '=', '1') ]) assert search_ids, _('Invoice is not created!') - - I check that a record gets created in the Pending Invoices + I check that a record gets created in the Pending Invoices. - !python {model: purchase.order}: | from tools.translate import _ @@ -107,33 +102,28 @@ ids = account_obj.search(cr, uid, [('origin', '=', pur_id1.name)]) assert ids, _('Pending Invoice is not created!') - - Then an order is approved by clicking on the "Approved by Supplier" button -- - !python {model: purchase.order}: | - self.wkf_approve_order(cr, uid, [ref("purchase_order_po1")]) -- - Performing a workflow action purchase_approve on module purchase.order + Supplier approve the purchase order. - !workflow {model: purchase.order, action: purchase_approve, ref: purchase_order_po1} - - I check that the order which was initially in the confirmed state has transit to approved state. + I check that the order which was initially in the confirmed state has transit to approved state. - !assert {model: purchase.order, id: purchase_order_po1}: - state == 'approved' - - I check that date_approve field of Delivery&Invoices gets bind with the date on which it has been approved + I check that date_approve field of Delivery&Invoices gets bind with the date on which it has been approved. - !python {model: purchase.order}: | pur_id=self.browse(cr, uid, ref("purchase_order_po1")) assert(pur_id.date_approve) - - I check that an entry gets created in the stock.picking + I check that an entry gets created in the stock pickings. - !python {model: purchase.order}: | pur_id=self.browse(cr, uid, ref("purchase_order_po1")) assert(pur_id.picking_ids) - - I check that an entry gets created in the stock.move + I check that an entry gets created in the stock moves. - !python {model: purchase.order}: | from tools.translate import _ @@ -145,4 +135,4 @@ search_id = move_obj.search(cr, uid, [('picking_id', '=', pick_id.name)]) assert search_id, _('No Incoming Product!') - - I check that Traceability moves are created + I check that Traceability moves are created. diff --git a/addons/purchase/test/purchase_from_order.yml b/addons/purchase/test/purchase_from_order.yml index 3e83fc7dfda..a13c687c4a5 100644 --- a/addons/purchase/test/purchase_from_order.yml +++ b/addons/purchase/test/purchase_from_order.yml @@ -1,5 +1,5 @@ - - In order to test the purchase flow,I start by creating a new product 'iPod' + In order to test the purchase flow,I start by creating a new product 'iPod' - !record {model: product.product, id: product_product_ipod0}: categ_id: 'product.product_category_3' @@ -22,9 +22,9 @@ weight: 0.0 weight_net: 0.0 - - In order to test the purchase flow,I create a new record where "invoice_method" is From Order + In order to test the purchase flow,I create a new record where "invoice_method" is From Order. - - Creating a purchase.order record + I create purchase order for iPod. - !record {model: purchase.order, id: purchase_order_po0}: company_id: base.main_company @@ -44,26 +44,21 @@ partner_id: base.res_partner_4 pricelist_id: purchase.list0 - - Initially purchase order is in the draft state + Initially purchase order is in the draft state. - !assert {model: purchase.order, id: purchase_order_po0}: - state == 'draft' - - Then an order is confirmed by clicking on the "Confirm Purchase Order" button -- - !python {model: purchase.order}: | - self.wkf_confirm_order(cr, uid, [ref("purchase_order_po0")]) -- - Performing a workflow action purchase_confirm on module purchase.order + I confirm the purchase order for iPod. - !workflow {model: purchase.order, action: purchase_confirm, ref: purchase_order_po0} - - I check that the order which was initially in the draft state has transit to confirm state. + I check that the order which was initially in the draft state has transit to confirm state. - !assert {model: purchase.order, id: purchase_order_po0}: - state == 'confirmed' - - I check that an entry gets created in the "Lines to Invoice" of Invoice Control on the basis of purchase order line + I check that an entry gets created in the "Lines to Invoice" of Invoice Control on the basis of purchase order line. - !python {model: purchase.order}: | from tools.translate import _ @@ -72,14 +67,14 @@ search_ids=pur_line.search(cr, uid, [('order_id', '=', pur_order_obj.name) ]) assert search_ids, _('Purchase order line is not created!') - - To check that wizard "Create Invoices" gets called + To check that wizard "Create Invoices" gets called. - - Creating a purchase.order.line_invoice record + I create purchase order line invoice entry. - !record {model: purchase.order.line_invoice, id: purchase_order_line_invoice_0}: {} - - Performing an osv_memory action makeInvoices on module purchase.order.line_invoice + I create invoice for products in the purchase order. - !python {model: purchase.order.line_invoice}: | pur_obj=self.pool.get('purchase.order') @@ -89,7 +84,7 @@ ids.append(line.id) self.makeInvoices(cr, uid, [1], context={'active_ids': ids}) - - I check that invoice gets created + I check that invoice gets created. - !python {model: purchase.order}: | from tools.translate import _ @@ -98,7 +93,7 @@ search_ids=pur_line.search(cr, uid, [('order_id', '=', pur_order_obj.name),('invoiced', '=', '1') ]) assert search_ids, _('Invoice is not created!') - - I check that a record gets created in the Pending Invoices + I check that a record gets created in the Pending Invoices. - !python {model: purchase.order}: | from tools.translate import _ @@ -107,33 +102,28 @@ ids = account_obj.search(cr, uid, [('origin', '=', pur_id1.name)]) assert ids, _('Pending Invoice is not created!') - - Then an order is approved by clicking on the "Approved by Supplier" button -- - !python {model: purchase.order}: | - self.wkf_approve_order(cr, uid, [ref("purchase_order_po0")]) -- - Performing a workflow action purchase_approve on module purchase.order + Supplier approve the purchase order. - !workflow {model: purchase.order, action: purchase_approve, ref: purchase_order_po0} - - I check that the order which was initially in the confirmed state has transit to approved state. + I check that the order which was initially in the confirmed state has transit to approved state. - !assert {model: purchase.order, id: purchase_order_po0}: - state == 'approved' - - I check that date_approve field of Delivery&Invoices gets bind with the date on which it has been approved + I check that date_approve field of Delivery&Invoices gets bind with the date on which it has been approved. - !python {model: purchase.order}: | pur_id=self.browse(cr, uid, ref("purchase_order_po0")) assert(pur_id.date_approve) - - I check that an entry gets created in the stock.picking + I check that an entry gets created in the pickings. - !python {model: purchase.order}: | pur_id=self.browse(cr, uid, ref("purchase_order_po0")) assert(pur_id.picking_ids) - - I check that an entry gets created in the stock.move + I check that an entry gets created in the stock moves. - !python {model: purchase.order}: | from tools.translate import _ @@ -145,9 +135,9 @@ search_id = move_obj.search(cr, uid, [('picking_id', '=', pick_id.name)]) assert search_id, _('No Incoming Product!') - - I check that Traceability moves are created + I check that Traceability moves are created. - - I check that an invoice_id field of Delivery&Invoices gets bind with the value + I check that an invoice_id field of Delivery&Invoices gets bind with the value. - !python {model: purchase.order}: | pur_id2=self.browse(cr, uid, ref("purchase_order_po0")) diff --git a/addons/purchase/test/purchase_from_picking.yml b/addons/purchase/test/purchase_from_picking.yml index f4e9628985d..6250772a872 100644 --- a/addons/purchase/test/purchase_from_picking.yml +++ b/addons/purchase/test/purchase_from_picking.yml @@ -1,5 +1,5 @@ - - In order to test the purchase flow,I start by creating a new product 'iPod' + In order to test the purchase flow,I start by creating a new product 'iPod' - !record {model: product.product, id: product_product_ipod0}: categ_id: 'product.product_category_3' @@ -22,9 +22,9 @@ weight: 0.0 weight_net: 0.0 - - In order to test the purchase flow,I create a new record where "invoice_method" is From Picking + In order to test the purchase flow,I create a new record where "invoice_method" is From Picking - - Creating an purchase.order record + I create purchase order for iPod. - !record {model: purchase.order, id: purchase_order_po2}: company_id: base.main_company @@ -44,17 +44,12 @@ partner_id: base.res_partner_4 pricelist_id: purchase.list0 - - Initially purchase order is in the draft state + Initially purchase order is in the draft state. - !assert {model: purchase.order, id: purchase_order_po2}: - state == 'draft' - - Then an order is confirmed by clicking on the "Confirm Purchase Order" button -- - !python {model: purchase.order}: | - self.wkf_confirm_order(cr, uid, [ref("purchase_order_po2")]) -- - Performing a workflow action purchase_confirm on module purchase.order + I confirm the purchase order for iPod. - !workflow {model: purchase.order, action: purchase_confirm, ref: purchase_order_po2} - @@ -63,7 +58,7 @@ !assert {model: purchase.order, id: purchase_order_po2}: - state == 'confirmed' - - I check that an entry gets created in the "Lines to Invoice" of Invoice Control on the basis of purchase order line + I check that an entry gets created in the "Lines to Invoice" of Invoice Control on the basis of purchase order line. - !python {model: purchase.order}: | from tools.translate import _ @@ -72,14 +67,14 @@ search_ids=pur_line.search(cr, uid, [('order_id', '=', pur_order_obj.name) ]) assert search_ids, _('Purchase order line is not created!') - - To check that wizard "Create Invoices" gets opened + To check that wizard "Create Invoices" gets opened. - - Creating a purchase.order.line_invoice record + I create purchase order line invoice entry. - !record {model: purchase.order.line_invoice, id: purchase_order_line_invoice_0}: {} - - Performing an osv_memory action makeInvoices on module purchase.order.line_invoice + I create invoice for products in the purchase order. - !python {model: purchase.order.line_invoice}: | pur_obj=self.pool.get('purchase.order') @@ -89,7 +84,7 @@ ids.append(line.id) self.makeInvoices(cr, uid, [1], context={'active_ids': ids}) - - I check that invoice gets created + I check that invoice gets created. - !python {model: purchase.order}: | from tools.translate import _ @@ -98,7 +93,7 @@ search_ids=pur_line.search(cr, uid, [('order_id', '=', pur_order_obj.name),('invoiced', '=', '1') ]) assert search_ids, _('Invoice is not created!') - - I check that a record gets created in the Pending Invoices + I check that a record gets created in the Pending Invoices. - !python {model: purchase.order}: | from tools.translate import _ @@ -107,12 +102,7 @@ ids = account_obj.search(cr, uid, [('origin', '=', pur_id1.name)]) assert ids, _('Pending Invoice is not created!') - - Then an order is approved by clicking on the "Approved by Supplier" button -- - !python {model: purchase.order}: | - self.wkf_approve_order(cr, uid, [ref("purchase_order_po2")]) -- - Performing a workflow action purchase_approve on module purchase.order + Supplier approve the purchase order. - !workflow {model: purchase.order, action: purchase_approve, ref: purchase_order_po2} - @@ -121,19 +111,19 @@ !assert {model: purchase.order, id: purchase_order_po2}: - state == 'approved' - - I check that date_approve field of Delivery&Invoices gets bind with the date on which it has been approved + I check that date_approve field of Delivery&Invoices gets bind with the date on which it has been approved. - !python {model: purchase.order}: | pur_id=self.browse(cr, uid, ref("purchase_order_po2")) assert(pur_id.date_approve) - - I check that an entry gets created in the stock.picking + I check that an entry gets created in the stock.picking. - !python {model: purchase.order}: | pur_id=self.browse(cr, uid, ref("purchase_order_po2")) assert(pur_id.picking_ids) - - I check that an entry gets created in the stock.move + I check that an entry gets created related to stock move. - !python {model: purchase.order}: | from tools.translate import _ @@ -145,18 +135,18 @@ search_id = move_obj.search(cr, uid, [('picking_id', '=', pick_id.name)]) assert search_id, _('No Incoming Product!') - - I check that Traceability moves are created + I check that Traceability moves are created. - - Then I create an invoice from picking by clicking on "Create Invoice" wizard + Then I create an invoice from picking by clicking on "Create Invoice" wizard - - Creating a stock.invoice.onshipping record + I create stock invoice on shipping entry. - !record {model: stock.invoice.onshipping, id: stock_invoice_onshipping_0}: invoice_date: '2010-05-11' journal_id: account.bank_journal type: in_invoice - - Performing an osv_memory action create_invoice on module stock.invoice.onshipping + I create Invoice. - !python {model: stock.invoice.onshipping}: | pur_obj=self.pool.get('purchase.order') @@ -167,7 +157,7 @@ "tz": False, "search_default_approved": 1, "active_model": "stock.picking", "active_ids": ids, "active_id": ids[0], }) - - I check that an invoice_id field of Delivery&Invoices gets bind with the value + I check that an invoice_id field of Delivery&Invoices gets bind with the value. - !python {model: purchase.order}: | pur_id2=self.browse(cr, uid, ref("purchase_order_po2")) From af6cba75655a4040b9d32e29cded2cee09c1c65f Mon Sep 17 00:00:00 2001 From: "uco (OpenERP)" Date: Mon, 24 May 2010 15:46:03 +0530 Subject: [PATCH 016/191] [IMP] mrp: Task id_583: Change docstring for method. bzr revid: uco@tinyerp.com-20100524101603-kg8k9hvrcvydz5oa --- addons/mrp/mrp.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index b62331481a4..0234ee1c651 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -249,9 +249,8 @@ class mrp_bom(osv.osv): return {} def onchange_multi_level_bom(self, cr, uid, ids, multi_level_bom, context={}): - """ Changes UoM and name if product_id changes. - @param name: Name of the field - @param product_id: Changed product_id + """ Changes multi_level_bom. + @param multi_level_bom: Changed multi_level_bom @return: Dictionary of changed values """ bom_ids = ids and ids[0] From f6cf33d423cab991b69d30b7443c7602a55749bc Mon Sep 17 00:00:00 2001 From: "uco (OpenERP)" Date: Mon, 24 May 2010 16:00:10 +0530 Subject: [PATCH 017/191] [IMP] stock: 'type' needed for generating Picking sequence. bzr revid: uco@tinyerp.com-20100524103010-txwn3zbhi1hv14cb --- addons/stock/stock_view.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index 5cb543b748e..753f3e17433 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -762,6 +762,7 @@ + @@ -942,6 +943,7 @@ + From ad5a4682f47ec4c318a22116ed4df3644d35aad1 Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Tue, 25 May 2010 10:13:50 +0530 Subject: [PATCH 018/191] [IMP] product :Improve the view of product varaint bzr revid: sbh@tinyerp.com-20100525044350-uxsp3uqm8u23e4dj --- addons/product/product_view.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml index 9bfcb33b050..fefdbe2ce88 100644 --- a/addons/product/product_view.xml +++ b/addons/product/product_view.xml @@ -465,8 +465,7 @@ form
- - + From 5bb61aa3629edf903e44ec53970cbe3f1f4726ab Mon Sep 17 00:00:00 2001 From: mtr Date: Tue, 25 May 2010 11:23:19 +0530 Subject: [PATCH 019/191] [IMP] auction: Improved yaml for auction bzr revid: mtr@mtr-20100525055319-z7joubxi1r6nge66 --- addons/auction/test/auction.yml | 91 ++++++++++++-------------- addons/auction/test/auction_wizard.yml | 75 ++++----------------- 2 files changed, 55 insertions(+), 111 deletions(-) diff --git a/addons/auction/test/auction.yml b/addons/auction/test/auction.yml index febcae2b3f3..0e895078c3a 100644 --- a/addons/auction/test/auction.yml +++ b/addons/auction/test/auction.yml @@ -1,7 +1,7 @@ - In order to test the auction module in the Open-ERP I start the process by creating a product - - Creating a product.product record + I create a new product furniture - !record {model: product.product, id: product_product_furniture0}: categ_id: product.cat1 @@ -19,20 +19,14 @@ weight: 0.0 weight_net: 0.0 - - Creating a new artist + I create a new artist for an object - - Creating a auction.artists record -- !record {model: auction.artists, id: auction_artists_vincentvangogh0}: birth_death_dates: 1853-1900 name: Vincent van Gogh - - Now I want to associate an object with the auction so for that I create an auction record + Now I want to associate an object with the auction so for that I create an auction "Antique furniture exhibition" - - I create a new auction record -- - Creating a auction.dates record -- !record {model: auction.dates, id: auction_dates_antiquefurnitureexhibition0}: acc_expense: account.a_pay acc_income: account.a_recv @@ -45,9 +39,7 @@ journal_seller_id: account.sales_journal name: Antique furniture exhibition - - I create a seller's deposit record -- - Creating a auction.deposit record + An object is being deposited for an auction,I create a seller's deposit record - !record {model: auction.deposit, id: auction_deposit_ad0}: date_dep: '2010-05-18' @@ -55,37 +47,12 @@ name: AD/006 partner_id: base.res_partner_4 - - I create a bid record -- - Creating a auction.bid record -- - !record {model: auction.bid, id: auction_bid_bid0}: - auction_id: auction_dates_antiquefurnitureexhibition0 - contact_tel: (+32)2 211 34 83 - name: bid/004 - partner_id: auction.partner_record1 -- - Creating a auction.bid record -- - !record {model: auction.bid, id: auction_bid_bid1}: - auction_id: auction_dates_antiquefurnitureexhibition0 - name: bid/005 - partner_id: base.res_partner_2 -- - I create a new object record -- - Creating a auction.lots record + I create a new object wooden-chair which is to be auctioned - !record {model: auction.lots, id: auction_lots_woodenchair0}: ach_uid: base.res_partner_2 artist_id: auction_artists_vincentvangogh0 auction_id: auction_dates_antiquefurnitureexhibition0 - bid_lines: - - bid_id: auction_bid_bid1 - call: 1 - price: 5000.0 - - bid_id: auction_bid_bid0 - price: 4500.0 bord_vnd_id: auction_deposit_ad0 lot_est1: 3000.0 lot_est2: 5000.0 @@ -98,6 +65,34 @@ product_id: 'product_product_furniture0' state: draft vnd_lim: 5000.0 +- + I create a bid for an object "wooden-chair" which is to be auctioned in Antique furniture exhibition +- + !record {model: auction.bid, id: auction_bid_bid0}: + auction_id: auction_dates_antiquefurnitureexhibition0 + contact_tel: (+32)2 211 34 83 + name: bid/001 + partner_id: auction.partner_record1 +- + !record {model: auction.bid_line, id: auction_bid_line_0}: + auction: Antique furniture exhibition + bid_id: auction_bid_bid0 + lot_id: auction.auction_lots_woodenchair0 + price: 3500.0 +- + I create another bid for an object "wooden-chair" bided by a different partner +- + !record {model: auction.bid, id: auction_bid_bid1}: + auction_id: auction_dates_antiquefurnitureexhibition0 + name: bid/002 + partner_id: base.res_partner_2 +- + !record {model: auction.bid_line, id: auction_bid_line_1}: + auction: Antique furniture exhibition + bid_id: 'auction_bid_bid1' + call: 1 + lot_id: auction.auction_lots_woodenchair0 + price: 4000.0 - I check that buyer price and seller price gets bind with the value - @@ -106,7 +101,7 @@ auc_id=self.browse(cr, uid, ref("auction_lots_woodenchair0")) assert(auc_id.buyer_price,auc_id.seller_price), _('Buyer price and seller price are not available!') - - I check that a record gets created in the report.seller.auction object + I check that a record gets created in the Seller's Summary - !python {model: auction.lots}: | from tools.translate import _ @@ -116,7 +111,7 @@ ids =rep_sell_obj.search(cr, uid, [('auction', '=', auc_id.auction_id.id),('seller', '=',auc_id.bord_vnd_id.partner_id.id)]) assert ids, _('No record found!') - - I check that a record gets created in the report.seller.auction2 object + I check that a record gets created in the Seller's Revenues - !python {model: auction.lots}: | from tools.translate import _ @@ -126,7 +121,7 @@ ids =rep_sell_obj.search(cr, uid, [('auction', '=', auc_id.auction_id.id),('seller', '=',auc_id.bord_vnd_id.partner_id.id)]) assert ids, _('No record found!') - - I check that a record gets created in the report.buyer.auction object + I check that a record gets created in the Buyer's Summary - !python {model: auction.lots}: | from tools.translate import _ @@ -135,7 +130,7 @@ ids1=rep_buy_obj1.search(cr, uid, [('auction', '=', auc_id1.auction_id.id),('buyer', '=',auc_id1.ach_uid.id)]) assert ids1, _('No record found!') - - I check that a record gets created in the report.buyer.auction2 object + I check that a record gets created in the Buyer's Revenue - !python {model: auction.lots}: | from tools.translate import _ @@ -144,7 +139,7 @@ ids1=rep_buy_obj1.search(cr, uid, [('auction', '=', auc_id1.auction_id.id),('buyer', '=',auc_id1.ach_uid.id)]) assert ids1, _('No record found!') - - I check that a record gets created in the report.auction.view object + I check that a record gets created in the Auction's Summary - !python {model: auction.lots}: | from tools.translate import _ @@ -153,7 +148,7 @@ ids2=rep_auc_obj1.search(cr, uid, [('auction_id', '=', auc_id2.auction_id.id)]) assert ids2, _('No record found!') - - I check that a record gets created in the report.auction.view2 object + I check that a record gets created in the Auction's Revenues - !python {model: auction.lots}: | from tools.translate import _ @@ -162,7 +157,7 @@ ids3=rep_auc_obj1.search(cr, uid, [('auction', '=', auc_id3.auction_id.id)]) assert ids3, _('No record found!') - - Performing an osv_memory action button_bought on module auction.lots + An object has been sold,so I click on the "Sold" button - !python {model: auction.lots}: | self.button_bought(cr, uid, [ref("auction_lots_woodenchair0")], {"lang": "en_US", "tz": @@ -176,14 +171,14 @@ auc_id=self.browse(cr, uid, ref("auction_lots_woodenchair0")) assert(auc_id.state == 'sold'), _('State not changed!') - - Performing an osv_memory action button_taken_away on module auction.lots + Then I click on the Taken Away button - !python {model: auction.lots}: | self.button_taken_away(cr, uid, [ref("auction_lots_woodenchair0")], {"lang": "en_US", "tz": False, "active_model": "ir.ui.menu", "active_ids": [ref("auction.auction_all_objects_menu")], "active_id": ref("auction.auction_all_objects_menu")}) - - I check that the order which was initially in the draft state has transit to taken away state. + I check that the order which was initially in the sold state has transit to taken away state. - !python {model: auction.lots}: | from tools.translate import _ @@ -191,8 +186,6 @@ assert(auc_id.state == 'taken_away'), _('State not changed!') - I click on the "Close + Create all invoices" button -- - Performing an osv_memory action close on module auction.dates - !python {model: auction.dates}: | self.close(cr, uid, [ref("auction.auction_dates_antiquefurnitureexhibition0")], diff --git a/addons/auction/test/auction_wizard.yml b/addons/auction/test/auction_wizard.yml index 9c6eff31913..f21fccb7f34 100644 --- a/addons/auction/test/auction_wizard.yml +++ b/addons/auction/test/auction_wizard.yml @@ -1,9 +1,7 @@ - In order to test the wizards of auction module I create a new record - - I start the process by creating a new product -- - Creating a product.product record + I start the process by creating a new product Paintings - !record {model: product.product, id: product_product_paintings0}: categ_id: product.cat1 @@ -21,18 +19,14 @@ weight: 0.0 weight_net: 0.0 - - Creating a new artist + I create a new artist-Picasso's record - - Creating a auction.artists record -- !record {model: auction.artists, id: auction_artists_picasso0}: birth_death_dates: 1881-1973 name: Picasso - - I create a new auction record + Now I want to associate an object with the auction so for that I create an auction "Picasso's painting exhibition" - - Creating a auction.dates record -- !record {model: auction.dates, id: auction_dates_picassospaintingexhibition0}: acc_expense: account.a_pay acc_income: account.a_recv @@ -45,9 +39,7 @@ journal_seller_id: account.sales_journal name: Picasso's painting exhibition - - I create a seller's deposit record -- - Creating a auction.deposit record + An object is being deposited for an auction,I create a seller's deposit record - !record {model: auction.deposit, id: auction_deposit_ad1}: date_dep: '2010-05-18' @@ -55,38 +47,12 @@ name: AD/007 partner_id: base.res_partner_9 - - I create a bid record -- - Creating a auction.bid record -- - !record {model: auction.bid, id: auction_bid_bid0}: - auction_id: auction_dates_picassospaintingexhibition0 - name: bid/003 - partner_id: base.res_partner_agrolait -- - Creating a auction.bid record -- - !record {model: auction.bid, id: auction_bid_bid1}: - auction_id: auction_dates_picassospaintingexhibition0 - name: bid/004 - partner_id: base.res_partner_3 -- - I create a new object record -- - I create a new auction.lots record -- - Creating a auction.lots record + I create a new object painting which is to be auctioned - !record {model: auction.lots, id: auction_lots_painting0}: ach_login: 'Mr.Chang' artist_id: auction.auction_artists_picasso0 auction_id: auction_dates_picassospaintingexhibition0 - bid_lines: - - bid_id: auction_bid_bid1 - call: 1 - price: 4000.0 - - bid_id: auction_bid_bid0 - price: 3500.0 bord_vnd_id: auction_deposit_ad1 lot_est1: 2000.0 lot_est2: 4000.0 @@ -102,13 +68,11 @@ - I assign the buyer through "Map buyer username to Partners" wizard - - Creating a auction.lots.buyer_map record -- !record {model: auction.lots.buyer_map, id: auction_lots_buyer_map_0}: ach_login: 'Mr.Chang' ach_uid: base.res_partner_3 - - Performing an osv_memory action buyer_map_set on module auction.lots.buyer_map + I click on the "Update" button - !python {model: auction.lots.buyer_map}: | auc_obj=self.pool.get('auction.lots') @@ -125,13 +89,11 @@ assert(auc_id.ach_uid), _('Buyer not assigned!') - I mark that a seller has been paid by using the "Mark as paid for seller" wizard -- - Creating a auction.payer.sel record - !record {model: auction.payer.sel, id: auction_payer_sel_0}: {} - - Performing an osv_memory action payer_sel on module auction.payer.sel + I click on the "Pay" button - !python {model: auction.payer.sel}: | self.payer_sel(cr, uid, [ref("auction_payer_sel_0")], {"lang": "en_US", "tz": @@ -145,13 +107,11 @@ assert(auc_id.paid_vnd == True), _('Seller paid is not marked!') - I use the "Mark as taken away" wizard to indicate that an object is taken away -- - Creating a auction.lots.able record - !record {model: auction.lots.able, id: auction_lots_able_0}: {} - - Performing an osv_memory action confirm_able on module auction.lots.able + Then I click on the "Able Taken away" wizard - !python {model: auction.lots.able}: | self.confirm_able(cr, uid, [ref("auction_lots_able_0")], {"lang":"en_US", "tz": @@ -167,12 +127,10 @@ - I use the "Unmark as taken away" wizard to unmark the Taken Away field - - Creating a auction.lots.enable record -- !record {model: auction.lots.enable, id: auction_lots_enable_0}: confirm_en: 0.0 - - Performing an osv_memory action confirm_enable on module auction.lots.enable + Then I click on the "Enable Taken away" button - !python {model: auction.lots.enable}: | self.confirm_enable(cr, uid, [ref("auction_lots_enable_0")], {"lang": "en_US", @@ -186,7 +144,6 @@ auc_id=self.browse(cr, uid, ref("auction_lots_painting0")) assert(auc_id.ach_emp == False), _('Taken away is marked!') - - I create statement lines for an object's payment by using the "Pay objects of the buyer" wizard - Creating a account.bank.statement record @@ -211,7 +168,7 @@ statement_id3: account_bank_statement_st0 total: 4000.0 - - Performing an osv_memory action pay_and_reconcile on module auction.pay.buy + Then I click "Pay" button - !python {model: auction.pay.buy}: | self.pay_and_reconcile(cr, uid, [ref("auction_pay_buy_0")], {"lang": "en_US", "tz": @@ -228,14 +185,12 @@ - I create the seller's invoice by using the "Invoice Seller objects" wizard - - Creating a auction.lots.make.invoice record -- !record {model: auction.lots.make.invoice, id: auction_lots_make_invoice_0}: amount: 3500.0 number: 2010/002 objects: 1 - - Performing an osv_memory action makeInvoices on module auction.lots.make.invoice + Then I click on the "Create Invoices" button - !python {model: auction.lots.make.invoice}: | self.makeInvoices(cr, uid, [ref("auction_lots_make_invoice_0")], {"lang": "en_US", @@ -250,8 +205,6 @@ assert(auc_id.sel_inv_id), _('Seller Invoice has not been created!') - I create a buyer's invoice by using the "Invoice Buyer objects" wizard -- - Creating a auction.lots.make.invoice.buyer record - !record {model: auction.lots.make.invoice.buyer, id: auction_lots_make_invoice_buyer_0}: amount: 3500.0 @@ -259,7 +212,7 @@ number: 2010/003 objects: 1 - - Performing an osv_memory action makeInvoices on module auction.lots.make.invoice.buyer + Then I click on the "Create Invoices" button - !python {model: auction.lots.make.invoice.buyer}: | self.makeInvoices(cr, uid, [ref("auction_lots_make_invoice_buyer_0")], {"lang": @@ -275,12 +228,10 @@ - In order to change the auction for an object I use the "Change auction date" wizard - - Creating a auction.lots.auction.move record -- !record {model: auction.lots.auction.move, id: auction_lots_auction_move_0}: auction_id: auction.auction_date_2 - - Performing an osv_memory action auction_move_set on module auction.lots.auction.move + Then I click on the "Move to Auction date" button - !python {model: auction.lots.auction.move}: | self.auction_move_set(cr, uid, [ref("auction_lots_auction_move_0")], {"lang": From 7c33a1b6859218d7f8dfedc113a113ad52a5dc16 Mon Sep 17 00:00:00 2001 From: "uco (OpenERP)" Date: Tue, 25 May 2010 12:30:13 +0530 Subject: [PATCH 020/191] [ADD] mrp_operations: Task ID-290: Added yaml. bzr revid: uco@tinyerp.com-20100525070013-kuh5oib0r7pbmw4q --- addons/mrp_operations/__openerp__.py | 1 + addons/mrp_operations/test/mrp_operations.yml | 151 ++++++++++++++++++ 2 files changed, 152 insertions(+) create mode 100644 addons/mrp_operations/test/mrp_operations.yml diff --git a/addons/mrp_operations/__openerp__.py b/addons/mrp_operations/__openerp__.py index 9c0a2bb4f33..0ce116535c1 100644 --- a/addons/mrp_operations/__openerp__.py +++ b/addons/mrp_operations/__openerp__.py @@ -61,6 +61,7 @@ 'process/mrp_operation_process.xml' ], 'demo_xml': ['mrp_operation_data.xml'], + 'test': ['test/mrp_operations.yml'], 'installable': True, 'active': False, 'certificate': '0056233813133', diff --git a/addons/mrp_operations/test/mrp_operations.yml b/addons/mrp_operations/test/mrp_operations.yml new file mode 100644 index 00000000000..61cf9202202 --- /dev/null +++ b/addons/mrp_operations/test/mrp_operations.yml @@ -0,0 +1,151 @@ +- + In order to test mrp_operations module in OpenERP I will put a Production order + and check its effects on Work orders. +- + I create a production order. +- + !record {model: mrp.production, id: mrp_production_mo0}: + company_id: base.main_company + date_planned: '2010-05-25 11:17:34' + location_dest_id: stock.stock_location_stock + location_src_id: stock.stock_location_stock + name: MO/00002 + product_id: product.product_product_pc1 + product_qty: 5.0 + product_uom: product.product_uom_unit + product_uos_qty: 0.0 +- + I am performing an osv_memory action action_compute on module mrp.production +- + !python {model: mrp.production}: | + self.action_compute(cr, uid, [ref("mrp_production_mo0")], {"lang": "en_US", "tz": + False, "search_default_current": 1, "active_model": "ir.ui.menu", "active_ids": + [ref("mrp.menu_mrp_production_action")], "active_id": ref("mrp.menu_mrp_production_action"), + }) +- + Now I confirm my production order. +- + !workflow {model: mrp.production, action: button_confirm, ref: mrp_production_mo0} +- + I check that there is one Work order generated related to my production order. +- + !python {model: mrp.production.workcenter.line}: | + from tools.translate import _ + order_id = self.search(cr, uid, [('production_id','=', ref('mrp_production_mo0')),('state','=','draft')]) + assert order_id, _('No Work order!') +- + I am checking Procurement orders. +- + !python {model: mrp.procurement}: | + from tools.translate import _ + proc_ids = self.search(cr, uid, [('state','=','confirmed')]) + assert proc_ids, _('No Procurements!') +- + The scheduler runs. +- + !function {model: mrp.procurement, name: run_scheduler}: + - model: mrp.procurement + search: "[('state','=','confirmed')]" +- + I am checking Internal picking. +- + !python {model: stock.picking}: | + from tools.translate import _ + pick_ids = self.search(cr, uid, [('state','!=','done'),('type','=','internal')]) + assert pick_ids, _('No Internal Pickings!') +- + I see that there is a manufacturing order for the sub product CPU_GEN of PC1 with ready state. +- + !python {model: mrp.production}: | + from tools.translate import _ + order_ids = self.search(cr, uid, [('state','=','ready')]) + assert order_ids, _('No new manufacturing order!') +- + I check that there one more work order created for new production order. +- + !python {model: mrp.production.workcenter.line}: | + from tools.translate import _ + prod_obj = self.pool.get('mrp.production') + prod_order_ids = prod_obj.search(cr, uid, [('state','=','ready')]) + workorder_id = self.search(cr, uid, [('production_id','=', prod_order_ids[0]),('state','=','draft')]) + assert workorder_id, _('No Work order!') +- + I start the second production order of the CPU_GEN product. +- + !python {model: mrp.production}: | + import netsvc + wf_service = netsvc.LocalService("workflow") + prod_order_ids = self.search(cr, uid, [('state','=','ready')]) + for po in prod_order_ids: + wf_service.trg_validate(uid, 'mrp.production', po, 'button_produce', cr) +- + I am creating a mrp.product.produce record +- + !record {model: mrp.product.produce, id: mrp_product_produce_0}: + mode: consume_produce + product_qty: 5.0 +- + I am performing an osv_memory action do_produce on module mrp.product.produce +- + !python {model: mrp.product.produce}: | + prod_obj = self.pool.get('mrp.production') + prod_order_ids = prod_obj.search(cr, uid, [('state','=','in_production')]) + self.do_produce(cr, uid, [ref("mrp_product_produce_0")], {"lang": "en_US", "tz": + False, "search_default_current": 1, "active_model": "mrp.production", "active_ids": + prod_order_ids, "active_id": prod_order_ids[0], }) +- + I check that my production order and its related work order is in done state. +- + !python {model: mrp.production.workcenter.line}: | + from tools.translate import _ + prod_obj = self.pool.get('mrp.production') + prod_order_ids = prod_obj.search(cr, uid, [('state','=','done')]) + workorder_id = self.search(cr, uid, [('production_id','=', prod_order_ids[0]),('state','=','done')]) + assert workorder_id, _('Work order is not done!') +- + Now I check my original production order is now ready. +- + !python {model: mrp.production}: | + from tools.translate import _ + prod_ids = self.search(cr, uid, [('id','=',ref('mrp_production_mo0')),('state','=','ready')]) + assert prod_ids, _('Production order is not ready!') +- + I check that both internal pickings are done. +- + !python {model: stock.picking}: | + from tools.translate import _ + pick_ids = self.search(cr, uid, [('state','=','done'),('type','=','internal')]) + assert pick_ids, _('Internal pickings are not done!') +- + Now I start my first production order. +- + !workflow {model: mrp.production, action: button_produce, ref: mrp_production_mo0} +- + I check that the related work order is in progress state. +- + !python {model: mrp.production.workcenter.line}: | + from tools.translate import _ + order_id = self.search(cr, uid, [('production_id','=', ref('mrp_production_mo0')),('state','=','startworking')]) + assert order_id, _('Work order not started yet!') +- + I am creating a mrp.product.produce record +- + !record {model: mrp.product.produce, id: mrp_product_produce_0}: + mode: consume_produce + product_qty: 5.0 +- + I am performing an osv_memory action do_produce on module mrp.product.produce +- + !python {model: mrp.product.produce}: | + prod_obj = self.pool.get('mrp.production') + prod_order_ids = prod_obj.search(cr, uid, [('state','=','in_production')]) + self.do_produce(cr, uid, [ref("mrp_product_produce_0")], {"lang": "en_US", "tz": + False, "search_default_current": 1, "active_model": "mrp.production", "active_ids": + [ref("mrp_production_mo0")], "active_id": ref("mrp_production_mo0"), }) +- + I check the related work order is done. +- + !python {model: mrp.production.workcenter.line}: | + from tools.translate import _ + order_id = self.search(cr, uid, [('production_id','=', ref('mrp_production_mo0')),('state','=','done')]) + assert order_id, _('Work order not done yet!') From 541dd7a0d0bb22d829170aec92fa13dcdacdd9ba Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Tue, 25 May 2010 15:57:56 +0530 Subject: [PATCH 021/191] [IMP] point_of_sale: Fix the problem return wizard and merge the stock.py in pos bzr revid: sbh@tinyerp.com-20100525102756-bd0vmkk3kc31cb0l --- addons/point_of_sale/__init__.py | 1 - addons/point_of_sale/pos.py | 9 ++++++ addons/point_of_sale/pos_view.xml | 2 +- addons/point_of_sale/stock.py | 37 ---------------------- addons/point_of_sale/wizard/pos_payment.py | 10 +++--- addons/point_of_sale/wizard/pos_return.py | 6 ++-- 6 files changed, 20 insertions(+), 45 deletions(-) delete mode 100644 addons/point_of_sale/stock.py diff --git a/addons/point_of_sale/__init__.py b/addons/point_of_sale/__init__.py index 0baf4639019..2d195b3d4a5 100644 --- a/addons/point_of_sale/__init__.py +++ b/addons/point_of_sale/__init__.py @@ -23,7 +23,6 @@ import pos import account_bank_statement import pos_account_bank_statement -import stock import wizard import report diff --git a/addons/point_of_sale/pos.py b/addons/point_of_sale/pos.py index 597be8eaea7..5d4df5a5f10 100644 --- a/addons/point_of_sale/pos.py +++ b/addons/point_of_sale/pos.py @@ -1331,4 +1331,13 @@ class product_product(osv.osv): 'disc_controle': lambda *a: True, } product_product() + +class stock_picking(osv.osv): + + _inherit = 'stock.picking' + _columns = { + 'pos_order': fields.many2one('pos.order', 'Pos order'), + } +stock_picking() + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/point_of_sale/pos_view.xml b/addons/point_of_sale/pos_view.xml index d2cc102a047..0089d6369f6 100644 --- a/addons/point_of_sale/pos_view.xml +++ b/addons/point_of_sale/pos_view.xml @@ -66,7 +66,7 @@