From 460d5ff6c0be0752475aeb5c0f5b76d2907fd51b Mon Sep 17 00:00:00 2001 From: "atp (Open ERP)" Date: Thu, 5 Aug 2010 17:05:25 +0530 Subject: [PATCH 1/6] [IMP]: Change tooltip name and menu name bzr revid: atp@tinyerp.co.in-20100805113525-na3i167licsljq0w --- addons/auction/auction.py | 32 ++++++++++++++++---------------- addons/auction/auction_view.xml | 6 +++--- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/addons/auction/auction.py b/addons/auction/auction.py index 53ba107ae40..6daed23a077 100644 --- a/addons/auction/auction.py +++ b/addons/auction/auction.py @@ -344,15 +344,15 @@ class auction_lots(osv.osv): _columns = { 'bid_lines':fields.one2many('auction.bid_line', 'lot_id', 'Bids'), - 'auction_id': fields.many2one('auction.dates', 'Auctions', select=1, help="Auction For Objects"), - 'bord_vnd_id': fields.many2one('auction.deposit', 'Depositer Inventory', required=True, help="Auction Deposit For Deposit Inventory"), - 'name': fields.char('Title', size=64, required=True, help='Auction Objects Name'), + 'auction_id': fields.many2one('auction.dates', 'Auction', select=1, help="Auction For Object"), + 'bord_vnd_id': fields.many2one('auction.deposit', 'Depositer Inventory', required=True, help="Provide Deposit Information: seller, Withdrawned Method, Object, Deposit Costs"), + 'name': fields.char('Title', size=64, required=True, help='Auction Object Name'), 'name2': fields.char('Short Description (2)', size=64), 'lot_type': fields.selection(_type_get, 'Object category', size=64), 'author_right': fields.many2one('account.tax', 'Author rights', help="Account Tax For Author Commission"), - 'lot_est1': fields.float('Minimum Estimation', help="Minimum Estimate Price Of Objects"), - 'lot_est2': fields.float('Maximum Estimation', help="Maximum Estimate Price Of Objects"), - 'lot_num': fields.integer('List Number', required=True, select=1, help="List Number For selected Object in Deposit"), + 'lot_est1': fields.float('Minimum Estimation', help="Minimum Estimate Price"), + 'lot_est2': fields.float('Maximum Estimation', help="Maximum Estimate Price"), + 'lot_num': fields.integer('List Number', required=True, select=1, help="List Number In Depositer Inventory"), 'create_uid': fields.many2one('res.users', 'Created by', readonly=True), 'history_ids':fields.one2many('auction.lot.history', 'lot_id', 'Auction history'), 'lot_local':fields.char('Location', size=64, help="Auction Location"), @@ -362,15 +362,15 @@ class auction_lots(osv.osv): 'product_id':fields.many2one('product.product', 'Product', required=True), 'obj_desc': fields.text('Object Description'), 'obj_num': fields.integer('Catalog Number'), - 'obj_ret': fields.float('Price retired', help="Objects Ret"), + 'obj_ret': fields.float('Price retired', help="Object Ret"), 'obj_comm': fields.boolean('Commission'), - 'obj_price': fields.float('Adjudication price', help="Objects Price"), + 'obj_price': fields.float('Adjudication price', help="Object Price"), 'ach_avance': fields.float('Buyer Advance'), 'ach_login': fields.char('Buyer Username', size=64), 'ach_uid': fields.many2one('res.partner', 'Buyer'), - 'seller_id': fields.related('bord_vnd_id','partner_id', type='many2one', relation='res.partner', string='Seller', readonly=True, help="Seller who is related to depositor Inventory"), + 'seller_id': fields.related('bord_vnd_id','partner_id', type='many2one', relation='res.partner', string='Seller', readonly=True), 'ach_emp': fields.boolean('Taken Away', readonly=True, help="When This Field is True means, Objects is taken away by Buyer"), - 'is_ok': fields.boolean('Buyer\'s payment', help="When Buyer Pay For Account Bank statement', This field is selected as True."), + 'is_ok': fields.boolean('Buyer\'s payment', help="When Buyer Pay For Bank statement', This field is selected as True."), 'ach_inv_id': fields.many2one('account.invoice', 'Buyer Invoice', readonly=True, states={'draft':[('readonly', False)]}), 'sel_inv_id': fields.many2one('account.invoice', 'Seller Invoice', readonly=True, states={'draft':[('readonly', False)]}), 'vnd_lim': fields.float('Seller limit'), @@ -388,14 +388,14 @@ class auction_lots(osv.osv): \n* The \'Unsold\' state is used when object does not sold for long time, user can also set it as draft state after unsold. \ \n* The \'Paid\' state is used when user pay for the object \ \n* The \'Sold\' state is used when user buy the object.'), - 'buyer_price': fields.function(_getprice, method=True, string='Buyer price', store=True, multi="buyer_price", help="Objects Price which Buyer Given For Objects"), + 'buyer_price': fields.function(_getprice, method=True, string='Buyer price', store=True, multi="buyer_price", help="Buyer Price"), 'seller_price': fields.function(_getprice, method=True, string='Seller price', store=True, multi="seller_price", help="Seller Price"), - 'gross_revenue':fields.function(_getprice, method=True, string='Gross revenue', store=True, multi="gross_revenue", help="Revenue Minus Cost Of Objects Sold."), + 'gross_revenue':fields.function(_getprice, method=True, string='Gross revenue', store=True, multi="gross_revenue", help="Buyer Price - Seller Price"), 'gross_margin':fields.function(_getprice, method=True, string='Gross Margin (%)', store=True, multi="gross_margin", help="Gross Income Divided by Net Sales"), - 'costs':fields.function(_getprice, method=True, string='Indirect costs', store=True, multi="costs", help="Total credit of analytic account"), - 'statement_id': fields.many2many('account.bank.statement.line', 'auction_statement_line_rel', 'auction_id', 'statement', 'Payment', help="Account Bank statement Line For Given Buyer"), - 'net_revenue':fields.function(_getprice, method=True, string='Net revenue', store=True, multi="net_revenue", help="Total Revenue Minus Returns"), - 'net_margin':fields.function(_getprice, method=True, string='Net Margin (%)', store=True, multi="net_margin", help="The ratio of net profits to revenues"), + 'costs':fields.function(_getprice, method=True, string='Indirect costs', store=True, multi="costs", help="Total Credit of analytic account"), + 'statement_id': fields.many2many('account.bank.statement.line', 'auction_statement_line_rel', 'auction_id', 'statement', 'Payment', help="Bank statement Line For Given Buyer"), + 'net_revenue':fields.function(_getprice, method=True, string='Net revenue', store=True, multi="net_revenue", help="Buyer Price - Seller Price - Indirect Cost"), + 'net_margin':fields.function(_getprice, method=True, string='Net Margin (%)', store=True, multi="net_margin", help="(Net Revenue * 100)/ Object Price"), } _defaults = { 'state':lambda *a: 'draft', diff --git a/addons/auction/auction_view.xml b/addons/auction/auction_view.xml index 4972d605cbe..062be1f0560 100644 --- a/addons/auction/auction_view.xml +++ b/addons/auction/auction_view.xml @@ -40,7 +40,7 @@ form - + @@ -50,7 +50,7 @@ auction.lot.category tree - + @@ -61,7 +61,7 @@ auction.lot.category form -
+ From 8736a37b60b4ea74b602d6b42133d422e03eea74 Mon Sep 17 00:00:00 2001 From: "atp (Open ERP)" Date: Thu, 5 Aug 2010 17:15:52 +0530 Subject: [PATCH 2/6] [IMP]: Add gross margin function bzr revid: atp@tinyerp.co.in-20100805114552-xsmnf6jf413eeuap --- addons/auction/auction.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/addons/auction/auction.py b/addons/auction/auction.py index 6daed23a077..7a84147d5f6 100644 --- a/addons/auction/auction.py +++ b/addons/auction/auction.py @@ -293,7 +293,16 @@ class auction_lots(osv.osv): elif name == "net_revenue": if lot.auction_id: result = lot.buyer_price - lot.seller_price - lot.costs - + + elif name == "gross_margin": + if ((lot.obj_price==0) and (lot.state=='draft')): + amount = lot.lot_est1 + else: + amount = lot.obj_price + if amount > 0: + result = (lot.gross_revenue * 100) / amount + result = round(result,2) + elif name == "net_margin": if ((lot.obj_price==0) and (lot.state=='draft')): amount = lot.lot_est1 @@ -301,6 +310,7 @@ class auction_lots(osv.osv): amount = lot.obj_price if amount > 0: result = (lot.net_revenue * 100) / amount + result = round(result,2) elif name == "costs": # costs: Total credit of analytic account # objects sold during this auction (excluding analytic lines that are in the analytic journal of the auction date) @@ -391,7 +401,7 @@ class auction_lots(osv.osv): 'buyer_price': fields.function(_getprice, method=True, string='Buyer price', store=True, multi="buyer_price", help="Buyer Price"), 'seller_price': fields.function(_getprice, method=True, string='Seller price', store=True, multi="seller_price", help="Seller Price"), 'gross_revenue':fields.function(_getprice, method=True, string='Gross revenue', store=True, multi="gross_revenue", help="Buyer Price - Seller Price"), - 'gross_margin':fields.function(_getprice, method=True, string='Gross Margin (%)', store=True, multi="gross_margin", help="Gross Income Divided by Net Sales"), + 'gross_margin':fields.function(_getprice, method=True, string='Gross Margin (%)', store=True, multi="gross_margin", help="(Gross Revenue*100.0)/ Object Price"), 'costs':fields.function(_getprice, method=True, string='Indirect costs', store=True, multi="costs", help="Total Credit of analytic account"), 'statement_id': fields.many2many('account.bank.statement.line', 'auction_statement_line_rel', 'auction_id', 'statement', 'Payment', help="Bank statement Line For Given Buyer"), 'net_revenue':fields.function(_getprice, method=True, string='Net revenue', store=True, multi="net_revenue", help="Buyer Price - Seller Price - Indirect Cost"), From e639524564c88bebf9aa8170034e69db8a233204 Mon Sep 17 00:00:00 2001 From: "atp (Open ERP)" Date: Thu, 5 Aug 2010 21:09:03 +0530 Subject: [PATCH 3/6] [IMP]: usability Improvement in Auction Dashboard bzr revid: atp@tinyerp.co.in-20100805153903-8mgav7xlsprovv7s --- addons/auction/__openerp__.py | 6 +- addons/auction/auction.py | 7 +- addons/auction/board_auction_view.xml | 116 +++-- addons/auction/report/report_auction.py | 195 +------- addons/auction/report/report_auction_view.xml | 421 +----------------- addons/auction/security/ir.model.access.csv | 5 - addons/auction/test/auction.yml | 155 ++++++- 7 files changed, 243 insertions(+), 662 deletions(-) diff --git a/addons/auction/__openerp__.py b/addons/auction/__openerp__.py index 7ad16bfeb03..6cc6139b39e 100644 --- a/addons/auction/__openerp__.py +++ b/addons/auction/__openerp__.py @@ -59,11 +59,11 @@ 'report/report_auction_view.xml', 'auction_wizard.xml', 'board_auction_view.xml', - 'board_auction_manager_view.xml', + # 'board_auction_manager_view.xml', ], - 'demo_xml': ['auction_demo.xml','board_auction_demo.xml'], - 'test': ['test/auction.yml', 'test/auction_wizard.yml'], + 'demo_xml': ['auction_demo.xml','board_auction_demo.xml', 'test/auction.yml'], + #'test': ['test/auction_wizard.yml'], 'installable': True, 'active': False, diff --git a/addons/auction/auction.py b/addons/auction/auction.py index 7a84147d5f6..f67a92afe94 100644 --- a/addons/auction/auction.py +++ b/addons/auction/auction.py @@ -314,6 +314,7 @@ class auction_lots(osv.osv): elif name == "costs": # costs: Total credit of analytic account # objects sold during this auction (excluding analytic lines that are in the analytic journal of the auction date) + #TOCHECK: Calculation OF Indirect Cost som = 0.0 if lot.auction_id: auct_id = lot.auction_id.id @@ -379,8 +380,8 @@ class auction_lots(osv.osv): 'ach_login': fields.char('Buyer Username', size=64), 'ach_uid': fields.many2one('res.partner', 'Buyer'), 'seller_id': fields.related('bord_vnd_id','partner_id', type='many2one', relation='res.partner', string='Seller', readonly=True), - 'ach_emp': fields.boolean('Taken Away', readonly=True, help="When This Field is True means, Objects is taken away by Buyer"), - 'is_ok': fields.boolean('Buyer\'s payment', help="When Buyer Pay For Bank statement', This field is selected as True."), + 'ach_emp': fields.boolean('Taken Away', readonly=True, help="When This Field is marked, Object is taken away by Buyer"), + 'is_ok': fields.boolean('Buyer\'s payment', help="When Buyer Pay For Bank statement', This field is Marked"), 'ach_inv_id': fields.many2one('account.invoice', 'Buyer Invoice', readonly=True, states={'draft':[('readonly', False)]}), 'sel_inv_id': fields.many2one('account.invoice', 'Seller Invoice', readonly=True, states={'draft':[('readonly', False)]}), 'vnd_lim': fields.float('Seller limit'), @@ -402,7 +403,7 @@ class auction_lots(osv.osv): 'seller_price': fields.function(_getprice, method=True, string='Seller price', store=True, multi="seller_price", help="Seller Price"), 'gross_revenue':fields.function(_getprice, method=True, string='Gross revenue', store=True, multi="gross_revenue", help="Buyer Price - Seller Price"), 'gross_margin':fields.function(_getprice, method=True, string='Gross Margin (%)', store=True, multi="gross_margin", help="(Gross Revenue*100.0)/ Object Price"), - 'costs':fields.function(_getprice, method=True, string='Indirect costs', store=True, multi="costs", help="Total Credit of analytic account"), + 'costs':fields.function(_getprice, method=True, string='Indirect costs', store=True, multi="costs", help="Deposit cost"), 'statement_id': fields.many2many('account.bank.statement.line', 'auction_statement_line_rel', 'auction_id', 'statement', 'Payment', help="Bank statement Line For Given Buyer"), 'net_revenue':fields.function(_getprice, method=True, string='Net revenue', store=True, multi="net_revenue", help="Buyer Price - Seller Price - Indirect Cost"), 'net_margin':fields.function(_getprice, method=True, string='Net Margin (%)', store=True, multi="net_margin", help="(Net Revenue * 100)/ Object Price"), diff --git a/addons/auction/board_auction_view.xml b/addons/auction/board_auction_view.xml index e1d92d5e753..7a233282f2c 100644 --- a/addons/auction/board_auction_view.xml +++ b/addons/auction/board_auction_view.xml @@ -1,12 +1,62 @@ - - - Auction + + + Auction DashBoard - - - board.auction.manager.form + + + auction.lots + form + tree,form + + + + auction.deposit + form + tree,form + + + + report.auction.estimation.adj.category.tree + auction.lots + tree + + + + + + + + + + + + + + report.auction.lots.estimation.adj.category.graph + auction.lots + graph + + + + + + + + + + + + + Min est/Adj/Max est + auction.lots + form + graph,tree + + + + board.auction.form board.board form @@ -14,36 +64,31 @@ - + width="510" /> + - + -