From 9d14989a554817298edb856acddfb5d04c2afcc4 Mon Sep 17 00:00:00 2001 From: mtr Date: Fri, 21 May 2010 18:47:17 +0530 Subject: [PATCH 1/2] [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 5bb61aa3629edf903e44ec53970cbe3f1f4726ab Mon Sep 17 00:00:00 2001 From: mtr Date: Tue, 25 May 2010 11:23:19 +0530 Subject: [PATCH 2/2] [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":