diff --git a/addons/auction/__openerp__.py b/addons/auction/__openerp__.py
index 7d96fe90aa1..7ad16bfeb03 100644
--- a/addons/auction/__openerp__.py
+++ b/addons/auction/__openerp__.py
@@ -40,34 +40,31 @@
""",
'author': 'OpenERP SA',
'depends': ['base', 'account', 'hr_attendance'],
- 'init_xml': ['auction_sequence.xml'],
+ 'init_xml': ['auction_sequence.xml', 'auction_data.xml'],
'update_xml': [
'security/ir.model.access.csv',
-# 'wizard/auction_lots_cancel_view.xml',
-# 'wizard/auction_transfer_unsold_object_view.xml',
- 'wizard/auction_lots_able_view.xml',
- 'wizard/auction_lots_enable_view.xml',
+ # 'wizard/auction_lots_able_view.xml',
+ # 'wizard/auction_lots_enable_view.xml',
'wizard/auction_lots_make_invoice_buyer_view.xml',
'wizard/auction_lots_make_invoice_view.xml',
'wizard/auction_taken_view.xml',
'wizard/auction_lots_auction_move_view.xml',
'wizard/auction_pay_buy_view.xml',
- 'wizard/auction_payer_sel_view.xml',
+ #'wizard/auction_payer_sel_view.xml',
'wizard/auction_lots_sms_send_view.xml',
'wizard/auction_catalog_flagey_view.xml',
-# 'wizard/auction_aie_send_view.xml',
-# 'wizard/auction_aie_send_result_view.xml',
'wizard/auction_lots_buyer_map_view.xml',
-# 'wizard/auction_lots_numerotate_view.xml',
-
'auction_view.xml',
'auction_report.xml',
+ 'report/report_auction_view.xml',
'auction_wizard.xml',
'board_auction_view.xml',
'board_auction_manager_view.xml',
],
'demo_xml': ['auction_demo.xml','board_auction_demo.xml'],
+ 'test': ['test/auction.yml', 'test/auction_wizard.yml'],
+
'installable': True,
'active': False,
'certificate': '0039333102717',
diff --git a/addons/auction/auction.py b/addons/auction/auction.py
index e55d999a1d1..41c75e0fe7b 100644
--- a/addons/auction/auction.py
+++ b/addons/auction/auction.py
@@ -18,24 +18,27 @@
# along with this program. If not, see .
#
##############################################################################
-
-import time
-import netsvc
-from osv import fields, osv, orm
-import ir
from mx import DateTime
+from osv import fields, osv, orm
+from tools import config
from tools.translate import _
+import ir
+import netsvc
+import os
+import time
+import tools
#----------------------------------------------------------
# Auction Artists
#----------------------------------------------------------
+
class auction_artists(osv.osv):
_name = "auction.artists"
_columns = {
- 'name': fields.char('Artist/Author Name', size=64, required=True),
- 'pseudo': fields.char('Pseudo', size=64),
- 'birth_death_dates':fields.char('Birth / Death dates', size=64),
- 'biography': fields.text('Biography'),
+ 'name': fields.char('Artist/Author Name', size=64, required=True),
+ 'pseudo': fields.char('Pseudo', size=64),
+ 'birth_death_dates':fields.char('Birth / Death dates', size=64),
+ 'biography': fields.text('Biography'),
}
auction_artists()
@@ -43,49 +46,55 @@ auction_artists()
# Auction Dates
#----------------------------------------------------------
class auction_dates(osv.osv):
+ """Auction Dates"""
_name = "auction.dates"
-
+ _description=__doc__
+
def _adjudication_get(self, cr, uid, ids, prop, unknow_none, unknow_dict):
- tmp={}
- for id in ids:
- tmp[id]=0.0
- cr.execute("select sum(obj_price) from auction_lots where auction_id=%s", (id,))
- sum = cr.fetchone()
- if sum:
- tmp[id]=sum[0]
- return tmp
+ res={}
+ total = 0.0
+ lots_obj = self.pool.get('auction.lots')
+ for auction in self.browse(cr, uid, ids):
+ lots_ids = lots_obj.search(cr, uid, [('auction_id', '=', auction.id)])
+ for lots in lots_obj.browse(cr, uid, lots_ids):
+ total+=lots.obj_price or 0.0
+ res[auction.id]=total
+ return res
- def name_get(self, cr, uid, ids, context={}):
- if not len(ids):
+ def name_get(self, cr, uid, ids, context=None):
+ if not context:
+ context={}
+ if not ids:
return []
reads = self.read(cr, uid, ids, ['name', 'auction1'], context)
- name = [(r['id'],'['+r['auction1']+'] '+ r['name']) for r in reads]
+ name = [(r['id'], '['+r['auction1']+'] '+ r['name']) for r in reads]
return name
_columns = {
- 'name': fields.char('Auction Name', size=64, required=True),
- 'expo1': fields.date('First Exposition Day', required=True),
- 'expo2': fields.date('Last Exposition Day', required=True),
- 'auction1': fields.date('First Auction Day', required=True),
- 'auction2': fields.date('Last Auction Day', required=True),
- 'journal_id': fields.many2one('account.journal', 'Buyer Journal', required=True),
- 'journal_seller_id': fields.many2one('account.journal', 'Seller Journal', required=True),
- 'buyer_costs': fields.many2many('account.tax', 'auction_buyer_taxes_rel', 'auction_id', 'tax_id', 'Buyer Costs'),
- 'seller_costs': fields.many2many('account.tax', 'auction_seller_taxes_rel', 'auction_id', 'tax_id', 'Seller Costs'),
- 'acc_income': fields.many2one('account.account', 'Income Account', required=True),
- 'acc_expense': fields.many2one('account.account', 'Expense Account', required=True),
- 'adj_total': fields.function(_adjudication_get, method=True, string='Total Adjudication',store=True),
- 'state': fields.selection((('draft','Draft'),('closed','Closed')),'State',select=1, readonly=True,
- help='When auction starts the state is \'Draft\'.\n At the end of auction, the state becomes \'Closed\'.'),
- 'account_analytic_id': fields.many2one('account.analytic.account', 'Analytic Account', required=True),
-
+ 'name': fields.char('Auction Name', size=64, required=True),
+ 'expo1': fields.date('First Exposition Day', required=True),
+ 'expo2': fields.date('Last Exposition Day', required=True),
+ 'auction1': fields.date('First Auction Day', required=True),
+ 'auction2': fields.date('Last Auction Day', required=True),
+ 'journal_id': fields.many2one('account.journal', 'Buyer Journal', required=True),
+ 'journal_seller_id': fields.many2one('account.journal', 'Seller Journal', required=True),
+ 'buyer_costs': fields.many2many('account.tax', 'auction_buyer_taxes_rel', 'auction_id', 'tax_id', 'Buyer Costs'),
+ 'seller_costs': fields.many2many('account.tax', 'auction_seller_taxes_rel', 'auction_id', 'tax_id', 'Seller Costs'),
+ 'acc_income': fields.many2one('account.account', 'Income Account', required=True),
+ 'acc_expense': fields.many2one('account.account', 'Expense Account', required=True),
+ 'adj_total': fields.function(_adjudication_get, method=True, string='Total Adjudication', store=True),
+ 'state': fields.selection((('draft', 'Draft'), ('closed', 'Closed')), 'State', select=1, readonly=True,
+ help='When auction starts the state is \'Draft\'.\n At the end of auction, the state becomes \'Closed\'.'),
+ 'account_analytic_id': fields.many2one('account.analytic.account', 'Analytic Account', required=True),
}
+
_defaults = {
- 'state': lambda *a: 'draft',
+ 'state': lambda *a: 'draft',
}
+
_order = "auction1 desc"
- def close(self, cr, uid, ids, *args):
+ def close(self, cr, uid, ids, context=None):
"""
Close an auction date.
@@ -94,410 +103,322 @@ class auction_dates(osv.osv):
RETURN: True
"""
- # objects vendus mais non factures
- #TODO: convert this query to tiny API
+ if not context:
+ context={}
lots_obj = self.pool.get('auction.lots')
- cr.execute('select count(*) as c from auction_lots where auction_id IN %s and state=%s and obj_price>0', (tuple(ids),'draft',))
- cr.execute('SELECT COUNT(*) AS c '
- 'FROM auction_lots '
- 'WHERE auction_id IN %s '
- 'AND state=%s AND obj_price>0', (tuple(ids), 'draft'))
- nbr = cr.fetchone()[0]
- ach_uids = {}
- cr.execute('SELECT id FROM auction_lots '
- 'WHERE auction_id IN %s '
- 'AND state=%s AND obj_price>0', (tuple(ids), 'draft'))
- r = lots_obj.lots_invoice(cr, uid, [x[0] for x in cr.fetchall()],{},None)
- cr.execute('select id from auction_lots where auction_id IN %s and obj_price>0',(tuple(ids),))
- ids2 = [x[0] for x in cr.fetchall()]
- # for auction in auction_ids:
- c = lots_obj.seller_trans_create(cr, uid, ids2, {})
- self.write(cr, uid, ids, {'state':'closed'}) #close the auction
+ lots_ids = lots_obj.search(cr, uid, [('auction_id', 'in', ids), ('state', '=', 'draft'), ('obj_price', '>', 0)])
+ new_buyer_invoice = lots_obj.lots_invoice(cr, uid, lots_ids, {}, None)
+ lots_ids2 = lots_obj.search(cr, uid, [('auction_id', 'in', ids), ('obj_price', '>', 0)])
+ new_seller_invoice = lots_obj.seller_trans_create(cr, uid, lots_ids2, {})
+ self.write(cr, uid, ids, {'state': 'closed'}) #close the auction
return True
+
auction_dates()
-
#----------------------------------------------------------
# Deposits
#----------------------------------------------------------
-def _inv_uniq(cr, ids):
- cr.execute('SELECT id FROM auction_lots '
- 'WHERE auction_id IN %s '
- 'AND obj_price>0', (tuple(ids),))
- for datas in cr.fetchall():
- cr.execute('select count(*) from auction_deposit where name=%s', (datas[0],))
- if cr.fetchone()[0]>1:
- return False
- return True
-
class auction_deposit(osv.osv):
+ """Auction Deposit Border"""
+
_name = "auction.deposit"
- _description="Deposit Border"
+ _description=__doc__
_order = "id desc"
_columns = {
- 'transfer' : fields.boolean('Transfer'),
- 'name': fields.char('Depositer Inventory', size=64, required=True),
- 'partner_id': fields.many2one('res.partner', 'Seller', required=True, change_default=True),
- 'date_dep': fields.date('Deposit date', required=True),
- 'method': fields.selection((('keep','Keep until sold'),('decease','Decrease limit of 10%'),('contact','Contact the Seller')), 'Withdrawned method', required=True),
- 'tax_id': fields.many2one('account.tax', 'Expenses'),
- 'create_uid': fields.many2one('res.users', 'Created by', readonly=True),
- 'info': fields.char('Description', size=64),
- 'lot_id': fields.one2many('auction.lots', 'bord_vnd_id', 'Objects'),
- 'specific_cost_ids': fields.one2many('auction.deposit.cost', 'deposit_id', 'Specific Costs'),
- 'total_neg': fields.boolean('Allow Negative Amount'),
+ 'transfer' : fields.boolean('Transfer'),
+ 'name': fields.char('Depositer Inventory', size=64, required=True),
+ 'partner_id': fields.many2one('res.partner', 'Seller', required=True, change_default=True),
+ 'date_dep': fields.date('Deposit date', required=True),
+ 'method': fields.selection((('keep', 'Keep until sold'), ('decease', 'Decrease limit of 10%'), ('contact', 'Contact the Seller')), 'Withdrawned method', required=True),
+ 'tax_id': fields.many2one('account.tax', 'Expenses'),
+ 'create_uid': fields.many2one('res.users', 'Created by', readonly=True),
+ 'info': fields.char('Description', size=64),
+ 'lot_id': fields.one2many('auction.lots', 'bord_vnd_id', 'Objects'),
+ 'specific_cost_ids': fields.one2many('auction.deposit.cost', 'deposit_id', 'Specific Costs'),
+ 'total_neg': fields.boolean('Allow Negative Amount'),
}
_defaults = {
-# 'date_dep': lambda *a: time.strftime('%Y-%m-%d'),
- 'method': lambda *a: 'keep',
- 'total_neg': lambda *a: False,
- 'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'auction.deposit'),
+ 'method': lambda *a: 'keep',
+ 'total_neg': lambda *a: False,
+ 'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'auction.deposit'),
}
- _constraints = [
- ]
- def partner_id_change(self, cr, uid, ids, part):
- return {}
+
auction_deposit()
#----------------------------------------------------------
# (Specific) Deposit Costs
#----------------------------------------------------------
class auction_deposit_cost(osv.osv):
+
+ """Auction Deposit Cost"""
+
_name = 'auction.deposit.cost'
+ _description=__doc__
_columns = {
- 'name': fields.char('Cost Name', required=True, size=64),
- 'amount': fields.float('Amount'),
- 'account': fields.many2one('account.account', 'Destination Account', required=True),
- 'deposit_id': fields.many2one('auction.deposit', 'Deposit'),
+ 'name': fields.char('Cost Name', required=True, size=64),
+ 'amount': fields.float('Amount'),
+ 'account': fields.many2one('account.account', 'Destination Account', required=True),
+ 'deposit_id': fields.many2one('auction.deposit', 'Deposit'),
}
auction_deposit_cost()
#----------------------------------------------------------
# Lots Categories
#----------------------------------------------------------
+class aie_category(osv.osv):
+
+ _name="aie.category"
+ _order = "name"
+ _columns={
+ 'name': fields.char('Name', size=64, required=True),
+ 'code':fields.char('Code', size=64),
+ 'parent_id': fields.many2one('aie.category', 'Parent aie Category', ondelete='cascade'),
+ 'child_ids': fields.one2many('aie.category', 'parent_id', help="Childs aie category")
+ }
+
+ def name_get(self, cr, uid, ids, context=None):
+ if not context:
+ context = {}
+ res = []
+ if not ids:
+ return res
+ reads = self.read(cr, uid, ids, ['name', 'parent_id'], context)
+ for record in reads:
+ name = record['name']
+ if record['parent_id']:
+ name = record['parent_id'][1] + ' / ' + name
+ res.append((record['id'], name))
+ return res
+
+aie_category()
+
class auction_lot_category(osv.osv):
+ """Auction Lots Category"""
+
_name = 'auction.lot.category'
+ _description=__doc__
_columns = {
- 'name': fields.char('Category Name', required=True, size=64),
- 'priority': fields.float('Priority'),
- 'active' : fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the auction lot category without removing it."),
- 'aie_categ' : fields.selection([('41',"Unclassifieds"),
- ('2',"Antiques"),
- ('42',"Antique/African Arts"),
- ('59',"Antique/Argenterie"),
- ('45',"Antique/Art from the Ivory Coast"),
- ('46',"Antique/Art from the Ivory Coast/African Arts"),
- ('12',"Antique/Books, manuscripts, eso."),
- ('11',"Antique/Carpet and textilles"),
- ('14',"Antique/Cartoons"),
- ('26',"Antique/Clocks and watches"),
- ('31',"Antique/Collectible & art objects"),
- ('33',"Antique/Engravings"),
- ('10',"Antique/Furnitures"),
- ('50',"Antique/Graphic Arts"),
- ('37',"Antique/Jewelry"),
- ('9',"Antique/Lightings"),
- ('52',"Antique/Metal Ware"),
- ('51',"Antique/Miniatures / Collections"),
- ('53',"Antique/Musical Instruments"),
- ('19',"Antique/Old weapons and militaria"),
- ('43',"Antique/Oriental Arts"),
- ('47',"Antique/Oriental Arts/Chineese furnitures"),
- ('24',"Antique/Others"),
- ('8',"Antique/Painting"),
- ('25',"Antique/Porcelain, Ceramics, Glassmaking, ..."),
- ('13',"Antique/Posters"),
- ('56',"Antique/Religiosa"),
- ('54',"Antique/Scientific Instruments"),
- ('18',"Antique/Sculpture, bronze, eso."),
- ('55',"Antique/Tin / Copper wares"),
- ('16',"Antique/Toys"),
- ('57',"Antique/Verreries"),
- ('17',"Antique/Wine"),
- ('1',"Contemporary Art"),
- ('58',"Cont. Art/Arts"),
- ('27',"Cont. Art/Curiosa"),
- ('15',"Cont. Art/Jewelry"),
- ('30',"Cont. Art/Other Media"),
- ('3',"Cont. Art/Photo"),
- ('4',"Cont. Art/Painting"),
- ('5',"Cont. Art/Sculpture"),
- ('48',"Cont. Art/Shows")],
- 'Aie Category'),
+ 'name': fields.char('Category Name', required=True, size=64),
+ 'priority': fields.float('Priority'),
+ 'active' : fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the auction lot category without removing it."),
+ 'aie_categ': fields.many2one('aie.category', 'Category', ondelete='cascade'),
}
_defaults = {
- 'active' : lambda *a: 1,
- 'aie_categ' : lambda *a:1,
+ 'active' : lambda *a: 1,
}
auction_lot_category()
-def _type_get(self, cr, uid,ids):
- cr.execute('select name, name from auction_lot_category order by name')
- return cr.fetchall()
-
#----------------------------------------------------------
# Lots
#----------------------------------------------------------
-def _inv_constraint(cr, ids):
- cr.execute('SELECT id, bord_vnd_id, lot_num FROM auction_lots '
- 'WHERE id IN %s',
- (tuple(ids),))
- for datas in cr.fetchall():
- cr.execute('select count(*) from auction_lots where bord_vnd_id=%s and lot_num=%s', (datas[1],datas[2]))
- if cr.fetchone()[0]>1:
- return False
- return True
+def _type_get(self, cr, uid, context=None):
+ if not context:
+ context = {}
+ obj = self.pool.get('auction.lot.category')
+ ids = obj.search(cr, uid, [])
+ res = obj.read(cr, uid, ids, ['name'], context)
+ res = [(r['name'], r['name']) for r in res]
+ return res
class auction_lots(osv.osv):
+
+ """Auction Object"""
_name = "auction.lots"
_order = "obj_num,lot_num,id"
- _description="Object"
+ _description=__doc__
- def button_not_bought(self,cr,uid,ids,*a):
- return self.write(cr,uid,ids, {'state':'unsold'})
- def button_taken_away(self,cr,uid,ids,*a):
- return self.write(cr,uid,ids, {'state':'taken_away'})
+ def button_not_bought(self, cr, uid, ids, context=None):
+ if not context:
+ context={}
+ return self.write(cr, uid, ids, {'state':'unsold'})
+
+ def button_taken_away(self, cr, uid, ids, context=None):
+ if not context:
+ context={}
+ return self.write(cr, uid, ids, {'state':'taken_away', 'ach_emp': True})
- def button_unpaid(self,cr,uid,ids,*a):
- return self.write(cr,uid,ids, {'state':'draft'})
+ def button_unpaid(self, cr, uid, ids, context=None):
+ if not context:
+ context={}
+ return self.write(cr, uid, ids, {'state':'draft'})
- def button_draft(self,cr,uid,ids,*a):
- return self.write(cr,uid,ids, {'state':'draft'})
+ def button_bought(self, cr, uid, ids, context=None):
+ if not context:
+ context={}
+ return self.write(cr, uid, ids, {'state':'sold'})
- def button_bought(self,cr,uid,ids,*a):
- return self.write(cr,uid,ids, {'state':'sold'})
-
- def _buyerprice(self, cr, uid, ids, name, args, context):
- res={}
- lots=self.pool.get('auction.lots').browse(cr,uid,ids)
- pt_tax=self.pool.get('account.tax')
+ def _getprice(self, cr, uid, ids, fields, args, context=None):
+ """This Function compute amount total with tax for buyer and seller.
+ @param ids: List of auction lots's id
+ @param name: List of function fields.
+ @param context: A standard dictionary for contextual values
+ @return: Dictionary of function fields value.
+ """
+ if not context:
+ context = {}
+
+ res = {}
+ account_analytic_line_obj = self.pool.get('account.analytic.line')
+ lots = self.browse(cr, uid, ids, context)
+ pt_tax = self.pool.get('account.tax')
for lot in lots:
- amount_total=0.0
- # if ((lot.obj_price==0) and (lot.state=='draft')):
- # montant=lot.lot_est1
- # else:
- montant=lot.obj_price or 0.0
- taxes = []
- if lot.author_right:
- taxes.append(lot.author_right)
- if lot.auction_id:
- taxes += lot.auction_id.buyer_costs
- tax=pt_tax.compute(cr,uid,taxes,montant,1)
- for t in tax:
- amount_total+=t['amount']
- amount_total += montant
- res[lot.id] = amount_total
- return res
-
-
- def _sellerprice(self, cr, uid, ids,*a):
- res={}
- lots=self.pool.get('auction.lots').browse(cr,uid,ids)
- pt_tax=self.pool.get('account.tax')
- for lot in lots:
- amount_total=0.0
- # if ((lot.obj_price==0) and (lot.state=='draft')):
- # montant=lot.lot_est1
- # else:
- montant=lot.obj_price
- taxes = []
- if lot.bord_vnd_id.tax_id:
- taxes.append(lot.bord_vnd_id.tax_id)
- elif lot.auction_id and lot.auction_id.seller_costs:
- taxes += lot.auction_id.seller_costs
- tax=pt_tax.compute(cr,uid,taxes,montant,1)
- for t in tax:
- amount_total+=t['amount']
- res[lot.id] = montant+amount_total
- return res
-
- def _grossprice(self, cr, uid, ids, name, args, context):
- """gross revenue"""
- res={}
- auction_lots_obj = self.read(cr,uid,ids,['seller_price','buyer_price','auction_id'])
- for auction_data in auction_lots_obj:
total_tax = 0.0
- if auction_data['auction_id']:
- total_tax += auction_data['buyer_price']-auction_data['seller_price']
- res[auction_data['id']] = total_tax
+ taxes = []
+ for name in fields:
+ res[lot.id] = {name: False}
+ amount = lot.obj_price or 0.0
+ result = 0.0
+ if name == "buyer_price":
+ if lot.author_right:
+ taxes.append(lot.author_right)
+ if lot.auction_id:
+ taxes += lot.auction_id.buyer_costs
+ tax = pt_tax.compute_all(cr, uid, taxes, amount, 1)['taxes']
+ for t in tax:
+ result += t['amount']
+ result += amount
+ elif name == "seller_price":
+ if lot.bord_vnd_id.tax_id:
+ taxes.append(lot.bord_vnd_id.tax_id)
+ elif lot.auction_id and lot.auction_id.seller_costs:
+ taxes += lot.auction_id.seller_costs
+ tax = pt_tax.compute_all(cr, uid, taxes, amount, 1)['taxes']
+ for t in tax:
+ result += t['amount']
+ result += amount
+ elif name == "gross_revenue":
+ if lot.auction_id:
+ result = lot.buyer_price - lot.seller_price
+ elif name == "net_revenue":
+ if lot.auction_id:
+ result = lot.buyer_price - lot.seller_price - lot.costs
+
+ elif name == "net_margin":
+ if ((lot.obj_price==0) and (lot.state=='draft')):
+ amount = lot.lot_est1
+ else:
+ amount = lot.obj_price
+ if amount > 0:
+ result = (lot.net_revenue * 100) / amount
+ 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)
+ som = 0.0
+ if lot.auction_id:
+ auct_id = lot.auction_id.id
+ lot_count = self.search(cr, uid, [('auction_id', '=', auct_id)], count=True)
+ line_ids = account_analytic_line_obj.search(cr, uid, [
+ ('account_id', '=', lot.auction_id.account_analytic_id.id),
+ ('journal_id', '<>', lot.auction_id.journal_id.id),
+ ('journal_id', '<>', lot.auction_id.journal_seller_id.id)])
+ indir_cost = lot.bord_vnd_id.specific_cost_ids
+ for r in lot.bord_vnd_id.specific_cost_ids:
+ som += r.amount
+ for line in account_analytic_line_obj.browse(cr, uid, line_ids, context=context):
+ if line.amount:
+ som -= line.amount
+ result = som/lot_count
+
+ elif name=="paid_ach":
+ result = False
+ if lot.ach_inv_id and lot.ach_inv_id.state == 'paid':
+ result = True
+
+ elif name=="paid_vnd":
+ result = False
+ if lot.sel_inv_id and lot.sel_inv_id.state == 'paid':
+ result = True
+
+ res[lot.id][name] = result
+
+
return res
-
- def _grossmargin(self, cr, uid, ids, name, args, context):
- """
- gross Margin : Gross revenue * 100 / Adjudication
- (state==unsold or obj_ret_price>0): adj_price = 0 (=> gross margin = 0, net margin is negative)
- """
- res={}
- for lot in self.browse(cr, uid, ids, context):
- if ((lot.obj_price==0) and (lot.state=='draft')):
- montant=lot.lot_est1
- else:
- montant=lot.obj_price
- if lot.obj_price>0:
- total=(lot.gross_revenue*100.0) /lot.obj_price
- else:
- total = 0.0
- res[lot.id]=round(total,2)
- return res
-
- def onchange_obj_ret(self, cr, uid, ids, obj_ret, *args):
+ def onchange_obj_ret(self, cr, uid, ids, obj_ret, context=None):
+ if not context:
+ context={}
if obj_ret:
return {'value': {'obj_price': 0}}
return {}
- def _costs(self,cr,uid,ids,context,*a):
- """
- costs: Total credit of analytic account
- / # objects sold during this auction
- (excluding analytic lines that are in the analytic journal of the auction date).
- """
- res={}
- for lot in self.browse(cr,uid,ids):
- som=0.0
- if not lot.auction_id:
- res[lot.id] = 0.0
- continue
- auct_id=lot.auction_id.id
- cr.execute('select count(*) from auction_lots where auction_id=%s', (auct_id,))
- nb = cr.fetchone()[0]
- account_analytic_line_obj = self.pool.get('account.analytic.line')
- line_ids = account_analytic_line_obj.search(cr, uid, [('account_id', '=', lot.auction_id.account_analytic_id.id),('journal_id', '<>', lot.auction_id.journal_id.id),('journal_id', '<>', lot.auction_id.journal_seller_id.id)])
- #indir_cost=lot.bord_vnd_id.specific_cost_ids
- #for r in lot.bord_vnd_id.specific_cost_ids:
- # som+=r.amount
-
- for line in account_analytic_line_obj.browse(cr,uid,line_ids):
- if line.amount:
- som-=line.amount
- res[lot.id]=som/nb
- return res
-
- def _netprice(self, cr, uid, ids, name, args, context):
- """This is the net revenue"""
- res={}
- auction_lots_obj = self.read(cr,uid,ids,['seller_price','buyer_price','auction_id','costs'])
- for auction_data in auction_lots_obj:
- total_tax = 0.0
- if auction_data['auction_id']:
- total_tax += auction_data['buyer_price']-auction_data['seller_price']-auction_data['costs']
- res[auction_data['id']] = total_tax
- return res
-
- def _netmargin(self, cr, uid, ids, name, args, context):
- res={}
- total_tax = 0.0
- total=0.0
- montant=0.0
- auction_lots_obj = self.read(cr,uid,ids,['net_revenue','auction_id','lot_est1','obj_price','state'])
- for auction_data in auction_lots_obj:
- if ((auction_data ['obj_price']==0) and (auction_data['state']=='draft')):
- montant=auction_data['lot_est1']
- else: montant=auction_data ['obj_price']
- if montant>0:
- total_tax += (auction_data['net_revenue']*100)/montant
- else:
- total_tax=0
- res[auction_data['id']] = total_tax
- return res
-
- def _is_paid_vnd(self,cr,uid,ids,*a):
- res = {}
- lots=self.browse(cr,uid,ids)
- for lot in lots:
- res[lot.id] = False
- if lot.sel_inv_id:
- if lot.sel_inv_id.state == 'paid':
- res[lot.id] = True
- return res
- def _is_paid_ach(self,cr,uid,ids,*a):
- res = {}
- lots=self.browse(cr,uid,ids)
- for lot in lots:
- res[lot.id] = False
- if lot.ach_inv_id:
- if lot.ach_inv_id.state == 'paid':
- res[lot.id] = True
- return res
_columns = {
- 'bid_lines':fields.one2many('auction.bid_line','lot_id', 'Bids'),
- 'auction_id': fields.many2one('auction.dates', 'Auction Date', select=1),
- 'bord_vnd_id': fields.many2one('auction.deposit', 'Depositer Inventory', required=True),
- 'name': fields.char('Short Description',size=64, required=True),
- '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'),
- 'lot_est1': fields.float('Minimum Estimation'),
- 'lot_est2': fields.float('Maximum Estimation'),
- 'lot_num': fields.integer('List Number', required=True, select=1 ),
- '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),
- 'artist_id':fields.many2one('auction.artists', 'Artist/Author'),
- 'artist2_id':fields.many2one('auction.artists', 'Artist/Author 2'),
- 'important':fields.boolean('To be Emphatized'),
- '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'),
- 'obj_comm': fields.boolean('Commission'),
- 'obj_price': fields.float('Adjudication price'),
- 'ach_avance': fields.float('Buyer Advance'),
- 'ach_login': fields.char('Buyer Username',size=64),
- 'ach_uid': fields.many2one('res.partner', 'Buyer'),
- 'ach_emp': fields.boolean('Taken Away'),
- 'is_ok': fields.boolean('Buyer\'s payment'),
- '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'),
- 'vnd_lim_net': fields.boolean('Net limit ?',readonly=True),
- 'image': fields.binary('Image'),
-# 'paid_vnd':fields.function(_is_paid_vnd,string='Seller Paid',method=True,type='boolean',store=True),
- 'paid_vnd':fields.boolean('Seller Paid'),
- 'paid_ach':fields.function(_is_paid_ach,string='Buyer invoice reconciled',method=True, type='boolean',store=True),
+ 'bid_lines':fields.one2many('auction.bid_line', 'lot_id', 'Bids'),
+ 'auction_id': fields.many2one('auction.dates', 'Auction Date', select=1),
+ 'bord_vnd_id': fields.many2one('auction.deposit', 'Depositer Inventory', required=True),
+ 'name': fields.char('Short Description', size=64, required=True),
+ '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'),
+ 'lot_est1': fields.float('Minimum Estimation'),
+ 'lot_est2': fields.float('Maximum Estimation'),
+ 'lot_num': fields.integer('List Number', required=True, select=1),
+ '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),
+ 'artist_id':fields.many2one('auction.artists', 'Artist/Author'),
+ 'artist2_id':fields.many2one('auction.artists', 'Artist/Author 2'),
+ 'important':fields.boolean('To be Emphatized'),
+ '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'),
+ 'obj_comm': fields.boolean('Commission'),
+ 'obj_price': fields.float('Adjudication price'),
+ 'ach_avance': fields.float('Buyer Advance'),
+ 'ach_login': fields.char('Buyer Username', size=64),
+ 'ach_uid': fields.many2one('res.partner', 'Buyer'),
+ 'ach_emp': fields.boolean('Taken Away', readonly=True),
+ 'is_ok': fields.boolean('Buyer\'s payment'),
+ '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'),
+ 'vnd_lim_net': fields.boolean('Net limit ?', readonly=True),
+ 'image': fields.binary('Image'),
+ 'paid_vnd':fields.function(_getprice, string='Seller Paid', method=True, type='boolean', store=True, multi="paid_vnd"),
+ 'paid_ach':fields.function(_getprice, string='Buyer invoice reconciled', method=True, type='boolean', store=True, multi="paid_ach"),
'state': fields.selection((
- ('draft','Draft'),
- ('unsold','Unsold'),
- ('paid','Paid'),
- ('sold','Sold'),
- ('taken_away','Taken away')),'State', required=True, readonly=True,
+ ('draft', 'Draft'),
+ ('unsold', 'Unsold'),
+ ('paid', 'Paid'),
+ ('sold', 'Sold'),
+ ('taken_away', 'Taken away')), 'State', required=True, readonly=True,
help=' * The \'Draft\' state is used when a object is encoding as a new object. \
\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(_buyerprice, method=True, string='Buyer price',store=True),
- 'seller_price': fields.function(_sellerprice, method=True, string='Seller price',store=True),
- 'gross_revenue':fields.function(_grossprice, method=True, string='Gross revenue',store=True),
- 'gross_margin':fields.function(_grossmargin, method=True, string='Gross Margin (%)',store=True),
- 'costs':fields.function(_costs,method=True,string='Indirect costs',store=True),
- 'statement_id': fields.many2many('account.bank.statement.line', 'auction_statement_line_rel','auction_id', 'statement','Payment'),
- 'net_revenue':fields.function(_netprice, method=True, string='Net revenue',store=True),
- 'net_margin':fields.function(_netmargin, method=True, string='Net Margin (%)',store=True),
+ \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"),
+ 'seller_price': fields.function(_getprice, method=True, string='Seller price', store=True, multi="seller_price"),
+ 'gross_revenue':fields.function(_getprice, method=True, string='Gross revenue', store=True, multi="gross_revenue"),
+ 'gross_margin':fields.function(_getprice, method=True, string='Gross Margin (%)', store=True, multi="gross_margin"),
+ 'costs':fields.function(_getprice, method=True, string='Indirect costs', store=True, multi="costs"),
+ 'statement_id': fields.many2many('account.bank.statement.line', 'auction_statement_line_rel', 'auction_id', 'statement', 'Payment'),
+ 'net_revenue':fields.function(_getprice, method=True, string='Net revenue', store=True, multi="net_revenue"),
+ 'net_margin':fields.function(_getprice, method=True, string='Net Margin (%)', store=True, multi="net_margin"),
}
_defaults = {
- 'state':lambda *a: 'draft',
- 'lot_num':lambda *a:1,
- 'is_ok': lambda *a: False
+ 'state':lambda *a: 'draft',
+ 'lot_num':lambda *a:1,
+ 'is_ok': lambda *a: False,
}
- _constraints = [
-# (_inv_constraint, 'Twice the same inventory number !', ['lot_num','bord_vnd_id'])
- ]
-
-
- def name_get(self, cr, user, ids, context={}):
- if not len(ids):
+
+ def name_get(self, cr, user, ids, context=None):
+ if not context:
+ context={}
+ if not ids:
return []
- result = [ (r['id'], str(r['obj_num'])+' - '+r['name']) for r in self.read(cr, user, ids, ['name','obj_num'])]
+ result = [ (r['id'], str(r['obj_num'])+' - '+r['name']) for r in self.read(cr, user, ids, ['name', 'obj_num'])]
return result
- def name_search(self, cr, user, name, args=None, operator='ilike', context={}):
- if not len(args):
+ def name_search(self, cr, user, name, args=None, operator='ilike', context=None):
+ if not context:
+ context={}
+ if not args:
args = []
ids = []
if name:
- ids = self.search(cr, user, [('obj_num','=',int(name))] + args)
+ ids = self.search(cr, user, [('obj_num', '=', int(name))] + args)
if not ids:
- ids = self.search(cr, user, [('name',operator,name)] + args)
+ ids = self.search(cr, user, [('name', operator, name)] + args)
return self.name_get(cr, user, ids)
def _sum_taxes_by_type_and_id(self, taxes):
@@ -518,7 +439,7 @@ class auction_lots(osv.osv):
def compute_buyer_costs(self, cr, uid, ids):
amount_total = {}
lots = self.browse(cr, uid, ids)
-##CHECKME: est-ce que ca vaudrait la peine de faire des groupes de lots qui ont les memes couts pour passer des listes de lots a compute?
+ ##CHECKME: Is that AC would be worthwhile to make groups of lots that have the same costs to spend a lot of lists compute?
taxes = []
amount=0.0
pt_tax = self.pool.get('account.tax')
@@ -528,39 +449,27 @@ class auction_lots(osv.osv):
taxes.append(lot.author_right)
elif lot.auction_id:
taxes += lot.auction_id.buyer_costs
- tax=pt_tax.compute(cr,uid,taxes,lot.obj_price,1)
+ tax=pt_tax.compute_all(cr, uid, taxes, lot.obj_price, 1)['taxes']
for t in tax:
amount+=t['amount']
- #amount+=lot.obj_price*0.2
- #amount+=lot.obj_price
amount_total['value']= amount
amount_total['amount']= amount
+
return amount_total
-
-# for t in taxes_res:
-# t.update({'type': 0})
-# return self._sum_taxes_by_type_and_id(taxes_res)
-
-# lots=self.browse(cr,uid,ids)
-# amount=0.0
-# for lot in lots:
-# taxes=lot.product_id.taxe_id
-
-
def _compute_lot_seller_costs(self, cr, uid, lot, manual_only=False):
costs = []
tax_cost_ids=[]
-# tax_cost_ids = [i.id for i in lot.auction_id.seller_costs]
- # if there is a specific deposit cost for this depositer, add it
+
border_id = lot.bord_vnd_id
if border_id:
if border_id.tax_id:
tax_cost_ids.append(border_id.tax_id)
elif lot.auction_id and lot.auction_id.seller_costs:
tax_cost_ids += lot.auction_id.seller_costs
- tax_costs = self.pool.get('account.tax').compute(cr, uid, tax_cost_ids, lot.obj_price, 1)
+
+ tax_costs = self.pool.get('account.tax').compute_all(cr, uid, tax_cost_ids, lot.obj_price, 1)['taxes']
# delete useless keys from the costs computed by the tax object... this is useless but cleaner...
for cost in tax_costs:
del cost['account_paid_id']
@@ -572,16 +481,16 @@ class auction_lots(osv.osv):
c.update({'type': 0})
######
if lot.vnd_lim_net<0 and lot.obj_price>0:
-#FIXME: la string 'remise lot' devrait passer par le systeme de traductions
+ #FIXME:the string passes have lot 'should go through the system translations.
obj_price_wh_costs = reduce(lambda x, y: x + y['amount'], tax_costs, lot.obj_price)
if obj_price_wh_costs < lot.vnd_lim:
- costs.append({ 'type': 1,
- 'id': lot.obj_num,
- 'name': 'Remise lot '+ str(lot.obj_num),
+ costs.append({ 'type': 1,
+ 'id': lot.obj_num,
+ 'name': 'Remise lot '+ str(lot.obj_num),
'amount': lot.vnd_lim - obj_price_wh_costs}
- #'account_id': lot.auction_id.acc_refund.id
)
return costs
+
def compute_seller_costs(self, cr, uid, ids, manual_only=False):
lots = self.browse(cr, uid, ids)
costs = []
@@ -613,27 +522,30 @@ class auction_lots(osv.osv):
total_cost += c['amount']
costs.extend(bord_costs)
if (total_adj+total_cost)<0:
-#FIXME: translate tax name
+ #FIXME: translate tax name
new_id = bord and bord.id or 0
- c = {'type':3, 'id':new_id, 'amount':-total_cost-total_adj, 'name':'Ristourne'}#, 'account_id':lots[0].auction_id.acc_refund.id}
+ c = {'type':3, 'id':new_id, 'amount':-total_cost-total_adj, 'name':'Ristourne'}
costs.append(c)
return self._sum_taxes_by_type_and_id(costs)
# sum remise limite net and ristourne
def compute_seller_costs_summed(self, cr, uid, ids): #ach_pay_id
+
+ """This Fuction sum Net remittance limit and refund"""
+
taxes = self.compute_seller_costs(cr, uid, ids)
taxes_summed = {}
for tax in taxes:
if tax['type'] == 1:
tax['id'] = 0
- #FIXME: translate tax names
- tax['name'] = 'Remise limite nette'
+ #FIXME: translate tax names
+ tax['name'] = 'Discount sharp boundary'
elif tax['type'] == 2:
tax['id'] = 0
- tax['name'] = 'Frais divers'
+ tax['name'] = 'Miscellaneous expenditure'
elif tax['type'] == 3:
tax['id'] = 0
- tax['name'] = 'Rist.'
+ tax['name'] = 'Cross.'
key = (tax['type'], tax['id'])
if key in taxes_summed:
taxes_summed[key]['amount'] += tax['amount']
@@ -641,14 +553,16 @@ class auction_lots(osv.osv):
taxes_summed[key] = tax
return taxes_summed.values()
- def buyer_proforma(self,cr,uid,ids,context):
+ def buyer_proforma(self, cr, uid, ids, context=None):
+
+ if not context:
+ context={}
invoices = {}
inv_ref = self.pool.get('account.invoice')
- partner_r = self.pool.get('res.partner')
+ res_obj = self.pool.get('res.partner')
inv_line_obj = self.pool.get('account.invoice.line')
wf_service = netsvc.LocalService('workflow')
-# acc_receiv=self.pool.get('account.account').search([cr,uid,[('code','=','4010')]])
- for lot in self.browse(cr,uid,ids,context):
+ for lot in self.browse(cr, uid, ids, context):
if not lot.obj_price>0:
continue
if not lot.ach_uid.id:
@@ -656,23 +570,23 @@ class auction_lots(osv.osv):
else:
partner_ref =lot.ach_uid.id
lot_name = lot.obj_num
- res = partner_r.address_get(cr, uid, [partner_ref], ['contact', 'invoice'])
+ res = res_obj.address_get(cr, uid, [partner_ref], ['contact', 'invoice'])
contact_addr_id = res['contact']
invoice_addr_id = res['invoice']
if not invoice_addr_id:
raise orm.except_orm(_('No Invoice Address'), _('The Buyer "%s" has no Invoice Address.') % (contact_addr_id,))
inv = {
- 'name': 'Auction proforma:' +lot.name,
- 'journal_id': lot.auction_id.journal_id.id,
- 'partner_id': partner_ref,
- 'type': 'out_invoice',
+ 'name': 'Auction proforma:' +lot.name,
+ 'journal_id': lot.auction_id.journal_id.id,
+ 'partner_id': partner_ref,
+ 'type': 'out_invoice',
# 'state':'proforma',
}
- inv.update(inv_ref.onchange_partner_id(cr,uid, [], 'out_invoice', partner_ref)['value'])
+ inv.update(inv_ref.onchange_partner_id(cr, uid, [], 'out_invoice', partner_ref)['value'])
inv['account_id'] = inv['account_id'] and inv['account_id'][0]
inv_id = inv_ref.create(cr, uid, inv, context)
invoices[partner_ref] = inv_id
- self.write(cr,uid,[lot.id],{'ach_inv_id':inv_id,'state':'sold'})
+ self.write(cr, uid, [lot.id], {'ach_inv_id':inv_id, 'state':'sold'})
#calcul des taxes
taxes = map(lambda x: x.id, lot.product_id.taxes_id)
@@ -681,37 +595,35 @@ class auction_lots(osv.osv):
taxes.append(lot.author_right.id)
inv_line= {
- 'invoice_id': inv_id,
- 'quantity': 1,
- 'product_id': lot.product_id.id,
- 'name': 'proforma'+'['+str(lot.obj_num)+'] '+ lot.name,
- 'invoice_line_tax_id': [(6,0,taxes)],
- 'account_analytic_id': lot.auction_id.account_analytic_id.id,
- 'account_id': lot.auction_id.acc_income.id,
- 'price_unit': lot.obj_price,
+ 'invoice_id': inv_id,
+ 'quantity': 1,
+ 'product_id': lot.product_id.id,
+ 'name': 'proforma'+'['+str(lot.obj_num)+'] '+ lot.name,
+ 'invoice_line_tax_id': [(6, 0, taxes)],
+ 'account_analytic_id': lot.auction_id.account_analytic_id.id,
+ 'account_id': lot.auction_id.acc_income.id,
+ 'price_unit': lot.obj_price,
}
- inv_line_obj.create(cr, uid, inv_line,context)
- # inv_ref.button_compute(cr, uid, [inv_id])
- # wf_service = netsvc.LocalService('workflow')
- # wf_service.trg_validate(uid, 'account.invoice', inv_id, 'invoice_open', cr)
+ inv_line_obj.create(cr, uid, inv_line, context)
inv_ref.button_compute(cr, uid, invoice.values())
wf_service.trg_validate(uid, 'account.invoice', inv_id, 'invoice_proforma2', cr)
return invoices.values()
-
# creates the transactions between the auction company and the seller
# this is done by creating a new in_invoice for each
- def seller_trans_create(self,cr, uid,ids,context):
+ def seller_trans_create(self, cr, uid, ids, context=None):
"""
Create a seller invoice for each bord_vnd_id, for selected ids.
"""
# use each list of object in turn
invoices = {}
+ if not context:
+ context={}
inv_ref=self.pool.get('account.invoice')
partner_obj = self.pool.get('res.partner')
inv_line_obj = self.pool.get('account.invoice.line')
wf_service = netsvc.LocalService('workflow')
- for lot in self.browse(cr,uid,ids,context):
+ for lot in self.browse(cr, uid, ids, context):
partner_id = lot.bord_vnd_id.partner_id.id
if not lot.auction_id.id:
continue
@@ -723,17 +635,16 @@ class auction_lots(osv.osv):
contact_addr_id = res['contact']
invoice_addr_id = res['invoice']
inv = {
- 'name': 'Auction:' +lot.name,
- 'journal_id': lot.auction_id.journal_seller_id.id,
- 'partner_id': lot.bord_vnd_id.partner_id.id,
- 'type': 'in_invoice',
+ 'name': 'Auction:' +lot.name,
+ 'journal_id': lot.auction_id.journal_seller_id.id,
+ 'partner_id': lot.bord_vnd_id.partner_id.id,
+ 'type': 'in_invoice',
}
- inv.update(inv_ref.onchange_partner_id(cr,uid, [], 'in_invoice', lot.bord_vnd_id.partner_id.id)['value'])
- # inv['account_id'] = inv['account_id'] and inv['account_id'][0]
+ inv.update(inv_ref.onchange_partner_id(cr, uid, [], 'in_invoice', lot.bord_vnd_id.partner_id.id)['value'])
inv_id = inv_ref.create(cr, uid, inv, context)
invoices[lot.bord_vnd_id.id] = inv_id
- self.write(cr,uid,[lot.id],{'sel_inv_id':inv_id,'state':'sold'})
+ self.write(cr, uid, [lot.id], {'sel_inv_id':inv_id, 'state':'sold'})
taxes = map(lambda x: x.id, lot.product_id.taxes_id)
if lot.bord_vnd_id.tax_id:
@@ -742,16 +653,16 @@ class auction_lots(osv.osv):
taxes += map(lambda x: x.id, lot.auction_id.seller_costs)
inv_line= {
- 'invoice_id': inv_id,
- 'quantity': 1,
- 'product_id': lot.product_id.id,
- 'name': '['+str(lot.obj_num)+'] '+lot.auction_id.name,
- 'invoice_line_tax_id': [(6,0,taxes)],
- 'account_analytic_id': lot.auction_id.account_analytic_id.id,
- 'account_id': lot.auction_id.acc_expense.id,
- 'price_unit': lot.obj_price,
+ 'invoice_id': inv_id,
+ 'quantity': 1,
+ 'product_id': lot.product_id.id,
+ 'name': '['+str(lot.obj_num)+'] '+lot.auction_id.name,
+ 'invoice_line_tax_id': [(6, 0, taxes)],
+ 'account_analytic_id': lot.auction_id.account_analytic_id.id,
+ 'account_id': lot.auction_id.acc_expense.id,
+ 'price_unit': lot.obj_price,
}
- inv_line_obj.create(cr, uid, inv_line,context)
+ inv_line_obj.create(cr, uid, inv_line, context)
inv_ref.button_compute(cr, uid, invoices.values())
for inv in inv_ref.browse(cr, uid, invoices.values(), context):
inv_ref.write(cr, uid, [inv.id], {
@@ -760,7 +671,7 @@ class auction_lots(osv.osv):
wf_service.trg_validate(uid, 'account.invoice', inv.id, 'invoice_open', cr)
return invoices.values()
- def lots_invoice(self, cr, uid, ids, context,invoice_number=False):
+ def lots_invoice(self, cr, uid, ids, context, invoice_number=False):
"""(buyer invoice
Create an invoice for selected lots (IDS) to BUYER_ID.
Set created invoice to the ACTION state.
@@ -773,38 +684,36 @@ class auction_lots(osv.osv):
"""
dt = time.strftime('%Y-%m-%d')
inv_ref = self.pool.get('account.invoice')
- partner_r = self.pool.get('res.partner')
+ res_obj = self.pool.get('res.partner')
inv_line_obj = self.pool.get('account.invoice.line')
wf_service = netsvc.LocalService('workflow')
invoices={}
- for lot in self.browse(cr, uid, ids,context):
- # partner_ref = lot.ach_uid.id
+ for lot in self.browse(cr, uid, ids, context):
if not lot.auction_id.id:
continue
if not lot.ach_uid.id:
raise orm.except_orm(_('Missed buyer !'), _('The object "%s" has no buyer assigned.') % (lot.name,))
- if (lot.auction_id.id,lot.ach_uid.id) in invoices:
- inv_id = invoices[(lot.auction_id.id,lot.ach_uid.id)]
+ if (lot.auction_id.id, lot.ach_uid.id) in invoices:
+ inv_id = invoices[(lot.auction_id.id, lot.ach_uid.id)]
else:
- add = partner_r.read(cr, uid, [lot.ach_uid.id], ['address'])[0]['address']
+ add = res_obj.read(cr, uid, [lot.ach_uid.id], ['address'])[0]['address']
if not len(add):
raise orm.except_orm(_('Missed Address !'), _('The Buyer has no Invoice Address.'))
price = lot.obj_price or 0.0
lot_name =lot.obj_num
inv = {
- 'name':lot.auction_id.name or '',
- 'reference': lot.ach_login,
- 'journal_id': lot.auction_id.journal_id.id,
- 'partner_id': lot.ach_uid.id,
- 'type': 'out_invoice',
+ 'name':lot.auction_id.name or '',
+ 'reference': lot.ach_login,
+ 'journal_id': lot.auction_id.journal_id.id,
+ 'partner_id': lot.ach_uid.id,
+ 'type': 'out_invoice',
}
if invoice_number:
inv['number'] = invoice_number
- inv.update(inv_ref.onchange_partner_id(cr,uid, [], 'out_invoice', lot.ach_uid.id)['value'])
- #inv['account_id'] = inv['account_id'] and inv['account_id'][0]
+ inv.update(inv_ref.onchange_partner_id(cr, uid, [], 'out_invoice', lot.ach_uid.id)['value'])
inv_id = inv_ref.create(cr, uid, inv, context)
- invoices[(lot.auction_id.id,lot.ach_uid.id)] = inv_id
- self.write(cr,uid,[lot.id],{'ach_inv_id':inv_id,'state':'sold'})
+ invoices[(lot.auction_id.id, lot.ach_uid.id)] = inv_id
+ self.write(cr, uid, [lot.id], {'ach_inv_id':inv_id, 'state':'sold'})
#calcul des taxes
taxes = map(lambda x: x.id, lot.product_id.taxes_id)
taxes+=map(lambda x:x.id, lot.auction_id.buyer_costs)
@@ -812,57 +721,43 @@ class auction_lots(osv.osv):
taxes.append(lot.author_right.id)
inv_line= {
- 'invoice_id': inv_id,
- 'quantity': 1,
- 'product_id': lot.product_id.id,
- 'name': '['+str(lot.obj_num)+'] '+ lot.name,
- 'invoice_line_tax_id': [(6,0,taxes)],
- 'account_analytic_id': lot.auction_id.account_analytic_id.id,
- 'account_id': lot.auction_id.acc_income.id,
- 'price_unit': lot.obj_price,
+ 'invoice_id': inv_id,
+ 'quantity': 1,
+ 'product_id': lot.product_id.id,
+ 'name': '['+str(lot.obj_num)+'] '+ lot.name,
+ 'invoice_line_tax_id': [(6, 0, taxes)],
+ 'account_analytic_id': lot.auction_id.account_analytic_id.id,
+ 'account_id': lot.auction_id.acc_income.id,
+ 'price_unit': lot.obj_price,
}
- inv_line_obj.create(cr, uid, inv_line,context)
- # inv_ref.button_compute(cr, uid, [inpq tu dis cav_id])
- # inv_ref.button_compute(cr, uid, [inv_id])
+ inv_line_obj.create(cr, uid, inv_line, context)
inv_ref.button_compute(cr, uid, [inv_id])
for l in inv_ref.browse(cr, uid, invoices.values(), context):
- # wf_service.trg_validate(uid, 'account.invoice',l.id, 'invoice_proforma', cr)
- wf_service.trg_validate(uid, 'account.invoice',l.id, 'invoice_open', cr)
+ wf_service.trg_validate(uid, 'account.invoice', l.id, 'invoice_open', cr)
return invoices.values()
-
- def numerotate(self, cr, uid, ids):
- cr.execute('select auction_id from auction_lots where id=%s', (ids[0],))
- auc_id = cr.fetchone()[0]
- cr.execute('select max(obj_num) from auction_lots where auction_id=%s', (auc_id,))
- try:
- max = cr.fetchone()[0]
- except:
- max = 0
- for id in ids:
- max+=1
- cr.execute('update auction_lots set obj_num=%s where id=%s', (max, id))
- return []
-
auction_lots()
#----------------------------------------------------------
# Auction Bids
#----------------------------------------------------------
class auction_bid(osv.osv):
+ """Bid Auctions"""
+
_name = "auction.bid"
- _description="Bid auctions"
+ _description=__doc__
_order = 'id desc'
_columns = {
- 'partner_id': fields.many2one('res.partner', 'Buyer Name', required=True),
- 'contact_tel':fields.char('Contact',size=64),
- 'name': fields.char('Bid ID', size=64,required=True),
- 'auction_id': fields.many2one('auction.dates', 'Auction Date', required=True),
- 'bid_lines': fields.one2many('auction.bid_line', 'bid_id', 'Bid'),
+ 'partner_id': fields.many2one('res.partner', 'Buyer Name', required=True),
+ 'contact_tel':fields.char('Contact', size=64),
+ 'name': fields.char('Bid ID', size=64, required=True),
+ 'auction_id': fields.many2one('auction.dates', 'Auction Date', required=True),
+ 'bid_lines': fields.one2many('auction.bid_line', 'bid_id', 'Bid'),
}
_defaults = {
- 'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'auction.bid'),
+ 'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'auction.bid'),
}
+
def onchange_contact(self, cr, uid, ids, partner_id):
if not partner_id:
return {'value': {'contact_tel':False}}
@@ -876,13 +771,15 @@ class auction_bid(osv.osv):
auction_bid()
class auction_lot_history(osv.osv):
+ """Lot History"""
+
_name = "auction.lot.history"
- _description="Lot history"
+ _description=__doc__
_columns = {
- 'name': fields.date('Date',size=64),
- 'lot_id': fields.many2one('auction.lots','Object', required=True, ondelete='cascade'),
- 'auction_id': fields.many2one('auction.dates', 'Auction date', required=True, ondelete='cascade'),
- 'price': fields.float('Withdrawn price', digits=(16,2))
+ 'name': fields.date('Date', size=64),
+ 'lot_id': fields.many2one('auction.lots', 'Object', required=True, ondelete='cascade'),
+ 'auction_id': fields.many2one('auction.dates', 'Auction date', required=True, ondelete='cascade'),
+ 'price': fields.float('Withdrawn price', digits=(16, 2))
}
_defaults = {
'name': lambda *args: time.strftime('%Y-%m-%d')
@@ -893,18 +790,12 @@ class auction_bid_lines(osv.osv):
_name = "auction.bid_line"
_description="Bid"
-# def get_nom(self,cr,uid,ids,*a):
-# res = {}
-# lots=self.browse(cr,uid,ids)
-# for lot in lots:
-# res[lot.id] = lot.lot_id.auction_id.name
-# return res
_columns = {
- 'name': fields.char('Bid date',size=64),
- 'bid_id': fields.many2one('auction.bid','Bid ID', required=True, ondelete='cascade'),
- 'lot_id': fields.many2one('auction.lots','Object', required=True, ondelete='cascade'),
- 'call': fields.boolean('To be Called'),
- 'price': fields.float('Maximum Price'),
+ 'name': fields.char('Bid date', size=64),
+ 'bid_id': fields.many2one('auction.bid', 'Bid ID', required=True, ondelete='cascade'),
+ 'lot_id': fields.many2one('auction.lots', 'Object', required=True, ondelete='cascade'),
+ 'call': fields.boolean('To be Called'),
+ 'price': fields.float('Maximum Price'),
'auction': fields.char(string='Auction Name', size=64)
}
_defaults = {
@@ -921,516 +812,4 @@ class auction_bid_lines(osv.osv):
auction_bid_lines()
-class report_buyer_auction(osv.osv):
- _name = "report.buyer.auction"
- _description = "Auction Reporting on buyer view"
- _auto = False
- _columns = {
- 'buyer_login': fields.char('Buyer Login',size=64, readonly=True, select=1),
- 'buyer':fields.many2one('res.partner', 'Buyer', readonly=True, select=2),
- 'object':fields.integer('No of objects',readonly=True, select=1),
- 'total_price':fields.float('Total Adj.', digits=(16,2), readonly=True, select=2),
- 'avg_price':fields.float('Avg Adj.', digits=(16,2), readonly=True, select=2),
- 'date': fields.date('Create Date', select=1),
- 'auction': fields.many2one('auction.dates', 'Auction date',readonly=True, select=1),
-
- }
-
- def init(self, cr):
- cr.execute('''
- create or replace view report_buyer_auction as (
- select
- min(al.id) as id,
- al.ach_login as "buyer_login",
- to_char(al.create_date, 'YYYY-MM-01') as date,
- al.ach_uid as "buyer",
- ad.id as auction,
- count(al.id) as "object",
- sum(al.obj_price) as "total_price",
- (sum(al.obj_price)/count(al.id)) as "avg_price"
- from
- auction_lots al,
- auction_dates ad
- where
- ad.id=al.auction_id
- group by
- to_char(al.create_date, 'YYYY-MM-01'),
- al.ach_uid,
- ad.id,
- al.ach_login
- )''')
-report_buyer_auction()
-
-class report_buyer_auction2(osv.osv):
- _name = "report.buyer.auction2"
- _description = "Auction Reporting on buyer view"
- _auto = False
- _columns = {
- 'auction': fields.many2one('auction.dates', 'Auction date',readonly=True, select=1),
- 'buyer_login': fields.char('Buyer Login',size=64, readonly=True, select=True),
- 'buyer':fields.many2one('res.partner', 'Buyer', readonly=True, select=2),
- 'sumadj':fields.float('Sum of adjustication',readonly=True),
- 'gross_revenue':fields.float('Gross Revenue', readonly=True),
- 'net_revenue':fields.float('Net Revenue', readonly=True),
- 'net_margin':fields.float('Net Margin', readonly=True),
- 'date': fields.date('Create Date', required=True)
- }
- def init(self, cr):
- cr.execute('''
- create or replace view report_buyer_auction2 as (
- select
- min(al.id) as id,
- to_char(al.create_date, 'YYYY-MM-01') as date,
- al.ach_login as "buyer_login",
- al.ach_uid as "buyer",
- sum(al.obj_price) as sumadj,
- ad.id as auction,
- sum(al.gross_revenue) as gross_revenue,
- sum(al.net_revenue) as net_revenue,
- avg(al.net_margin) as net_margin
- from
- auction_lots al,
- auction_dates ad
- where
- al.auction_id=ad.id
- group by
- al.ach_uid,
- al.ach_login,
- ad.id,
- to_char(al.create_date, 'YYYY-MM-01')
- )''')
-report_buyer_auction2()
-
-
-class report_seller_auction(osv.osv):
- _name = "report.seller.auction"
- _description = "Auction Reporting on seller view"
- _auto = False
- _rec_name = 'date'
- _columns = {
- 'auction': fields.many2one('auction.dates', 'Auction date',readonly=True, select=1),
- 'seller': fields.many2one('res.partner','Seller',readonly=True, select=1),
- 'object_number':fields.integer('No of Objects',readonly=True),
- 'total_price':fields.float('Total adjudication',readonly=True),
- 'avg_price':fields.float('Avg adjudication',readonly=True),
- 'avg_estimation':fields.float('Avg estimation',readonly=True),
- 'date': fields.date('Create Date', required=True, select=1),
- 'state': fields.selection((('draft','Draft'),('unsold','Unsold'),('sold','Sold')),'State',readonly=True, select=1)
- }
-
- def init(self, cr):
- cr.execute('''
- create or replace view report_seller_auction as (
- select
- adl.id as auction,
- min(al.id) as id,
- to_char(adl.auction1, 'YYYY-MM-DD') as date,
- ad.partner_id as seller,
- count(al.id) as "object_number",
- SUM(al.obj_price) as "total_price",
- (SUM(al.obj_price)/count(al.id)) as avg_price,
- sum(al.lot_est1+al.lot_est2)/2 as avg_estimation,
- al.state
- from
- auction_dates adl,
- auction_lots al,
- auction_deposit ad
- where
- al.auction_id=adl.id and ad.id=al.bord_vnd_id
- group by
- ad.partner_id,
- al.state,adl.auction1,adl.id
- )''')
-report_seller_auction()
-
-class report_seller_auction2(osv.osv):
- _name = "report.seller.auction2"
- _description = "Auction Reporting on seller view2"
- _auto = False
- _rec_name = 'date'
- _columns = {
- 'seller': fields.many2one('res.partner','Seller',readonly=True, select=1),
- 'auction': fields.many2one('auction.dates', 'Auction date',readonly=True, select=1),
- 'sum_adj':fields.float('Sum Adjustication',readonly=True, select=2),
- 'gross_revenue':fields.float('Gross revenue',readonly=True, select=2),
- 'net_revenue':fields.float('Net revenue',readonly=True, select=2),
- 'net_margin':fields.float('Net margin', readonly=True, select=2),
- 'date': fields.date('Auction date', required=1),
- }
-
- def init(self, cr):
- cr.execute('''create or replace view report_seller_auction2 as
- (select
- min(al.id) as id,
- to_char(adl.auction1, 'YYYY-MM-DD') as date,
- adl.id as auction,
- ad.partner_id as seller,
- sum(al.obj_price) as "sum_adj",
- sum(al.gross_revenue) as "gross_revenue",
- sum(al.net_revenue) as "net_revenue",
- avg(al.net_margin) as "net_margin"
- from
- auction_lots al,auction_dates adl,auction_deposit ad
- where
- adl.id=al.auction_id and ad.id=al.bord_vnd_id
- group by
- al.ach_uid,adl.auction1,adl.id,ad.partner_id)
- ''')
-
-report_seller_auction2()
-
-class report_auction_view2(osv.osv):
- _name = "report.auction.view2"
- _description = "Auction Reporting on view2"
- _auto = False
- _rec_name = 'date'
- _columns = {
- 'auction': fields.many2one('auction.dates', 'Auction date',readonly=True, select=1),
- 'sum_adj':fields.float('Sum of adjudication',readonly=True),
- 'obj_number':fields.integer('# of Objects',readonly=True),
- 'gross_revenue':fields.float('Gross revenue',readonly=True),
- 'net_revenue':fields.float('Net revenue',readonly=True),
- 'obj_margin':fields.float('Avg margin', readonly=True),
- 'obj_margin_procent':fields.float('Net margin (%)', readonly=True),
- 'date': fields.date('Auction date', required=True, select=1)
- }
- def init(self, cr):
- cr.execute('''create or replace view report_auction_view2 as (
- select
- ad.id as id,
- to_char(ad.auction1, 'YYYY-MM-DD') as date,
- ad.id as "auction",
- count(al.id) as "obj_number",
- SUM(al.obj_price) as "sum_adj",
- SUM(al.gross_revenue) as "gross_revenue",
- SUM(al.net_revenue) as "net_revenue",
- avg(al.net_revenue) as "obj_margin",
- SUM(al.net_revenue)*100/sum(al.obj_price) as "obj_margin_procent"
- from
- auction_dates ad
- left join
- auction_lots al on (al.auction_id = ad.id)
- group by
- ad.id, ad.auction1
- having
- sum(al.obj_price) <> 0
- )''')
-report_auction_view2()
-
-class report_auction_view(osv.osv):
- _name = "report.auction.view"
- _description = "Auction Reporting on view1"
- _auto = False
- _rec_name = 'auction_id'
- _columns = {
- 'auction_id': fields.many2one('auction.dates', 'Auction date',readonly=True, select=1),
- 'nobjects':fields.float('No of objects',readonly=True),
- 'nbuyer':fields.float('No of buyers',readonly=True),
- 'nseller':fields.float('No of sellers',readonly=True),
- 'min_est':fields.float('Minimum Estimation', readonly=True, select=2),
- 'max_est':fields.float('Maximum Estimation', readonly=True, select=2),
- 'adj_price':fields.float('Adjudication price', readonly=True, select=2),
- 'obj_ret':fields.integer('# obj ret', readonly=True, select=2)
- }
-
- def init(self, cr):
- cr.execute('''create or replace view report_auction_view as
- (select
- min(al.id) as id,
- al.auction_id as "auction_id",
- count(al.id) as "nobjects",
- count(al.ach_login) as "nbuyer",
- count(al.bord_vnd_id) as "nseller",
- sum(al.lot_est1) as "min_est",
- sum(al.lot_est2) as "max_est",
- (SELECT count(1) FROM auction_lots WHERE obj_ret>0) as obj_ret,
- sum(al.obj_price) as "adj_price"
- from
- auction_lots al
- group by
- al.auction_id
- )''')
-
-report_auction_view()
-
-class report_auction_object_date(osv.osv):
- _name = "report.auction.object.date"
- _description = "Objects per day"
- _auto = False
- _columns = {
- 'obj_num': fields.integer('# of Objects'),
- 'name': fields.date('Created date', select=2),
- 'month': fields.date('Month', select=1),
- 'user_id':fields.many2one('res.users', 'User',select=1),
- }
- #l.create_uid as user,
-
- def init(self, cr):
- cr.execute("""create or replace view report_auction_object_date as
- (select
- min(l.id) as id,
- to_char(l.create_date, 'YYYY-MM-DD') as name,
- to_char(l.create_date, 'YYYY-MM-01') as month,
- count(l.obj_num) as obj_num,
- l.create_uid as user_id
- from
- auction_lots l
- group by
- to_char(l.create_date, 'YYYY-MM-DD'),
- to_char(l.create_date, 'YYYY-MM-01'),
- l.create_uid
- )
- """)
-report_auction_object_date()
-
-class report_auction_estimation_adj_category(osv.osv):
- _name = "report.auction.estimation.adj.category"
- _description = "comparaison estimate/adjudication "
- _auto = False
- _rec_name='date'
- _columns = {
- 'lot_est1': fields.float('Minimum Estimation',select=2),
- 'lot_est2': fields.float('Maximum Estimation',select=2),
-# 'obj_price': fields.float('Adjudication price'),
- 'date': fields.date('Date', readonly=True,select=1),
- 'lot_type': fields.selection(_type_get, 'Object Type', size=64),
- 'adj_total': fields.float('Total Adjudication',select=2),
- 'user_id':fields.many2one('res.users', 'User', select=1)
- }
-
- def init(self, cr):
- cr.execute("""
- create or replace view report_auction_estimation_adj_category as (
- select
- min(l.id) as id,
- to_char(l.create_date, 'YYYY-MM-01') as date,
- l.lot_type as lot_type,
- sum(l.lot_est1) as lot_est1,
- sum(l.lot_est2) as lot_est2,
- sum(l.obj_price) as adj_total,
- l.create_uid as user_id
- from
- auction_lots l,auction_dates m
- where
- l.auction_id=m.id and l.obj_price >0
- group by
- to_char(l.create_date, 'YYYY-MM-01'),lot_type,l.create_uid
- )
- """)
-report_auction_estimation_adj_category()
-
-class report_auction_adjudication(osv.osv):
- _name = "report.auction.adjudication"
- _description = "report_auction_adjudication"
- _auto = False
- _columns = {
- 'name': fields.many2one('auction.dates','Auction date',readonly=True,select=1),
- 'state': fields.selection((('draft','Draft'),('close','Closed')),'State', select=1),
- 'adj_total': fields.float('Total Adjudication'),
- 'date': fields.date('Date', readonly=True,select=1),
- 'user_id':fields.many2one('res.users', 'User',select=1)
-
- }
-
-
- def init(self, cr):
- cr.execute("""
- create or replace view report_auction_adjudication as (
- select
- l.id as id,
- l.id as name,
- sum(m.obj_price) as adj_total,
- to_char(l.create_date, 'YYYY-MM-01') as date,
- l.create_uid as user_id,
- l.state
- from
- auction_dates l ,auction_lots m
- where
- m.auction_id=l.id
- group by
- l.id,l.state,l.name,l.create_uid,to_char(l.create_date, 'YYYY-MM-01')
-
- )
- """)
-report_auction_adjudication()
-
-class report_attendance(osv.osv):
- _name="report.attendance"
- _description = "Report Sign In/Out"
- _auto = False
- #_rec_name='date'
- _columns = {
- 'name': fields.date('Date', readonly=True,select=1),
- 'employee_id' : fields.many2one('hr.employee', "Employee's Name", select=1, readonly=True),
- 'total_attendance': fields.float('Total', readonly=True),
-}
- def init(self, cr):
- cr.execute("""CREATE OR REPLACE VIEW report_attendance AS
- SELECT
- id,
- name,
- employee_id,
- CASE WHEN SUM(total_attendance) < 0
- THEN (SUM(total_attendance) +
- CASE WHEN current_date <> name
- THEN 1440
- ELSE (EXTRACT(hour FROM current_time) * 60) + EXTRACT(minute FROM current_time)
- END
- )
- ELSE SUM(total_attendance)
- END /60 as total_attendance
- FROM (
- SELECT
- max(a.id) as id,
- a.name::date as name,
- a.employee_id,
- SUM(((EXTRACT(hour FROM a.name) * 60) + EXTRACT(minute FROM a.name)) * (CASE WHEN a.action = 'sign_in' THEN -1 ELSE 1 END)) as total_attendance
- FROM hr_attendance a
- where name > current_date + interval '-1 day'
- GROUP BY a.name::date, a.employee_id
- ) AS fs
- GROUP BY name,fs.id,employee_id
- """)
-
-report_attendance()
-
-
-class report_deposit_border(osv.osv):
- _name="report.deposit.border"
- _description = "Report deposit border"
- _auto = False
- _rec_name='bord'
- _columns = {
- 'bord': fields.char('Depositer Inventory', size=64, required=True),
- 'seller': fields.many2one('res.partner','Seller',select=1),
- 'moy_est' : fields.float('Avg. Est', select=1, readonly=True),
- 'total_marge': fields.float('Total margin', readonly=True),
- 'nb_obj':fields.float('# of objects', readonly=True),
-}
- def init(self, cr):
- cr.execute("""CREATE OR REPLACE VIEW report_deposit_border AS
- SELECT
- min(al.id) as id,
- ab.partner_id as seller,
- ab.name as bord,
- COUNT(al.id) as nb_obj,
- SUM((al.lot_est1 + al.lot_est2)/2) as moy_est,
- SUM(al.net_revenue)/(count(ad.id)) as total_marge
-
- FROM
- auction_lots al,auction_deposit ab,auction_dates ad
- WHERE
- ad.id=al.auction_id
- and al.bord_vnd_id=ab.id
- GROUP BY
- ab.name,ab.partner_id""")
-report_deposit_border()
-
-class report_object_encoded(osv.osv):
- _name = "report.object.encoded"
- _description = "Object encoded"
- _auto = False
- _columns = {
- 'state': fields.selection((('draft','Draft'),('unsold','Unsold'),('paid','Paid'),('invoiced','Invoiced')),'State', required=True,select=1),
- 'user_id':fields.many2one('res.users', 'User', select=1),
- 'estimation': fields.float('Estimation',select=2),
- 'date': fields.date('Create Date', required=True),
-# 'gross_revenue':fields.float('Gross revenue',readonly=True, select=2),
-# 'net_revenue':fields.float('Net revenue',readonly=True, select=2),
-# 'obj_margin':fields.float('Net margin', readonly=True, select=2),
- 'obj_ret':fields.integer('# obj ret', readonly=True, select=2),
-# 'adj':fields.integer('Adj.', readonly=True, select=2),
- 'obj_num':fields.integer('# of Encoded obj.', readonly=True, select=2),
- }
- def init(self, cr):
- cr.execute('''create or replace view report_object_encoded as
- (select min(al.id) as id,
- to_char(al.create_date, 'YYYY-MM-DD') as date,
- al.state as state,
- al.create_uid as user_id,
- (SELECT count(1) FROM auction_lots WHERE obj_ret>0) as obj_ret,
- sum((100* al.lot_est1)/al.obj_price) as estimation,
- COUNT(al.product_id) as obj_num
- from auction_lots al
- where al.obj_price>0 and state='draft'
- group by to_char(al.create_date, 'YYYY-MM-DD'), al.state, al.create_uid)
- ''')
-report_object_encoded()
-
-
-class report_object_encoded_manager(osv.osv):
- _name = "report.object.encoded.manager"
- _description = "Object encoded"
- _auto = False
- _columns = {
- 'user_id':fields.many2one('res.users', 'User', select=True),
- 'estimation': fields.float('Estimation',select=True),
- 'date': fields.date('Create Date', required=True),
- 'gross_revenue':fields.float('Gross revenue',readonly=True, select=True),
- 'net_revenue':fields.float('Net revenue',readonly=True, select=True),
- 'obj_margin':fields.float('Net margin', readonly=True, select=True),
- 'obj_ret':fields.integer('# obj ret', readonly=True, select=True),
- 'adj':fields.integer('Adj.', readonly=True, select=True),
- 'obj_num':fields.integer('# of Encoded obj.', readonly=True, select=True),
- }
- def init(self, cr):
- cr.execute('''create or replace view report_object_encoded_manager as
- (select
- min(al.id) as id,
- to_char(al.create_date, 'YYYY-MM-DD') as date,
- al.create_uid as user_id,
- sum((100*lot_est1)/obj_price) as estimation,
- (SELECT count(1) FROM auction_lots WHERE obj_ret>0) as obj_ret,
- SUM(al.gross_revenue) as "gross_revenue",
- SUM(al.net_revenue) as "net_revenue",
- SUM(al.net_revenue)/count(al.id) as "obj_margin",
- COUNT(al.product_id) as obj_num,
- SUM(al.obj_price) as "adj"
- from auction_lots al
- where al.obj_price>0
- group by to_char(al.create_date, 'YYYY-MM-DD'), al.create_uid)
- ''')
-report_object_encoded_manager()
-
-class report_unclassified_objects(osv.osv):
- _name = "report.unclassified.objects"
- _description = "Unclassified objects "
- _auto = False
- _columns = {
- 'name': fields.char('Short Description',size=64, required=True),
- 'obj_num': fields.integer('Catalog Number'),
- 'obj_price': fields.float('Adjudication price'),
- 'lot_num': fields.integer('List Number', required=True, select=1 ),
- 'state': fields.selection((('draft','Draft'),('unsold','Unsold'),('paid','Paid'),('sold','Sold')),'State', required=True, readonly=True),
- 'obj_comm': fields.boolean('Commission'),
- 'bord_vnd_id': fields.many2one('auction.deposit', 'Depositer Inventory', required=True),
- 'ach_login': fields.char('Buyer Username',size=64),
- 'lot_est1': fields.float('Minimum Estimation'),
- 'lot_est2': fields.float('Maximum Estimation'),
- 'lot_type': fields.selection(_type_get, 'Object category', size=64),
- 'auction': fields.many2one('auction.dates', 'Auction date',readonly=True, select=1),
- }
- def init(self, cr):
- cr.execute("""create or replace view report_unclassified_objects as
- (select
- min(al.id) as id,
- al.name as name,
- al.obj_price as obj_price,
- al.obj_num as obj_num,
- al.lot_num as lot_num,
- al.state as state,
- al.obj_comm as obj_comm,
- al.bord_vnd_id as bord_vnd_id,
- al.ach_login as ach_login,
- al.lot_est1 as lot_est1,
- al.lot_est2 as lot_est2,
- al.lot_type as lot_type,
- al.auction_id as auction
- from auction_lots al,auction_lot_category ac
- where (al.lot_type=ac.name) AND (ac.aie_categ='41') AND (al.auction_id is null)
-group by al.obj_price,al.obj_num, al.lot_num, al.state, al.obj_comm,al.bord_vnd_id,al.ach_login,al.lot_est1,al.lot_est2,al.lot_type,al.auction_id,al.name)
- """)
-report_unclassified_objects()
-
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/auction/auction_data.xml b/addons/auction/auction_data.xml
index 7d742803722..d1f3f94a510 100644
--- a/addons/auction/auction_data.xml
+++ b/addons/auction/auction_data.xml
@@ -1,98 +1,272 @@
-
- Auction Adjudications
- 0
- view
-
-
-
-
-
+
+
+
+
+
+ Antiques
+ ANTI
+
+
+
+ Painting
+ PAINT
+
+
+
+
+ Furnitures
+ FURN
+
+
+
+
+ Porcelain, Ceramics, Glassmaking, ...
+ PCG
+
+
-
- Auction Adjudication Expenses
- 0
- view
-
-
-
-
-
+
+ Sculpture, bronze, eso
+ SBE
+
+
+
+
+ Clocks and watches
+ CLW
+
+
+
+
+ Collectible and art objects
+ COAO
+
+
+
+
+ Engravings
+ ENGR
+
+
+
+
+ Graphic Arts
+ GART
+
+
+
+
+ Lightings
+ LGT
+
+
+
+
+ Metal Ware
+ MW
+
+
+
+
+ Miniatures
+ MAT
+
+
+
+
+ Collections
+ CLT
+
+
+
+
+ Musical Instruments
+ MI
+
+
+
+
+ Old weapons and militaria
+ OWM
+
+
+
+
+ Oriental Arts
+ OART
+
+
+
+
+ Chineese furnitures
+ CHF
+
+
+
+
+ Others
+ OTR
+
+
+
+
+ Posters
+ PST
+
+
+
+
+ Religiosa
+ REL
+
+
+
+
+ Scientific Instruments
+ SIN
+
+
+
+
+ Tin
+ TIN
+
+
+
+
+ Copper wares
+ CWA
+
+
+
+
+ Toys
+ TY
+
+
+
+
+ Verreries
+ VRS
+
+
+
+
+ Wine
+ WNE
+
+
+
+
-
- Auction Adjudications
- 7x*
- income
-
-
-
-
- Auction Adjudication Expenses
- 6x*
- expense
-
-
-
+
+ Contemporary Art
+ CONTEM
+
+
+
+ Arts
+ ARTS
+
+
+
+
+ Curiosa
+ CRS
+
+
+
+
+ Other Media
+ OME
+
+
+
+
+ Photo
+ PHT
+
+
+
+
+ Painting
+ CPAINT
+
+
+
+
+ Sculpture
+ SCUL
+
+
-
- Auction Buyer Costs
- 7x*
- tax
-
-
-
-
- Auction Seller Costs
- 6x*
- tax
-
-
-
+
+ Shows
+ CSHW
+
+
+
+
+ Jewelry
+ JWL
+
+
+
+
-
- Author rights (4%)
- percent
- code
- 0.04
- sabam
-
-
- result = (price_unit>=1250)
-
-
- Buyer Costs (20%)
- percent
- 0.20
- auction
-
-
-
-
- Seller Costs (12%)
- percent
- -0.12
- auction
-
-
-
+
+ Unclassifieds
+ UNCLASS
+
+
+
+ African Arts
+ AFART
+
+
+
+
+ Argenterie
+ ARGENT
+
+
+
+
+ Art from the Ivory Coast
+ ARTFORM
+
+
+
+
+ African Arts
+ AFRART
+
+
+
+
+ Books, manuscripts, eso.
+ BME
+
+
+
+
+ Carpet and textilles
+ CARPTEX
+
+
+
+
+ Cartoons
+ CATOON
+
+
+
+
-
-
-
- account.seller.costs
-
-
-
-
-
-
-
- 770.0
- 700.0
-
-
+
diff --git a/addons/auction/auction_demo.xml b/addons/auction/auction_demo.xml
index 22a5cabb1cd..45b157e6545 100644
--- a/addons/auction/auction_demo.xml
+++ b/addons/auction/auction_demo.xml
@@ -2,6 +2,102 @@
+
+
+ Tax
+ tax
+ unreconciled
+
+
+
+ Auction Adjudications
+ 0
+ view
+
+
+
+
+
+
+
+
+ Auction Adjudication Expenses
+ 1
+ view
+
+
+
+
+
+
+
+
+ Auction Adjudications
+ 7x*
+
+ receivable
+
+
+
+
+
+ Auction Adjudication Expenses
+ 6x*
+
+ payable
+
+
+
+
+
+ Auction Buyer Costs
+ 8x*
+ payable
+
+
+
+
+
+ Auction Seller Costs
+ 9x*
+ receivable
+
+
+
+
+
+
+ Author rights (4%)
+ percent
+ code
+ 0.04
+ sabam
+
+
+ result = (price_unit>=1250)
+
+
+ Buyer Costs (20%)
+ percent
+ 0.20
+ auction
+
+
+
+
+ Seller Costs (12%)
+ percent
+ -0.12
+ auction
+
+
+
+
+
+ 770.0
+ 700.0
+
+
@@ -10,52 +106,52 @@
- Bruxelles1
- Benoit Mortie1r1
- 1030
-
+ Bruxelles1
+ Benoit Mortie1r1
+ 1030
+
+ info@opensides.be
+ (+32)2 211 34 83
+ Rue des Palais 44, bte 33
+ default
+
+
- info@opensides.be
- (+32)2 211 34 83
- Rue des Palais 44, bte 33
- default
-
-
-
- Avignon CEDEX 091
- Laurent Jacot1
- 84911
-
- contact@tecsas.fr
- (+33)4.32.74.10.57
- 85 rue du traite de Rome
- default
-
-
-
- Louvain-la-Neuve
- Thomas Passot
- 1348
-
- info@mediapole.net
- (+32).10.45.17.73
- Rue de l'Angelique, 1
-
-
+
+ Avignon CEDEX 091
+ Laurent Jacot1
+ 84911
+
+ contact@tecsas.fr
+ (+33)4.32.74.10.57
+ 85 rue du traite de Rome
+ default
+
+
+
+
+ Louvain-la-Neuve
+ Thomas Passot
+ 1348
+
+ info@mediapole.net
+ (+32).10.45.17.73
+ Rue de l'Angelique, 1
+
+
+
Philippe Lavilier
1345-1450
+
POREAU OSWALD
1877-1955
-
-
-
@@ -98,104 +194,102 @@
sabam
-
+
- TVA
- 0.12
- auction
-
-
+ TVA
+ 0.12
+ auction
+
+
-
- TVA1
- 0.2
- auction
-
-
-
+ TVA1
+ 0.2
+ auction
+
+
+
- Buyer Costs
- 0.21
- auction
-
-
-
+ Buyer Costs
+ 0.21
+ auction
+
+
+
- Seller Costs1
- -0.10
- auction
-
-
-
+ Seller Costs1
+ -0.10
+ auction
+
+
+
- Seller Costs
- -0.10
- auction
-
-
+ Seller Costs
+ -0.10
+ auction
+
+
-
+
- Frais de vente
- -0.15
- auction
-
-
+ Frais de vente
+ -0.15
+ auction
+
+
-
- Frais de vente
- 0
- auction
-
-
+
+ Frais de vente
+ 0
+ auction
+
+
+
Oeuvres a 21%
-
-
-
- painting
+ Painting
1
- 8
+
+
Furniture
2
- 10
-
+
- glass
+ Glass
2
- 25
+
+
- sculpture
+ Sculpture
10
- 18
+
Jawellery
6
- 15
+
@@ -203,20 +297,18 @@
- painting Exhibition
-
-
-
-
-
-
-
-
-
-
-
-
-
+ painting Exhibition
+
+
+
+
+
+
+
+
+
+
+
@@ -225,53 +317,47 @@
-
-
-
-
-
+
-
-
-
-
- keep
+
+
+ keep
-
-
- keep
+
+
+ keep
-
-
- keep
+
+
+ keep
-
-
- keep
+
+
+ keep
-
-
- keep
+
+
+ keep
@@ -434,7 +520,6 @@
-
@@ -451,7 +536,6 @@
-
@@ -468,11 +552,8 @@
-
-
-
Hardware photos
@@ -487,12 +568,10 @@
-
-
-
+
Home Appliance photos
12
@@ -505,10 +584,8 @@
-
-
mobile accesories photos
@@ -527,7 +604,7 @@
- piques-cierges
+ pikes-candles
14
30
@@ -539,13 +616,11 @@
-
-
- Service à café
+ Coffee Service
15
10
@@ -557,16 +632,11 @@
-
-
-
-
-
-
- Pendule
+
+ Pendulum
16
100
200
@@ -581,23 +651,22 @@
- Cassolettes en marbre
+ Cassolette marble
17
400
500
- marbre Saint Rémi
+ Marble Saint Remi
150
17
0
-
- Tableau
+ Table
18
1600
2200
@@ -608,39 +677,26 @@
-
-
-
-
-
-
-
-
-
- Vase
+
+ Yourself
19
180
220
- Rouge
+ Red
0
19
190.00
-
-
-
-
-
-
- Appareil à photos
+
+ Digital photo
20
160
340
@@ -651,22 +707,8 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
bid1
@@ -701,183 +743,191 @@
- bid4
-
-
+ bid4
+
+
-
-
+
+
- bid5
-
-
+ bid5
+
+
-
-
+
+
- bid6
-
-
+ bid6
+
+
-
-
+
+
- bid7
-
-
+ bid7
+
+
-
-
+
+
- bid8
-
-
+ bid8
+
+
-
-
+
+
- bid9
-
-
+ bid9
+
+
-
-
+
+
- bid10
-
-
+ bid10
+
+
-
-
+
+
-
-
- Demo
+
+ Demo
-
+
-
+ -->
+
+
+
+
+ sign_in
+
+
+
+
+
+ sign_out
+
+
+
+
+
+ sign_in
+
+
+
+
+
+ sign_out
+
+
+
+
+
+ sign_in
+
+
+
+
+
+ sign_out
+
+
+
+
+
+ sign_in
+
+
+
+
+
+ sign_out
+
+
-
+
+
+
+ sign_in
+
+
+
+
+
+ sign_out
+
+
+
+
+
+ sign_in
+
+
+
+
+
+ sign_out
+
+
+
+
+
+ sign_in
+
+
+
+
+
+ sign_out
+
+
+
+
+
+ sign_in
+
+
+
+
+
+ sign_out
+
+
-
-
- sign_in
-
-
-
-
- sign_out
-
-
-
-
- sign_in
-
-
-
-
- sign_out
-
-
-
-
- sign_in
-
-
-
-
- sign_out
-
-
-
-
- sign_in
-
-
-
-
- sign_out
-
-
-
-
-
-
-
-
-
- sign_in
-
-
-
-
- sign_out
-
-
-
-
- sign_in
-
-
- -
-
- sign_out
-
-
-
-
- sign_in
-
-
-
-
- sign_out
-
-
-
-
- sign_in
-
-
-
-
- sign_out
-
-
-
-
+
diff --git a/addons/auction/auction_report.xml b/addons/auction/auction_report.xml
index 17e7e07e968..4d594b6fe33 100644
--- a/addons/auction/auction_report.xml
+++ b/addons/auction/auction_report.xml
@@ -3,7 +3,7 @@
-
-
-->
-
-
-
-
-
-
+ model="auction.lots"
+ name="lots.list.inventory"
+ rml="auction/report/lots_list_inventory.rml"
+ multi="1"/>
-
-
- -->
-
- -->
-
-
-
-->
- -->
-
+
-
+
+
-
-
diff --git a/addons/auction/auction_sequence.xml b/addons/auction/auction_sequence.xml
index 6cd27d256f3..2ae69235843 100644
--- a/addons/auction/auction_sequence.xml
+++ b/addons/auction/auction_sequence.xml
@@ -1,30 +1,33 @@
-
- #
- # Sequences for sale.order
- #
-
+
+
+
- Auction deposit
- auction.deposit
+ Auction deposit
+ auction.deposit
+
- Auction deposit
- auction.deposit
- AD/
- 3
+ Auction deposit
+ auction.deposit
+ AD/
+ 3
+
+
+
- Auction bid
- auction.bid
+ Auction bid
+ auction.bid
+
- Auction bid
- auction.bid
- bid/
- 3
+ Auction bid
+ auction.bid
+ bid/
+ 3
diff --git a/addons/auction/auction_view.xml b/addons/auction/auction_view.xml
index dad4d39b776..46d49754d16 100644
--- a/addons/auction/auction_view.xml
+++ b/addons/auction/auction_view.xml
@@ -5,9 +5,9 @@
- =======================================================
- Auction Management/Configuration/artist
- =======================================================
+
+
+
auction.artists.tree
auction.artists
@@ -42,17 +42,17 @@
- =======================================================
- Auction Management/Configuration/objectcategories
- =======================================================
+
+
+
auction.lot.category.tree
auction.lot.category
tree
-
-
-
+
+
+
@@ -60,37 +60,42 @@
auction.lot.category
form
-
+
+
auction.lot.category
form
+
- =======================================================
- Auction Management/Auction Dates/New Auction Dates
- =======================================================
+
+
+
Auction dates
auction.dates
tree
-
-
-
+
+
+
+
+
+
Auction dates
auction.dates
@@ -98,117 +103,303 @@
+
+
+
+ Auction Dates search
+ auction.dates
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Auction Dates Calendar
+ auction.dates
+ calendar
+
+
+
+
+
+
+
+
+
- Next Auctions
+ Next Auctions Dates
auction.dates
form
- [('state','=','draft')]
-
+ tree,form,calendar
+
+ {"search_default_draft": "1"}
+
+
+
- =======================================================
- Auction Management/Auction Dates/Old Auction Dates
- =======================================================
-
- Old Auctions
- auction.dates
- form
- [('state','=','closed')]
-
-
-
-
- =======================================================
- Auction Management/Auction Dates/Reporting
- =======================================================
-
-
+
+
+
+
Auction lots
auction.lots
tree
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
Auction lots
auction.lots
form
+
-
+
-
+
+
+ Auction Lots search
+ auction.lots
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Auction lots
auction.lots
@@ -223,262 +414,16 @@
-
-
-
- Auction lots
- auction.lots
- tree
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Auction lots
- auction.lots
- form
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
auction.lots
form
- tree,form
-
-
-
- Sold Objects
- auction.lots
- form
- [('state','=','sold')]
-
+ tree,form,graph
+
+ {"search_default_draft": "1"}
-
-
-
- Objects to sell
- auction.lots
- form
- tree,form
- [('state','<>','sold')]
-
-
-
-
- Unplanned objects
- auction.lots
- form
- tree,form
- [('auction_id','=', False),('state','=','draft')]
-
-
-
-
-
-
- Unsold objects
- auction.lots
- form
- [('state','=','unsold')]
-
-
-
-
-
-
- auction.lots.form3
- auction.lots
- form
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- =======================================================
- Auction Management/seller
- =======================================================
-
- Unclassified objects
- report.unclassified.objects
- form
- tree,form
-
-
-
-
- Auction.deposit.tree
- auction.deposit
- tree
-
-
-
-
-
-
-
-
+
auction.deposit.form
@@ -486,74 +431,72 @@
form
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -570,24 +513,70 @@
-
+
+
+ Deposit border
+ auction.deposit
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Deposit Border Calendar
+ auction.deposit
+ calendar
+
+
+
+
+
+
+
Deposit border
auction.deposit
form
+ tree,form,calendar
+
- =======================================================
- "Auction Management/Buyers/Bids
- =======================================================
+
+
auction.bid_line.tree1
auction.bid_line
@@ -595,13 +584,13 @@
-
+
auction.bid_line.form1
auction.bid_line
@@ -612,53 +601,38 @@
-
-
-
-
- auction.bid
- form
-
-
-
- =======================================================
- "Auction Management/Buyers/Reporting
- =======================================================
+
auction.bid.form
auction.bid
-
+
-
-
-
+
+
-
+
-
-
-
auction.bid.tree
auction.bid
@@ -673,6 +647,33 @@
+
+
+ Auction Bid
+ auction.bid
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
auction.bid
tree,form
@@ -680,883 +681,9 @@
-
-
-
- auction.bid_line
- form
- tree,form
-
-
-
-
-
-
-
-
- auction.reports.tree
- report.auction.view
- tree
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- auction.reports.form
- report.auction.view
- form
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
- Auction report
- report.auction.view
- form
- tree
-
-
-
-
-
-
-
-
-
-
- auction.reports.tree2
- report.auction.view2
- tree
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Auction report
- report.auction.view2
- form
-
-
-
-
-
-
-
-
-
-
-
-
-
- Auction report
- report.auction.view2
- form
- tree
- [('date','ilike',time.strftime('%Y-%m'))]
-
-
-
-
-
-
-
- Auction report
- report.auction.view2
- form
- tree
-
-
-
-
-
-
- Seller's auction
- report.seller.auction
- form
-
-
-
-
-
-
-
-
-
-
-
-
- Seller's auction
- report.seller.auction
- tree
-
-
-
-
-
-
-
-
-
-
-
-
-
- Seller's auction
- report.seller.auction
- graph
-
-
-
-
-
-
-
-
-
-
-
-
- Seller's auction
- report.seller.auction
- form
- tree,graph
- [('date','ilike',time.strftime('%Y-%m'))]
-
-
- Seller's auction
- report.seller.auction
- form
- tree,graph
-
-
-
-
-
- Seller's auction
- report.seller.auction2
- form
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Seller's auction
- report.seller.auction2
- tree
-
-
-
-
-
-
-
-
-
-
-
-
-
- Seller's auction
- report.seller.auction2
- graph
-
-
-
-
-
-
-
-
-
-
- Seller's auction
- report.seller.auction2
- form
- tree,graph
- [('date','ilike',time.strftime('%Y-%m'))]
-
-
-
-
- Buyer's auction
- report.buyer.auction
- form
-
-
-
-
-
-
-
-
-
-
-
- Buyer's auction
- report.buyer.auction
- tree
-
-
-
-
-
-
-
-
-
-
-
-
- Buyer's auction
- report.buyer.auction
- form
- tree
- [('date','ilike',time.strftime('%Y-%m'))]
-
-
-
- Buyer's auction
- report.buyer.auction2
- form
-
-
-
-
-
-
-
-
-
-
-
-
- Buyer's auction
- report.buyer.auction2
- tree
-
-
-
-
-
-
-
-
-
-
-
-
-
- Buyer's auction
- report.buyer.auction2
- form
- tree
- [('date','ilike',time.strftime('%Y-%m'))]
-
-
-
- Buyer's auction
- report.buyer.auction
- form
- tree
-
-
-
-
-
- Buyer's auction for all months
- report.buyer.auction2
- form
- tree
-
-
-
-
-
-
-
-
-
- Unplanned objects
- report.unplanned.object
- tree
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Unplanned objects
- report.unplanned.object
- form
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-=============================
-estimation.adj.category
-==============================
-
- report.auction.estimation.adj.category.form
- report.auction.estimation.adj.category
- form
-
-
-
-
-
-
-
-
-
-
-
-
-
- report.auction.estimation.adj.category.tree
- report.auction.estimation.adj.category
- tree
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- report.auction.estimation.adj.category.graph
- report.auction.estimation.adj.category
- graph
-
-
-
-
-
-
-
-
-
-
-
-
- Min est/Adj/Max est
- report.auction.estimation.adj.category
- form
- graph,tree
- [('date','like',time.strftime('%Y-%m'))]
-
-
-
- Min est/Adj/Max est
- report.auction.estimation.adj.category
- form
- graph,tree
- [('date','like',time.strftime('%Y-%m')),('user_id','=',uid)]
-
-
-
-
-
-
-
-
-
-
- report attendance
- report.attendance
- tree
-
-
-
-
-
-
-
-
-
-
- Graph attendance
- report.attendance
- graph
-
-
-
-
-
-
-
-
-
-
-
-
- report.attendance
- form
- tree,graph
- [('name','=',time.strftime('%Y-%m-%d')),('employee_id','=',uid)]
-
-
-
-
-
-
- report.attendance
- form
- tree,graph
- [('name','=',time.strftime('%Y-%m-%d'))]
-
-
-
-
-==============================
-My Latest Objects
-==============================
-
- auction.lots
- form
- tree,form
- [('create_uid','=',uid)]
-
-
-
- auction.lots
- form
- tree,form
-
-
-
-
-=============================
-My Latest Deposit
-==============================
-
-
- auction.deposit
- form
- tree,form
-
-
-
-=============================
-Objects per Day
-==============================
-
- Objects by date
- report.auction.object.date
- tree
-
-
-
-
-
-
-
-
-
-
-
- Object date
- report.auction.object.date
- form
-
-
-
-
-
-
-
-
-
-
-
- report.auction.object.date.graph
- report.auction.object.date
- graph
-
-
-
-
-
-
-
-
-
-
- report.auction.object.date
- form
- graph,tree
- [('month','=',time.strftime('%Y-%m-01'))]
-
-
-
-
- Detailed lots
- auction.lots
- form
- [('auction_id','=', active_id)]
-
-
-
- tree_but_open
- auction.dates
- Open auction
-
-
-
-
-
- Simplified lots for adjudication
- auction.lots
- form
- [('auction_id','=',active_id)]
-
-
-
-
- tree
-
-
-
-
- form
-
-
-
-
-
- tree_but_action
- auction.dates
- Open lots for adjudication
-
-
-
-
-
- Auction dates
- auction.dates
- tree
- [('state','=', 'draft')]
-
-
-
-
-
-=============================
-Auction adjudication
-==============================
-
-
- report.auction.adjudication.tree
- report.auction.adjudication
- tree
-
-
-
-
-
-
-
-
-
-
- report.auction.adjudication.graph
- report.auction.adjudication
- graph
-
-
-
-
-
-
-
-
-
-
-
-
- report.auction.adjudication
- form
- graph,tree
-
-
-
-
-
- Depositer's statistics
- report.deposit.border
- tree
-
-
-
-
-
-
-
-
-
-
-
-
-
-=============================
-Object encoded
-==============================
-
- report.object.encoded.form
- report.object.encoded
- form
-
-
-
-
-
-
-
-
-
-
-
-
-
-report.object.encoded.tree
-report.object.encoded
-tree
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- report.object.encoded.graph
- report.object.encoded
- graph
-
-
-
-
-
-
-
-
-
-
-
- report.object.encoded
- form
- tree
- [('user_id','=',uid),('date','ilike',time.strftime('%Y-%m'))]
-
-
-
-
- report.object.encoded.tree
- report.object.encoded.manager
- tree
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- report.object.encoded.graph
- report.object.encoded.manager
- graph
-
-
-
-
-
-
-
-
-
-
-
-
-
- report.object.encoded.manager
- form
- tree
- [('date','ilike',time.strftime('%Y-%m'))]
-
-
-
- report.unclassified.objects
- report.unclassified.objects
- tree
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
diff --git a/addons/auction/board_auction_manager_view.xml b/addons/auction/board_auction_manager_view.xml
index a7efd0ef0e0..edc799588e3 100644
--- a/addons/auction/board_auction_manager_view.xml
+++ b/addons/auction/board_auction_manager_view.xml
@@ -5,6 +5,7 @@
Auction manager
+
board.auction.manager.form
board.board
@@ -13,8 +14,6 @@
-
-
-
diff --git a/addons/auction/board_auction_view.xml b/addons/auction/board_auction_view.xml
index 6693622d55c..e1d92d5e753 100644
--- a/addons/auction/board_auction_view.xml
+++ b/addons/auction/board_auction_view.xml
@@ -4,7 +4,7 @@
Auction
-
+
board.auction.manager.form
board.board
@@ -58,7 +58,7 @@
menu
-
+
-
-
-
-
-
-
-
-
-
-
-
+
-
diff --git a/addons/auction/report/ach_bordereau.xsl b/addons/auction/report/ach_bordereau.xsl
index 6aa9f36e299..3da048b81a4 100644
--- a/addons/auction/report/ach_bordereau.xsl
+++ b/addons/auction/report/ach_bordereau.xsl
@@ -1,8 +1,9 @@
-
-
+
+
+
diff --git a/addons/auction/report/ach_bordereau_photo.xsl b/addons/auction/report/ach_bordereau_photo.xsl
index b1ed3340d7a..40e01041c0d 100644
--- a/addons/auction/report/ach_bordereau_photo.xsl
+++ b/addons/auction/report/ach_bordereau_photo.xsl
@@ -1,162 +1,64 @@
-
+
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Plate Number:
-
-
-
-
-
- Document : Buyer form
-
- Auction :
-
-
-
-
- Customer Contact :
-
-
- -
-
-
-
- Customer Reference :
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Cat. N.
- Description
- Paid
- Adj.(EUR)
-
-
-
-
-
-
-
-
-
- Subtotal:
-
-
-
-
-
-
-
- Total:
-
-
-
-
-
-
-
-
-
-
- :
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- .
-
-
-
- X
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+ #e6e6e6
+
+
+ ,0
+
+
+
+ ,0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/auction/report/catalog2.py b/addons/auction/report/catalog2.py
index b84bab5b9fd..80df790f58c 100644
--- a/addons/auction/report/catalog2.py
+++ b/addons/auction/report/catalog2.py
@@ -35,6 +35,7 @@ import base64
import wizard
import photo_shadow
from tools import config
+import addons
def _to_unicode(s):
try:
@@ -64,16 +65,13 @@ def _to_decode(s):
class auction_catalog(report_rml):
def create_xml(self, cr, uid, ids, data, context):
-
xml = self.catalog_xml(cr, uid, ids, data, context)
- temp=self.post_process_xml_data(cr, uid, xml, context)
+ temp = self.post_process_xml_data(cr, uid, xml, context)
return temp
def catalog_xml(self, cr, uid, ids, data, context, cwid="0"):
impl = minidom.getDOMImplementation()
-
doc = impl.createDocument(None, "report", None)
-
catalog=doc.createElement('catalog')
doc.documentElement.appendChild(catalog)
@@ -82,37 +80,38 @@ class auction_catalog(report_rml):
commdb='comm'
tab_avoid = []
tab_no_photo=[]
- for id in ids:
- lot_ids=pooler.get_pool(cr.dbname).get('auction.lots').search(cr, uid, [('auction_id', '=', id)])
- ab=pooler.get_pool(cr.dbname).get('auction.lots').read(cr, uid, lot_ids, ['auction_id','name','lot_num','lot_est1','lot_est2'], context)
- auction_dates_ids = [x["auction_id"][0] for x in ab]
+ auction_lot_pool = pooler.get_pool(cr.dbname).get('auction.lots')
+ auction_dates_pool = pooler.get_pool(cr.dbname).get('auction.dates')
+ for auction in auction_dates_pool.browse(cr, uid, ids, context=context):
+ auction_lot_ids = auction_lot_pool.search(cr, uid, [('auction_id', '=', auction.id)])
+ #for lot in auction_lot_pool.browse(cr, uid, auction_lot_ids, context=context):
+ # ab=pooler.get_pool(cr.dbname).get('auction.lots').read(cr, uid, lot_ids, ['auction_id','name','lot_num','lot_est1','lot_est2'], context)
+ #auction_dates_ids = [x["auction_id"][0] for x in ab]
- res=pooler.get_pool(cr.dbname).get('auction.dates').read(cr, uid, ids, ['name','auction1','auction2'], context)
# name emelment
key = 'name'
categ = doc.createElement(key)
- categ.appendChild(doc.createTextNode(_to_decode(res[0]["name"])))
+ categ.appendChild(doc.createTextNode(_to_decode(auction.name)))
catalog.appendChild(categ)
#Auctuion Date element
categ = doc.createElement("AuctionDate1")
- categ.appendChild(doc.createTextNode(_to_decode(res[0]['auction1'])))
+ categ.appendChild(doc.createTextNode(_to_decode(auction.auction1)))
catalog.appendChild(categ)
# Action Date 2 element
categ = doc.createElement("AuctionDate2")
- categ.appendChild(doc.createTextNode(_to_decode(res[0]['auction2'])))
+ categ.appendChild(doc.createTextNode(_to_decode(auction.auction2)))
catalog.appendChild(categ)
- # promotion element
+ # promotion element
promo = doc.createElement('promotion1')
-
- fp = file(config['addons_path']+'/auction/report/images/flagey_logo.jpg','r')
+ fp = file(addons.get_module_resource('auction','report', 'images', 'flagey_logo.jpg'),'r')
file_data = fp.read()
promo.appendChild(doc.createTextNode(base64.encodestring(file_data)))
catalog.appendChild(promo)
promo = doc.createElement('promotion2')
- fp = file(config['addons_path']+'/auction/report/images/flagey_logo.jpg','r')
+ fp = file(addons.get_module_resource('auction','report', 'images', 'flagey_logo.jpg'),'r')
file_data = fp.read()
promo.appendChild(doc.createTextNode(base64.encodestring(file_data)))
catalog.appendChild(promo)
@@ -122,36 +121,30 @@ class auction_catalog(report_rml):
catalog.appendChild(products)
side = 0
length = 0
- auction_ids = []
- for test in ab:
- if test.has_key('auction_id'):
- auction_ids.append(test['auction_id'][0])
- cr.execute('select * from auction_lots where auction_id IN %s',(tuple(auction_ids),))
- res = cr.dictfetchall()
- for cat in res:
- product =doc.createElement('product')
+ for cat in auction_lot_pool.browse(cr, uid, auction_lot_ids, context=context):
+ product = doc.createElement('product')
products.appendChild(product)
- if cat['obj_desc']:
+ if cat.obj_desc:
infos = doc.createElement('infos')
- lines = re.split(' |\n', _to_unicode(cat['obj_desc']))
+ lines = re.split(' |\n', _to_unicode(cat.obj_desc))
for line in lines:
xline = doc.createElement('info')
xline.appendChild(doc.createTextNode(_to_decode(line)))
infos.appendChild(xline)
product.appendChild(infos)
- if cat['lot_num']:
+ if cat.lot_num:
lnum = doc.createElement('lot_num')
- lnum.appendChild(doc.createTextNode(_to_decode(str(cat['lot_num']))))
+ lnum.appendChild(doc.createTextNode(_to_decode(str(cat.lot_num))))
infos.appendChild(lnum)
- if cat['image']:
+ if cat.image:
import random
import tempfile
limg = doc.createElement('photo_small')
file_name = tempfile.mktemp(prefix='openerp_auction_', suffix='.jpg')
fp = file(file_name, 'w')
- content = base64.decodestring(cat['image'])
+ content = base64.decodestring(cat.image)
fp.write(content)
fp.close()
fp = file(file_name,'r')
@@ -164,10 +157,15 @@ class auction_catalog(report_rml):
limg.appendChild(doc.createTextNode(test_data))
infos.appendChild(limg)
- for key in ('lot_est1','lot_est2'):
+ if cat.lot_est1:
ref2 = doc.createElement(key)
- ref2.appendChild(doc.createTextNode( _to_decode(str(cat[key] or 0.0))))
+ ref2.appendChild(doc.createTextNode( _to_decode(str(cat.lot_est1 or 0.0))))
product.appendChild(ref2)
+ if cat.lot_est2:
+ ref2 = doc.createElement(key)
+ ref2.appendChild(doc.createTextNode( _to_decode(str(cat.lot_est2 or 0.0))))
+ product.appendChild(ref2)
+
oldlength = length
length += 2.0
if length>23.7:
@@ -180,7 +178,7 @@ class auction_catalog(report_rml):
ref4 = doc.createElement('side')
ref4.appendChild(doc.createTextNode( "1" ))
product.appendChild(ref4)
- xml1 = doc.toxml()
+ xml1 = doc.toxml()
return xml1
auction_catalog('report.auction.cat_flagy', 'auction.dates','','addons/auction/report/catalog2.xsl')
diff --git a/addons/auction/report/catalog2.xsl b/addons/auction/report/catalog2.xsl
index c0d73eb333d..ea27162428d 100755
--- a/addons/auction/report/catalog2.xsl
+++ b/addons/auction/report/catalog2.xsl
@@ -12,7 +12,7 @@
-
+
1cm 3.0cm 20cm 3.0cm
Hotel des ventes Flagey
@@ -20,7 +20,6 @@
Rue du Nid, 4 - B-1050 Bruxelles - Tel: 02/644.97.67
Web: Flagey.com - Mail: info@flagey.com - Fax: 02.646.32.35
-
@@ -30,8 +29,8 @@
--
- Vente antiquitée le -->
+-
+ Vente antiquitée le
@@ -39,7 +38,7 @@
1cm 1.6cm 20cm 1.6cm
- 1.0cm 27.3cm 20cm 27.3cm
+ 1.0cm 26.1cm 20cm 26.1cm
www.flagey.com
@@ -47,7 +46,7 @@
info@flagey.com
-
+
@@ -62,6 +61,7 @@
+
@@ -92,11 +92,88 @@
-
+
+ /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0a
+HBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIy
+MjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCABjAO0DASIA
+AhEBAxEB/8QAGwAAAwADAQEAAAAAAAAAAAAAAAUGAwQHAgH/xABHEAABAwMBAggKBggFBQAAAAAB
+AAIDBAURBhIhBxMVMUFRU9EWNWFxc4GSoaKxFCIyN4KRIzM2QnSys8EkUnLw8TRjwtLh/8QAFQEB
+AQAAAAAAAAAAAAAAAAAAAAH/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwDfptuW
+RsLRtOPMt3k+q7P4gta1eM4fxfIqlyOtVSPk+q7P4gjk+q7P4gnmD1FeS4DcSAVEJeT6rs/iCOT6
+rs/iCdbbesL0N/MgR8n1XZ/EEcn1XZ/EE7LgDgnevo38wygR8n1XZ/EEcn1XZ/EE4fMyN2y44PP5
+uhewQRkIEnJ9V2fxBHJ9V2fxBPEIEfJ9V2fxBHJ9V2fxBPEIEfJ9V2fxBHJ9V2fxBPEIEfJ9V2fx
+BHJ9V2fxBPEIEfJ9V2fxBHJ9V2fxBPEIEfJ9V2fxBHJ9V2fxBPEIEfJ9V2fxBHJ9V2fxBPEIEfJ9
+V2fxBHJ9V2fxBPEIEfJ9V2fxBHJ9V2fxBPEIEMtHUQxPlfHhjGlzjkbgFO1FbJNJlri1o5gCre4+
+LKr0L/kVz9VVLavGcP4vkU9qInva4xv2XbOP99SQ2rxnD+L5FUqiJe0W9131dU2Wa5V8UsLGPJjq
+HbO9oPX5Up1Vq+osOo57HRwskjpogRLONt7ztNGST51Q6U++O6egj/kaudcIX3l3L0Q/qMQX9OL7
+PTxyh1INtoP6kdy9VEd7MJE7Wys6qeV0L/URu9yb23xbT+jC9y1LYd7/AKrNrY2ienGUEdqa9S2O
+0UDKGOeVtSXCaaqcXyRuAzsg9C13XSoq7XaauoqaiJ1bMIswSub0dWcKk1BRR11tqIywOa+LaYcf
+vg7vcSpCphNPYtMxOGC2ux7kDHXl6qNLT02n6KSSRk0RmlnmcXPc4NLhvPQMBUum55KmxUssrtp7
+mAkqH4Yv24of4N39Mqz0p+zdH6MIHSEIQCEIQCEIQCEIQCEIQCEIQCEIQCEIQCEIQa1x8WVXoX/I
+rn66BcfFlV6F/wAiufoKW1eM4fxfIqkU3avGcP4vkVSIEWlPvkunoI/5GqH4S7a+DXdXVte2TjWh
+mw3eW/Wacn8lcaU++O6egj/kauecIEjm8JdyOA4tiBZtb9k7bRn3oOo0FRBFaIZZpo4o2xjae9wA
+CT6uuVKNK000EuTUVW2zoLm42cjyLzHarrWWyIPrmSMLQdiWIObzcymNbW+4fS6evlIFKGMpxEz7
+MTmuG4Dzb/Wg6PRAPoIQ7eCwZ/JTOtY2RGwNY0NH0/mHmCp6D/oIP9A+Smtc/rLB/H/2CCf4Yv24
+of4N39Mq00mM6cogOcxhRfDF+3FD/Bu/plWWli5umqMt+0IxhBryaqopp69lMJpo6Ehsr2ENbnOO
+c9GV8gu1wq4+NpKBuyeZz3uJ+akdY03Iemm2e15ibVSmWqlkadpx6G7ucBM+Dqrqn004qnuEQIEe
+3uJ8qCioqq7TXGOjm4lssoLo2O3E9G48xx5ltxXWNtxlt1Q+NtTE7ZIa7IKVahmNPqzSskbsOdNI
+04PR9VRuuauWi4Ubi6JxbgNfu69to/8AIoOs9ZJAAGSTzAJUb9an2youBq3ilieYmFmAZngZOzno
+HWtHUtVONB10sBIlfA0ZHPguAPuJUBq+F1to9MW6IkQChkmd1Oe5riT8h6kFxb77W3eIS0FJswk7
+nuJPz/8Ai3YLxLyJJcpnwtZFJxTwMuIf5v7eRfdGRiPTlCAMfVCiLnVii4PtR8c4jj7oWQ56SCSc
+fmPzQP7xqN9it8NVV1Tqmetn/wALHHsgxx9bsDeT1J5Zb/TXOzG4vkbFCwEyPccBuFz7Ttu8LaeS
+nq5XB8Ibh2N4yBkeRMbpaS+7WnRFtLmwOLZqojnO/cD6t/rQWNzvtvoLPHcpqh+zMNqCFv1S5ucb
+R58BLo7zcqimNVFSCOna0vJdvy0bz5eZR2uaSVmsJImyiSljfFBFEw54tjd2/wDJdKidDyUYg5uH
+QFuB05bhBh5SfTQ0s9TsGmqRmOZhyAeoor66rp4Q6liZIXZILsuB6ubCSycVbeCo0F4nZT3BpMtP
+G931x1HHlWvoHUJulGKeR2XNaHNPuI9RBQUtkj1BeI4qniqD6E77UkZdkDp6UnfqqB9ykpaWOpke
+xxaASOg4ORhU2jKsWjUdXZZDimqRx9ODzDP2m+o5UZri2v0trptdC3FPVHjBjm2h9oesb/UgpZa6
+ojoXVIg3gZ2SM49W5K7tq2329zYpRViQ4wWtDQ8nqBycJ0J2VdJFsOAbMMl3+VuMk+oZU22ihvup
+zVyRgxU+5jSNw6h6hhA0guT7jY6uR8D4/wBC/G2OfcVJK+r2tZa6oNAA4l/N5ioFBS2rxnD+L5FU
+imrV4zh/F8iqXOECLSn3x3T0Ef8AI1c64QfvLuXoh/UYuk6Yhki4VrtWyN2KYQR5ldub9hvSudcI
+cDhrytrQQ6CVrWsc05ydtp/sg6pbfFtP6MJbqG2zV9tdTxtDgZhL68YTG2EG20+D+4FtoMNIx0dL
+Ex3O1oCmNc/rLB/H/wBgq1S+sKaarmsTYI3SObXAkNGcbkE1wxftxQ/wbv6ZVParpTWXQ0VxqyeK
+hiB2RzuJ5gFN8L0Rl1bS1UZa+KOmcxxac4OwRj81v1NukuvB7RU0W9zXxylv+YDII9+fUg9v1U6K
+yQXS92+Bzq+bi6ClLMhrel7id5/5Xiw3G96ijfPTuZR0e0Q0RtA3epPOEHSxuWnLNPR7PGUDWF0Q
+Izs9O5aOgZI2abZGXBro3FrgdxB8qDHVwC1ai0/9JDamWeoeBI4bxjZ6fWo/hE+825+jH9RiuL3B
+U3LVum200D3wwyOe6QDdvI/9Ug4ULA+LWMlxhmjkFSA3Ya4ZGHAn5ILeGOOayRRyjaY+INLcZzkc
+ykNaMgltNDE+mcKija6Jjg9rnBpyObPUUzu90rKGzWuOi2RUGaMS7+ZuObyc625dN3GhPGT2iS5M
+k+s0seAGjqxhBg0pc4+RKaEyRRujAaXSPAA8uOf3KV4QXUl0raK22hjp6enc5+wxpxJI45LneTuV
+U211ZcS3SE7fNMB/ZMLfQ1ccoHg5LTOP75cHD1ndhAt0Tp6Sy250lTvqZztPK29O0wPDLWSyjeaa
+N0ZPVsAf2KaUVxgrNpjHASMOHMyDhYZY/oeoaG7xkNfF+jeTzOYTzeo/NByvU+3Bwi3TAHGcfHsO
+cM7OSeb3Lo0FvvBhY4XeUZAO5IuErTvE6ikvtK5slPK1pkDTktcHA7/VlWVunZPboJGOBa5gOfUg
+lbpoh93n+kV1Y2aTGNqRgJwsum9IQWSuM8U5P1cBgGBg79wVNPMx7Hjb2Ym/rZBzNHUOsnoCTW+o
+luV7lnZltOzcAObqA9QAQbl9ZLDFBdKcf4igfxoxzln74/Lf6lQauttHq7RkVdxjWmJomY/qwMrU
+c0OaQQCCMEHpCjdR3ar09wdXe3MLtmOpbHA7/tvBI+WEGlY7uyHTskH0hs0wHFsweZnOfWdw8yrL
+DRfRbe0vH6ST6zj51yvQNplqrtHCc8VTjbm8sh3kercPUu0NAa0AcwQa9x8WVXoX/Irn66BcfFlV
+6F/yK5+gpbV4zh/F8intTHI5pdGWbWNwe3ISK1eM4fxfIqkQSl5tt8u1vFEXwxQh21iLLM+fCmmc
+HlwbKJOOJI58yuOV1BCBHbqW6U8kbZOJbEBghgwniEIPj27TSM4z0pVVsurOMbRGBoe0tL9jDh5j
+0JshBzCTg9uMk5ldUEvyTkyuPP8A8qwtFurqaBtNUiMwhuMNT9CCTvml6utJfS187HEYwJCClVqs
+eoLQ57YwyfaP2p8Ox7l0FCCcprTc5ZTU1dYWTluzlh6OrzKPu/B/c6q4mo4+Sf62WiSU7LfVz+9d
+TQglLPpasjhH0o/S6p2Nlmdlu455+jm51q3vXurKS7T0tvqKZ8bHENaGuOyBu6AqKtra2nrnMpgf
+r0UrY8dEg3+9vMprQNM10VZNPh9RxpB2t5Ayg0W6/wBebW98WeoMf3J/ZuEy9x7cd9pg6Bw2eMiY
+7Iz5MKk4mPP2G/ksVQ2MN2GxB8j/AKrGAc5Qcms1xqaHWMoO22KWrIaD0tcM/kuvOY2WLZe0Oa4b
+wVGXOihr9U26Kma0spGNa57R9rZGCfzVqBgAIJm8aWfWMJpamWI9DQ8haNvob5a4hAKaOdo6Xu3f
+kMBWqEEybbdrnstrZmwwjmjjGAPMAn1HRw0UAhhbho962Fhq6qKio56uckRQxukdjnIAzgIMyRan
+po6uy1sEjGua1rJW5/zB24e8rWst+uF4tFZeZ6WKioIv1LnEkyeQ968VF1juNrdIwbLpXAbOd4wP
+77XuQYtAWnk+ymV4/SzOLnEquWrboBT0EUYGMNC2kGtcfFlV6F/yK5+ugXHxZVehf8iufoKW1eM4
+fxfIqkUhDcIbdUxzzbRAz9VoyTuIW/4X2/san2W96CgQp/wvt/Y1Pst70eF9v7Gp9lvegoEKf8L7
+f2NT7Le9Hhfb+xqfZb3oKBCn/C+39jU+y3vR4X2/san2W96CgQp/wvt/Y1Pst70eF9v7Gp9lvego
+EKf8L7f2NT7Le9Hhfb+xqfZb3oKBCn/C+39jU+y3vR4X2/san2W96BzPC5+y+KQxzM3tdjKknUlx
+tF0lq2wlzZDl5iHP5x/s+VNPC+39jU+y3vQdX2888NT7Le9B4Go4tnEgqtrqZCB7z3LE64V1dmKh
+o3xNeMOlkOXEeU9XkGFl8KrWTk00+f8AQ3vXoattwG6GpH4G96DdtNobQNMjztzv+05NFP8Ahfb+
+xqfZb3o8L7f2NT7Le9BQIU/4X2/san2W96PC+39jU+y3vQUCwVlO2qpJIHAOa9paWu5iCk3hfb+x
+qfZb3o8L7f2NT7Le9BK63F/koobTb4xSWqNgbxUbS456Tkc/uX3RtnuU0xkrWPZCHbX1xguPXjo8
+3Qqg6ttzueCpPnY3vQNXW5owIakfgb3oKADAwF9U/wCF9v7Gp9lvejwvt/Y1Pst70De4+LKr0L/k
+Vz9UdXqqhnpJoWxVAdJG5oJaMZIx1qbBBGRzIMFQ90lRIXHJDiPUsaEKqEIQgEIQgEIQgEIQgEIQ
+gEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgF7jcQCAUIQf/9k=
+
+
-
+
+
+
+
diff --git a/addons/auction/report/corporate_defaults.xsl b/addons/auction/report/corporate_defaults.xsl
new file mode 100644
index 00000000000..414071466af
--- /dev/null
+++ b/addons/auction/report/corporate_defaults.xsl
@@ -0,0 +1,96 @@
+
+
+
+
+ Open ERP Report
+ 1cm
+ 1cm
+ 1cm
+ 1cm
+ 21cm,29.7cm
+
+ a4_letter
+
+
+
+
+
+
+
+ 1cm 28.4cm 20cm 28.4cm
+ 1cm 25.4cm 7cm 25.4cm
+
+
+
+
+
+
+
+
+ -
+
+
+ Phone:
+
+ Mail:
+
+
+
+
+
+ 1.5cm 2.2cm 19.9cm 2.2cm
+
+
+ Your contact :
+
+
+
+
+
+
+
+
+
+
+ 1cm 25.4cm 20cm 25.4cm
+
+
+
+
+
+
+
+
+
+ -
+
+
+ Phone:
+
+ Mail:
+
+
+
+
+ 1.5cm 1.2cm 19.9cm 1.2cm
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/auction/report/deposit.xsl b/addons/auction/report/deposit.xsl
index 3573cce5a4e..06cb36aa843 100644
--- a/addons/auction/report/deposit.xsl
+++ b/addons/auction/report/deposit.xsl
@@ -1,7 +1,7 @@
-
-
+
+
diff --git a/addons/auction/report/report_auction.py b/addons/auction/report/report_auction.py
new file mode 100644
index 00000000000..3dffc25a78d
--- /dev/null
+++ b/addons/auction/report/report_auction.py
@@ -0,0 +1,395 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2010 Tiny SPRL ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+from mx import DateTime
+from osv import fields, osv, orm
+from tools import config
+from tools.translate import _
+import ir
+import netsvc
+import os
+import time
+import tools
+
+def _type_get(self, cr, uid, context=None):
+ if not context:
+ context = {}
+ obj = self.pool.get('auction.lot.category')
+ ids = obj.search(cr, uid, [])
+ res = obj.read(cr, uid, ids, ['name'], context)
+ res = [(r['name'], r['name']) for r in res]
+ return res
+
+class report_auction(osv.osv):
+
+ """Auction Report"""
+ _name = "report.auction"
+ _description = "Auction's Summary"
+ _auto = False
+ _columns = {
+ 'year': fields.char('Year', size=4, readonly=True),
+ 'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
+ ('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
+ ('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True),
+ 'day': fields.char('Day', size=128, readonly=True),
+ 'buyer_login': fields.char('Buyer Login', size=64, readonly=True, select=1),
+ 'buyer':fields.many2one('res.partner', 'Buyer', readonly=True, select=2),
+ 'seller': fields.many2one('res.partner', 'Seller', readonly=True, select=1),
+ 'object':fields.integer('No of objects', readonly=True, select=1),
+ 'total_price':fields.float('Total Adj.', digits=(16, 2), readonly=True, select=2),
+ 'lot_type': fields.selection(_type_get, 'Object category', size=64),
+ 'avg_price':fields.float('Avg Adj.', digits=(16, 2), readonly=True, select=2),
+ 'date': fields.date('Create Date', select=1),
+ 'auction': fields.many2one('auction.dates', 'Auction date', readonly=True, select=1),
+ 'gross_revenue':fields.float('Gross Revenue', readonly=True),
+ 'net_revenue':fields.float('Net Revenue', readonly=True),
+ 'net_margin':fields.float('Net Margin', readonly=True),
+ 'avg_estimation':fields.float('Avg estimation', readonly=True),
+ 'user_id':fields.many2one('res.users', 'User', select=1),
+ 'state': fields.selection((('draft', 'Draft'), ('unsold', 'Unsold'), ('sold', 'Sold')), 'State', readonly=True, select=1),
+
+ }
+
+ def init(self, cr):
+ tools.drop_view_if_exists(cr, 'report_auction')
+ cr.execute('''
+ create or replace view report_auction as (
+ select
+ min(al.id) as id,
+ al.ach_login as "buyer_login",
+ ad.auction1 as date,
+ al.state,
+ al.create_uid as user_id,
+ to_char(ad.auction1, 'YYYY') as year,
+ to_char(ad.auction1, 'MM') as month,
+ to_char(ad.auction1, 'YYYY-MM-DD') as day,
+ al.ach_uid as "buyer",
+ al.lot_type as lot_type,
+ ade.partner_id as seller,
+ ad.id as auction,
+ count(al.id) as "object",
+ sum(al.obj_price) as "total_price",
+ (sum(al.obj_price)/count(al.id)) as "avg_price",
+ sum(al.gross_revenue) as gross_revenue,
+ sum(al.net_revenue) as net_revenue,
+ avg(al.net_margin) as net_margin,
+ sum(al.lot_est1+al.lot_est2)/2 as avg_estimation
+ from
+ auction_lots al,
+ auction_dates ad,
+ auction_deposit ade
+ where
+ ad.id=al.auction_id and ade.id=al.bord_vnd_id
+ group by
+ ad.auction1,
+ al.ach_uid,
+ ad.id,
+ al.ach_login,
+ ade.partner_id,
+ al.state,
+ al.create_uid,
+ al.lot_type
+ )
+ ''')
+report_auction()
+
+
+#==========================
+#Others Report for Dashboard (Employee & Manager)
+#==========================
+
+class report_auction_object_date(osv.osv):
+ _name = "report.auction.object.date"
+ _description = "Objects per day"
+ _auto = False
+ _columns = {
+ 'obj_num': fields.integer('# of Objects'),
+ 'name': fields.date('Created date', select=2),
+ 'month': fields.date('Month', select=1),
+ 'user_id':fields.many2one('res.users', 'User',select=1),
+ }
+ #l.create_uid as user,
+
+ def init(self, cr):
+ cr.execute("""create or replace view report_auction_object_date as
+ (select
+ min(l.id) as id,
+ to_char(l.create_date, 'YYYY-MM-DD') as name,
+ to_char(l.create_date, 'YYYY-MM-01') as month,
+ count(l.obj_num) as obj_num,
+ l.create_uid as user_id
+ from
+ auction_lots l
+ group by
+ to_char(l.create_date, 'YYYY-MM-DD'),
+ to_char(l.create_date, 'YYYY-MM-01'),
+ l.create_uid
+ )
+ """)
+report_auction_object_date()
+
+class report_auction_estimation_adj_category(osv.osv):
+ _name = "report.auction.estimation.adj.category"
+ _description = "comparaison estimate/adjudication "
+ _auto = False
+ _rec_name='date'
+ _columns = {
+ 'lot_est1': fields.float('Minimum Estimation',select=2),
+ 'lot_est2': fields.float('Maximum Estimation',select=2),
+# 'obj_price': fields.float('Adjudication price'),
+ 'date': fields.date('Date', readonly=True,select=1),
+ 'lot_type': fields.selection(_type_get, 'Object Type', size=64),
+ 'adj_total': fields.float('Total Adjudication',select=2),
+ 'user_id':fields.many2one('res.users', 'User', select=1)
+ }
+
+ def init(self, cr):
+ cr.execute("""
+ create or replace view report_auction_estimation_adj_category as (
+ select
+ min(l.id) as id,
+ to_char(l.create_date, 'YYYY-MM-01') as date,
+ l.lot_type as lot_type,
+ sum(l.lot_est1) as lot_est1,
+ sum(l.lot_est2) as lot_est2,
+ sum(l.obj_price) as adj_total,
+ l.create_uid as user_id
+ from
+ auction_lots l,auction_dates m
+ where
+ l.auction_id=m.id and l.obj_price >0
+ group by
+ to_char(l.create_date, 'YYYY-MM-01'),lot_type,l.create_uid
+ )
+ """)
+report_auction_estimation_adj_category()
+
+class report_auction_adjudication(osv.osv):
+ _name = "report.auction.adjudication"
+ _description = "report_auction_adjudication"
+ _auto = False
+ _columns = {
+ 'name': fields.many2one('auction.dates','Auction date',readonly=True,select=1),
+ 'state': fields.selection((('draft','Draft'),('close','Closed')),'Status', select=1),
+ 'adj_total': fields.float('Total Adjudication'),
+ 'date': fields.date('Date', readonly=True,select=1),
+ 'user_id':fields.many2one('res.users', 'User',select=1)
+
+ }
+
+
+ def init(self, cr):
+ cr.execute("""
+ create or replace view report_auction_adjudication as (
+ select
+ l.id as id,
+ l.id as name,
+ sum(m.obj_price) as adj_total,
+ to_char(l.create_date, 'YYYY-MM-01') as date,
+ l.create_uid as user_id,
+ l.state
+ from
+ auction_dates l ,auction_lots m
+ where
+ m.auction_id=l.id
+ group by
+ l.id,l.state,l.name,l.create_uid,to_char(l.create_date, 'YYYY-MM-01')
+
+ )
+ """)
+report_auction_adjudication()
+
+class report_attendance(osv.osv):
+ _name="report.attendance"
+ _description = "Report Sign In/Out"
+ _auto = False
+ #_rec_name='date'
+ _columns = {
+ 'name': fields.date('Date', readonly=True,select=1),
+ 'employee_id' : fields.many2one('hr.employee', 'Employee', select=1, readonly=True),
+ 'total_attendance': fields.float('Total', readonly=True),
+}
+ def init(self, cr):
+ cr.execute("""CREATE OR REPLACE VIEW report_attendance AS
+ SELECT
+ id,
+ name,
+ employee_id,
+ CASE WHEN SUM(total_attendance) < 0
+ THEN (SUM(total_attendance) +
+ CASE WHEN current_date <> name
+ THEN 1440
+ ELSE (EXTRACT(hour FROM current_time) * 60) + EXTRACT(minute FROM current_time)
+ END
+ )
+ ELSE SUM(total_attendance)
+ END /60 as total_attendance
+ FROM (
+ SELECT
+ max(a.id) as id,
+ a.name::date as name,
+ a.employee_id,
+ SUM(((EXTRACT(hour FROM a.name) * 60) + EXTRACT(minute FROM a.name)) * (CASE WHEN a.action = 'sign_in' THEN -1 ELSE 1 END)) as total_attendance
+ FROM hr_attendance a
+ where name > current_date + interval '-1 day'
+ GROUP BY a.name::date, a.employee_id
+ ) AS fs
+ GROUP BY name,fs.id,employee_id
+ """)
+
+report_attendance()
+
+
+class report_deposit_border(osv.osv):
+ _name="report.deposit.border"
+ _description = "Report deposit border"
+ _auto = False
+ _rec_name='bord'
+ _columns = {
+ 'bord': fields.char('Depositer Inventory', size=64, required=True),
+ 'seller': fields.many2one('res.partner','Seller',select=1),
+ 'moy_est' : fields.float('Avg. Est', select=1, readonly=True),
+ 'total_marge': fields.float('Total margin', readonly=True),
+ 'nb_obj':fields.float('# of objects', readonly=True),
+}
+ def init(self, cr):
+ cr.execute("""CREATE OR REPLACE VIEW report_deposit_border AS
+ SELECT
+ min(al.id) as id,
+ ab.partner_id as seller,
+ ab.name as bord,
+ COUNT(al.id) as nb_obj,
+ SUM((al.lot_est1 + al.lot_est2)/2) as moy_est,
+ SUM(al.net_revenue)/(count(ad.id)) as total_marge
+
+ FROM
+ auction_lots al,auction_deposit ab,auction_dates ad
+ WHERE
+ ad.id=al.auction_id
+ and al.bord_vnd_id=ab.id
+ GROUP BY
+ ab.name,ab.partner_id""")
+report_deposit_border()
+
+class report_object_encoded(osv.osv):
+ _name = "report.object.encoded"
+ _description = "Object encoded"
+ _auto = False
+ _columns = {
+ 'state': fields.selection((('draft','Draft'),('unsold','Unsold'),('paid','Paid'),('invoiced','Invoiced')),'Status', required=True,select=1),
+ 'user_id':fields.many2one('res.users', 'User', select=1),
+ 'estimation': fields.float('Estimation',select=2),
+ 'date': fields.date('Create Date', required=True),
+# 'gross_revenue':fields.float('Gross revenue',readonly=True, select=2),
+# 'net_revenue':fields.float('Net revenue',readonly=True, select=2),
+# 'obj_margin':fields.float('Net margin', readonly=True, select=2),
+ 'obj_ret':fields.integer('# obj ret', readonly=True, select=2),
+# 'adj':fields.integer('Adj.', readonly=True, select=2),
+ 'obj_num':fields.integer('# of Encoded obj.', readonly=True, select=2),
+ }
+ def init(self, cr):
+ cr.execute('''create or replace view report_object_encoded as
+ (select min(al.id) as id,
+ to_char(al.create_date, 'YYYY-MM-DD') as date,
+ al.state as state,
+ al.create_uid as user_id,
+ (SELECT count(1) FROM auction_lots WHERE obj_ret>0) as obj_ret,
+ sum((100* al.lot_est1)/al.obj_price) as estimation,
+ COUNT(al.product_id) as obj_num
+ from auction_lots al
+ where al.obj_price>0 and state='draft'
+ group by to_char(al.create_date, 'YYYY-MM-DD'), al.state, al.create_uid)
+ ''')
+report_object_encoded()
+
+
+class report_object_encoded_manager(osv.osv):
+ _name = "report.object.encoded.manager"
+ _description = "Object encoded"
+ _auto = False
+ _columns = {
+ 'user_id':fields.many2one('res.users', 'User', select=True),
+ 'estimation': fields.float('Estimation',select=True),
+ 'date': fields.date('Create Date', required=True),
+ 'gross_revenue':fields.float('Gross revenue',readonly=True, select=True),
+ 'net_revenue':fields.float('Net revenue',readonly=True, select=True),
+ 'obj_margin':fields.float('Net margin', readonly=True, select=True),
+ 'obj_ret':fields.integer('# obj ret', readonly=True, select=True),
+ 'adj':fields.integer('Adj.', readonly=True, select=True),
+ 'obj_num':fields.integer('# of Encoded obj.', readonly=True, select=True),
+ }
+ def init(self, cr):
+ cr.execute('''create or replace view report_object_encoded_manager as
+ (select
+ min(al.id) as id,
+ to_char(al.create_date, 'YYYY-MM-DD') as date,
+ al.create_uid as user_id,
+ sum((100*lot_est1)/obj_price) as estimation,
+ (SELECT count(1) FROM auction_lots WHERE obj_ret>0) as obj_ret,
+ SUM(al.gross_revenue) as "gross_revenue",
+ SUM(al.net_revenue) as "net_revenue",
+ SUM(al.net_revenue)/count(al.id) as "obj_margin",
+ COUNT(al.product_id) as obj_num,
+ SUM(al.obj_price) as "adj"
+ from auction_lots al
+ where al.obj_price>0
+ group by to_char(al.create_date, 'YYYY-MM-DD'), al.create_uid)
+ ''')
+report_object_encoded_manager()
+
+class report_unclassified_objects(osv.osv):
+ _name = "report.unclassified.objects"
+ _description = "Unclassified objects "
+ _auto = False
+ _columns = {
+ 'name': fields.char('Short Description',size=64, required=True),
+ 'obj_num': fields.integer('Catalog Number'),
+ 'obj_price': fields.float('Adjudication price'),
+ 'lot_num': fields.integer('List Number', required=True, select=1 ),
+ 'state': fields.selection((('draft','Draft'),('unsold','Unsold'),('paid','Paid'),('sold','Sold')),'Status', required=True, readonly=True),
+ 'obj_comm': fields.boolean('Commission'),
+ 'bord_vnd_id': fields.many2one('auction.deposit', 'Depositer Inventory', required=True),
+ 'ach_login': fields.char('Buyer Username',size=64),
+ 'lot_est1': fields.float('Minimum Estimation'),
+ 'lot_est2': fields.float('Maximum Estimation'),
+ 'lot_type': fields.selection(_type_get, 'Object category', size=64),
+ 'auction': fields.many2one('auction.dates', 'Auction date',readonly=True, select=1),
+ }
+ def init(self, cr):
+ cr.execute("""create or replace view report_unclassified_objects as
+ (select
+ min(al.id) as id,
+ al.name as name,
+ al.obj_price as obj_price,
+ al.obj_num as obj_num,
+ al.lot_num as lot_num,
+ al.state as state,
+ al.obj_comm as obj_comm,
+ al.bord_vnd_id as bord_vnd_id,
+ al.ach_login as ach_login,
+ al.lot_est1 as lot_est1,
+ al.lot_est2 as lot_est2,
+ al.lot_type as lot_type,
+ al.auction_id as auction
+ from auction_lots al,auction_lot_category ac
+ where (al.lot_type=ac.name) AND (ac.aie_categ='41') AND (al.auction_id is null)
+group by al.obj_price,al.obj_num, al.lot_num, al.state, al.obj_comm,al.bord_vnd_id,al.ach_login,al.lot_est1,al.lot_est2,al.lot_type,al.auction_id,al.name)
+ """)
+report_unclassified_objects()
diff --git a/addons/auction/report/report_auction_view.xml b/addons/auction/report/report_auction_view.xml
new file mode 100644
index 00000000000..f601739fe25
--- /dev/null
+++ b/addons/auction/report/report_auction_view.xml
@@ -0,0 +1,668 @@
+
+
+
+
+
+ Auction's Summary
+ report.auction
+ tree
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ report.auction.search
+ report.auction
+ search
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ report.auction.graph
+ report.auction
+ graph
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Auction's Summary
+ report.auction
+ form
+ tree,graph
+
+
+ {'search_default_month':1}
+
+
+
+
+
+
+
+
+
+
+
+ Unplanned objects
+ report.unplanned.object
+ tree
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Unplanned objects
+ report.unplanned.object
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+=============================
+estimation.adj.category
+==============================
+
+ report.auction.estimation.adj.category.form
+ report.auction.estimation.adj.category
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+ report.auction.estimation.adj.category.tree
+ report.auction.estimation.adj.category
+ tree
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ report.auction.estimation.adj.category.graph
+ report.auction.estimation.adj.category
+ graph
+
+
+
+
+
+
+
+
+
+
+
+
+ Min est/Adj/Max est
+ report.auction.estimation.adj.category
+ form
+ graph,tree
+ [('date','like',time.strftime('%Y-%m'))]
+
+
+
+ Min est/Adj/Max est
+ report.auction.estimation.adj.category
+ form
+ graph,tree
+ [('date','like',time.strftime('%Y-%m')),('user_id','=',uid)]
+
+
+
+
+
+
+
+
+
+
+ report attendance
+ report.attendance
+ tree
+
+
+
+
+
+
+
+
+
+
+ Graph attendance
+ report.attendance
+ graph
+
+
+
+
+
+
+
+
+
+
+
+
+ report.attendance
+ form
+ tree,graph
+ [('name','=',time.strftime('%Y-%m-%d')),('employee_id','=',uid)]
+
+
+
+
+
+
+ report.attendance
+ form
+ tree,graph
+ [('name','=',time.strftime('%Y-%m-%d'))]
+
+
+
+
+==============================
+My Latest Objects
+==============================
+
+ auction.lots
+ form
+ tree,form
+ [('create_uid','=',uid)]
+
+
+
+ auction.lots
+ form
+ tree,form
+
+
+
+
+=============================
+My Latest Deposit
+==============================
+
+
+ auction.deposit
+ form
+ tree,form
+ [('create_uid','=',uid)]
+
+
+
+
+ auction.deposit
+ form
+ tree,form
+
+
+
+=============================
+Objects per Day
+==============================
+
+ Objects by date
+ report.auction.object.date
+ tree
+
+
+
+
+
+
+
+
+
+
+
+ Object date
+ report.auction.object.date
+ form
+
+
+
+
+
+
+
+
+
+
+
+ report.auction.object.date.graph
+ report.auction.object.date
+ graph
+
+
+
+
+
+
+
+
+
+
+
+ report.auction.object.date
+ form
+ graph,tree
+ [('user_id','=',uid),('month','=',time.strftime('%Y-%m-01'))]
+
+
+ report.auction.object.date
+ form
+ graph,tree
+ [('month','=',time.strftime('%Y-%m-01'))]
+
+
+
+
+
+
+ Detailed lots
+ auction.lots
+ form
+ [('auction_id','=', active_id)]
+
+
+
+ tree_but_open
+ auction.dates
+ Open auction
+
+
+
+
+
+ Simplified lots for adjudication
+ auction.lots
+ form
+ [('auction_id','=',active_id)]
+
+
+
+
+ tree_but_action
+ auction.dates
+ Open lots for adjudication
+
+
+
+
+
+ Auction dates
+ auction.dates
+ tree
+ [('state','=', 'draft')]
+
+
+=============================
+Auction adjudication
+==============================
+
+
+ report.auction.adjudication.tree
+ report.auction.adjudication
+ tree
+
+
+
+
+
+
+
+
+
+
+ report.auction.adjudication.graph
+ report.auction.adjudication
+ graph
+
+
+
+
+
+
+
+
+
+
+ report.auction.adjudication
+ form
+ graph,tree
+
+
+
+
+
+ Depositer's statistics
+ report.deposit.border
+ tree
+
+
+
+
+
+
+
+
+
+
+
+
+
+=============================
+Object encoded
+==============================
+
+ report.object.encoded.form
+ report.object.encoded
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+ report.object.encoded.tree
+ report.object.encoded
+ tree
+
+
+
+
+
+
+
+
+
+
+
+
+
+ report.object.encoded.graph
+ report.object.encoded
+ graph
+
+
+
+
+
+
+
+
+
+
+
+ report.object.encoded
+ form
+ tree
+ [('user_id','=',uid),('date','ilike',time.strftime('%Y-%m'))]
+
+
+
+ report.object.encoded.tree
+ report.object.encoded.manager
+ tree
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ report.object.encoded.graph
+ report.object.encoded.manager
+ graph
+
+
+
+
+
+
+
+
+
+
+
+
+
+ report.object.encoded.manager
+ form
+ tree
+ [('date','ilike',time.strftime('%Y-%m'))]
+
+
+
+ report.unclassified.objects
+ report.unclassified.objects
+ tree
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/addons/auction/report/rml_template.xsl b/addons/auction/report/rml_template.xsl
new file mode 100644
index 00000000000..2725dce5b76
--- /dev/null
+++ b/addons/auction/report/rml_template.xsl
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/auction/security/ir.model.access.csv b/addons/auction/security/ir.model.access.csv
index 642209edd05..47850e2ad78 100644
--- a/addons/auction/security/ir.model.access.csv
+++ b/addons/auction/security/ir.model.access.csv
@@ -8,12 +8,7 @@
"access_auction_bid","auction.bid","model_auction_bid","base.group_user",1,1,1,1
"access_auction_bid_line","auction.bid.line","model_auction_bid_line","base.group_user",1,1,1,1
"access_auction_lot_history","auction.lot.history","model_auction_lot_history","base.group_user",1,1,1,1
-"access_report_buyer_auction","report.buyer.auction","model_report_buyer_auction","base.group_user",1,0,0,0
-"access_report_buyer_auction2","report.buyer.auction2","model_report_buyer_auction2","base.group_user",1,0,0,0
-"access_report_seller_auction","report.seller.auction","model_report_seller_auction","base.group_user",1,0,0,0
-"access_report_seller_auction2","report.seller.auction2","model_report_seller_auction2","base.group_user",1,0,0,0
-"access_report_auction_view","report.auction.view","model_report_auction_view","base.group_user",1,0,0,0
-"access_report_auction_view2","report.auction.view2","model_report_auction_view2","base.group_user",1,0,0,0
+"access_report_auction","report.auction","model_report_auction","base.group_user",1,0,0,0
"access_report_auction_object_date","report.auction.object.date","model_report_auction_object_date","base.group_user",1,0,0,0
"access_report_auction_estimation_adj_category","report.auction.estimation.adj.category","model_report_auction_estimation_adj_category","base.group_user",1,0,0,0
"access_report_auction_adjudication","report.auction.adjudication","model_report_auction_adjudication","base.group_user",1,0,0,0
@@ -22,3 +17,4 @@
"access_report_object_encoded","report.object.encoded","model_report_object_encoded","base.group_user",1,0,0,0
"access_report_object_encoded_manager","report.object.encoded.manager","model_report_object_encoded_manager","base.group_user",1,0,0,0
"access_report_unclassified_objects","report.unclassified.objects","model_report_unclassified_objects","base.group_user",1,0,0,0
+"access_aie_category","aie.category","model_aie_category","base.group_user",1,0,0,0
diff --git a/addons/auction/test/auction.yml b/addons/auction/test/auction.yml
index 968bb5f6bbf..a77ad4ccda6 100644
--- a/addons/auction/test/auction.yml
+++ b/addons/auction/test/auction.yml
@@ -18,12 +18,37 @@
warranty: 0.0
weight: 0.0
weight_net: 0.0
+
-
I create a new artist for an object.
-
!record {model: auction.artists, id: auction_artists_vincentvangogh0}:
birth_death_dates: 1853-1900
name: Vincent van Gogh
+
+-
+ I modifying a expenses journal record for analytic journal.
+-
+ !record {model: account.journal, id: account.expenses_journal}:
+ analytic_journal_id: account.exp
+-
+ I modifying a sales journal record for analytic journal.
+-
+ !record {model: account.journal, id: account.sales_journal}:
+ analytic_journal_id: account.cose_journal_sale
+
+-
+ I'm creating new partner "Mark Johnson" with him email "info@mycustomer.com".
+-
+ !record {model: res.partner, id: res_partner_markjohnson0}:
+ address:
+ - city: Bruxelles
+ country_id: base.be
+ street: Rue des Palais 51, bte 33
+ type: default
+ zip: '1000'
+ email: 'info@mycustomer.com'
+ name: Mark Johnson
-
Now I want to associate an object with the auction so for that I create an auction "Antique furniture exhibition"
-
@@ -37,7 +62,8 @@
expo2: '2010-05-19'
journal_id: account.expenses_journal
journal_seller_id: account.sales_journal
- name: Antique furniture exhibition
+ name: Antique furniture exhibition
+
-
An object is being deposited for an auction,I create a seller's deposit record.
-
@@ -45,12 +71,12 @@
date_dep: '2010-05-18'
method: keep
name: AD/006
- partner_id: base.res_partner_4
+ partner_id: base.res_partner_9
-
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
+ ach_uid: res_partner_markjohnson0
artist_id: auction_artists_vincentvangogh0
auction_id: auction_dates_antiquefurnitureexhibition0
bord_vnd_id: auction_deposit_ad0
@@ -72,7 +98,7 @@
auction_id: auction_dates_antiquefurnitureexhibition0
contact_tel: (+32)2 211 34 83
name: bid/001
- partner_id: auction.partner_record1
+ partner_id: res_partner_markjohnson0
-
I create a bid line.
-
@@ -87,7 +113,7 @@
!record {model: auction.bid, id: auction_bid_bid1}:
auction_id: auction_dates_antiquefurnitureexhibition0
name: bid/002
- partner_id: base.res_partner_2
+ partner_id: res_partner_markjohnson0
-
I create a bid line.
-
@@ -104,62 +130,16 @@
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 Seller's Summary.
--
- !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 Seller's Revenues.
--
- !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 Buyer's Summary.
--
- !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 Buyer's Revenue.
--
- !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 Auction's Summary.
-
!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 Auction's Revenues.
--
- !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!')
+ rep_auc_obj1 = self.pool.get('report.auction')
+ ids2=rep_auc_obj1.search(cr, uid, [('auction', '=', auc_id2.auction_id.id)])
+ assert ids2, _('No record found!')
-
An object has been sold,so I click on the "Sold" button.
-
@@ -174,6 +154,7 @@
from tools.translate import _
auc_id=self.browse(cr, uid, ref("auction_lots_woodenchair0"))
assert(auc_id.state == 'sold'), _('State not changed!')
+
-
Then I click on the Taken Away button.
-
@@ -189,7 +170,7 @@
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
+ I click on the "Create all invoices" button
-
!python {model: auction.dates}: |
self.close(cr, uid, [ref("auction.auction_dates_antiquefurnitureexhibition0")],
@@ -202,3 +183,4 @@
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!')
+
\ No newline at end of file
diff --git a/addons/auction/test/auction_wizard.yml b/addons/auction/test/auction_wizard.yml
index 0998e7a03a5..f7308f8687c 100644
--- a/addons/auction/test/auction_wizard.yml
+++ b/addons/auction/test/auction_wizard.yml
@@ -87,62 +87,7 @@
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.
--
- !record {model: auction.payer.sel, id: auction_payer_sel_0}:
- {}
--
- 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":
- 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.
--
- !record {model: auction.lots.able, id: auction_lots_able_0}:
- {}
--
- 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":
- 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.
--
- !record {model: auction.lots.enable, id: auction_lots_enable_0}:
- confirm_en: 0.0
--
- 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",
- "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
-
diff --git a/addons/auction/wizard/__init__.py b/addons/auction/wizard/__init__.py
index 41ada315889..b8e0ecc6825 100644
--- a/addons/auction/wizard/__init__.py
+++ b/addons/auction/wizard/__init__.py
@@ -29,12 +29,8 @@ import auction_pay_buy
import auction_payer_sel
import auction_lots_sms_send
import auction_catalog_flagey_report
-#import auction_lots_cancel
-#import auction_transfer_unsold_object
-#import auction_aie_send
-#import auction_aie_send_result
import auction_lots_buyer_map
-#import auction_lots_numerotate
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/auction/wizard/auction_catalog_flagey_view.xml b/addons/auction/wizard/auction_catalog_flagey_view.xml
index ca87771cc37..144141f1eab 100644
--- a/addons/auction/wizard/auction_catalog_flagey_view.xml
+++ b/addons/auction/wizard/auction_catalog_flagey_view.xml
@@ -11,11 +11,13 @@
-
+
+
+
-
+
@@ -26,7 +28,7 @@
src_model="auction.dates"
view_mode="form"
target="new"
- key2="client_action_multi"
+ key2="client_print_multi"
id="action_auction_catalog_flagey_wizard"/>
diff --git a/addons/auction/wizard/auction_lots_auction_move.py b/addons/auction/wizard/auction_lots_auction_move.py
index d1303be0887..a9351d5ffa2 100644
--- a/addons/auction/wizard/auction_lots_auction_move.py
+++ b/addons/auction/wizard/auction_lots_auction_move.py
@@ -28,22 +28,14 @@ import tools
import wizard
class auction_lots_auction_move(osv.osv_memory):
-
+ """Auction Move"""
_name = "auction.lots.auction.move"
- _description = "Auction move "
+ _description = __doc__
_columns= {
'auction_id':fields.many2one('auction.dates', 'Auction Date', required=True),
}
-
-# def _top(self, cr, uid, ids, context={}):
-# refs = self.pool.get('auction.lots')
-# rec_ids = refs.browse(cr, uid, context['active_ids'])
-# for rec in rec_ids:
-# if not rec.auction_id:
-# raise osv.except_osv('Error !', 'You can not move a lot that has no auction date')
-# return {}
-
- def auction_move_set(self, cr, uid, ids, context={}):
+
+ def auction_move_set(self, cr, uid, ids, context=None):
"""
This Function update auction date on auction lots to given auction date.
erase the auction lots's object adjudication price and its buyer and change state to draft.
@@ -52,13 +44,14 @@ class auction_lots_auction_move(osv.osv_memory):
@param uid: the current user’s ID for security checks,
@param ids: List of auction lots auction move’s IDs.
"""
- refs = self.pool.get('auction.lots')
+ if not context:
+ context={}
auction_bid_line_obj = self.pool.get('auction.bid_line')
auction_lot_history_obj = self.pool.get('auction.lot.history')
auction_lots_obj = self.pool.get('auction.lots')
- rec_ids = refs.browse(cr, uid, context['active_ids'])
- for datas in self.read(cr, uid, ids):
- if not (datas['auction_id'] and len(context['active_ids'])) :
+ rec_ids = auction_lots_obj.browse(cr, uid, context.get('active_ids', []))
+ for current in self.browse(cr, uid, ids, context):
+ if not (current.auction_id and len(context.get('active_ids', []))):
return {}
# line_ids = auction_bid_line_obj.search(cr, uid, [('lot_id', 'in', context['active_ids'])])
@@ -70,7 +63,7 @@ class auction_lots_auction_move(osv.osv_memory):
'price': rec.obj_ret
})
up_auction = auction_lots_obj.write(cr, uid, [rec.id], {
- 'auction_id':datas['auction_id'],
+ 'auction_id': current.auction_id.id,
'obj_ret': None,
'obj_price': None,
'ach_login': None,
diff --git a/addons/auction/wizard/auction_lots_auction_move_view.xml b/addons/auction/wizard/auction_lots_auction_move_view.xml
index dd116a8bc6c..cd81bfbb633 100644
--- a/addons/auction/wizard/auction_lots_auction_move_view.xml
+++ b/addons/auction/wizard/auction_lots_auction_move_view.xml
@@ -7,14 +7,14 @@
form
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
diff --git a/addons/auction/wizard/auction_lots_buyer_map.py b/addons/auction/wizard/auction_lots_buyer_map.py
index f9225b65291..c0d9e271e8e 100644
--- a/addons/auction/wizard/auction_lots_buyer_map.py
+++ b/addons/auction/wizard/auction_lots_buyer_map.py
@@ -26,7 +26,6 @@ from osv import osv,fields
class wiz_auc_lots_buyer_map(osv.osv_memory):
_name = 'auction.lots.buyer_map'
_description = 'Map Buyer'
-
_columns = {
'ach_login': fields.char('Buyer Username', size=64, required=True),
'ach_uid': fields.many2one('res.partner','Buyer', required=True),
@@ -42,19 +41,17 @@ class wiz_auc_lots_buyer_map(osv.osv_memory):
@param context: A standard dictionary
@return: A dictionary which of fields with values.
"""
- ids = context and context.get('active_ids',False) or False
- assert ids, _('Active IDs not Found')
res = super(wiz_auc_lots_buyer_map,self).default_get(cr, uid, fields, context)
- cr.execute('select id from auction_lots where (ach_uid is null and ach_login is not null) ')
- v_ids = [x[0] for x in cr.fetchall()]
- for rec in self.pool.get('auction.lots').browse(cr, uid, v_ids, context):
+ auction_lots_obj = self.pool.get('auction.lots')
+ lots_ids = auction_lots_obj.search(cr, uid, [('ach_uid', '=', ''), ('ach_login', '!=', '')])
+ for rec in auction_lots_obj.browse(cr, uid, lots_ids, context):
if (not rec.ach_uid or not rec.ach_login):
- res.update(self._start(cr, uid, ids, context))
- return res
- res.update(self._start(cr, uid, ids, context))
+ res.update(self._start(cr, uid, context.get('active_ids', []), context))
+ return res
+ res.update(self._start(cr, uid, context.get('active_ids', []), context))
return res
- def _start(self, cr, uid, ids, context):
+ def _start(self, cr, uid, ids, context=None):
"""
Returns login if already there in the selected record.
@param self: The object pointer.
@@ -64,6 +61,8 @@ class wiz_auc_lots_buyer_map(osv.osv_memory):
@param context: A standard dictionary
@return: login field from current record.
"""
+ if not context:
+ context={}
lots_obj = self.pool.get('auction.lots')
for rec in lots_obj.browse(cr, uid, ids, context):
if (len(ids)==1) and (not rec.ach_uid and not rec.ach_login):
@@ -72,7 +71,7 @@ class wiz_auc_lots_buyer_map(osv.osv_memory):
return {'ach_login': rec.ach_login}
return {}
- def buyer_map_set(self, cr, uid, ids, context):
+ def buyer_map_set(self, cr, uid, ids, context=None):
"""
To map the buyer and login name.
@param self: The object pointer.
@@ -80,16 +79,16 @@ class wiz_auc_lots_buyer_map(osv.osv_memory):
@param uid: ID of the user currently logged in
@param ids: List of ids
@param context: A standard dictionary
- @return:
"""
- rec_ids = context and context.get('active_ids',False) or False
+ if not context:
+ context={}
+ rec_ids = context and context.get('active_ids',[]) or []
assert rec_ids, _('Active IDs not Found')
- datas = self.read(cr, uid, ids[0], ['ach_login','ach_uid'])
lots_obj = self.pool.get('auction.lots')
- recs = lots_obj.browse(cr, uid, rec_ids, context)
- for rec in recs:
- if rec.ach_login==datas['ach_login']:
- lots_obj.write(cr, uid, [rec.id], {'ach_uid': datas['ach_uid']}, context=context)
+ for current in self.browse(cr, uid, ids):
+ for lots in lots_obj.browse(cr, uid, rec_ids, context):
+ if lots.ach_login == current.ach_login:
+ lots_obj.write(cr, uid, [lots.id], {'ach_uid': current.ach_uid.id}, context=context)
return {}
def fields_view_get(self, cr, uid, view_id=None, view_type='form',
@@ -102,8 +101,12 @@ class wiz_auc_lots_buyer_map(osv.osv_memory):
@param context: A standard dictionary
@return: New arch of view.
"""
- record_ids = context and context.get('active_ids', False) or False
+ if not context:
+ context={}
+ record_ids = context and context.get('active_ids', []) or []
res = super(wiz_auc_lots_buyer_map, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar,submenu=False)
+ if context.get('active_model','') != 'auction.lots':
+ return res
lots_obj = self.pool.get('auction.lots')
if record_ids:
try:
@@ -111,9 +114,10 @@ class wiz_auc_lots_buyer_map(osv.osv_memory):
if lots.ach_uid:
res['arch'] = """
-
+
+
diff --git a/addons/auction/wizard/auction_lots_buyer_map_view.xml b/addons/auction/wizard/auction_lots_buyer_map_view.xml
index c76c74983d2..85fe621f3df 100644
--- a/addons/auction/wizard/auction_lots_buyer_map_view.xml
+++ b/addons/auction/wizard/auction_lots_buyer_map_view.xml
@@ -10,15 +10,17 @@
form
+
-
+
+
+ type="object" icon="gtk-go-forward" />
diff --git a/addons/auction/wizard/auction_lots_cancel.py b/addons/auction/wizard/auction_lots_cancel.py
index 35207ff3bfc..195323e32d5 100644
--- a/addons/auction/wizard/auction_lots_cancel.py
+++ b/addons/auction/wizard/auction_lots_cancel.py
@@ -29,7 +29,7 @@ class auction_lots_cancel(osv.osv):
_name = 'auction.lots.cancel'
_description = 'To cancel auction lots.'
- def cancel(self, cr, uid, ids, context):
+ def cancel(self, cr, uid, ids, context=None):
"""
To cancel the auction lot
@@ -40,10 +40,11 @@ class auction_lots_cancel(osv.osv):
@param context: A standard dictionary
@return:
"""
-
+ if not context:
+ context={}
lots_obj = self.pool.get('auction.lots')
invoice_obj = self.pool.get('account.invoice')
- lot = lots_obj.browse(cr, uid, context['active_id'], context)
+ lot = lots_obj.browse(cr, uid, context.get('active_id', False), context)
if lot.ach_inv_id:
supplier_refund_inv_id = invoice_obj.refund(cr, uid, [lot.ach_inv_id.id])
if lot.sel_inv_id:
diff --git a/addons/auction/wizard/auction_lots_cancel_view.xml b/addons/auction/wizard/auction_lots_cancel_view.xml
index 77ff6a373b7..03d75515ac0 100644
--- a/addons/auction/wizard/auction_lots_cancel_view.xml
+++ b/addons/auction/wizard/auction_lots_cancel_view.xml
@@ -1,27 +1,27 @@
-
-
- auction.lots.cancel.form
- auction.lots.cancel
- form
-
-
-
-
-
-
-
-
-
-
-
+
+
+ auction.lots.cancel.form
+ auction.lots.cancel
+ form
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/auction/wizard/auction_lots_enable_view.xml b/addons/auction/wizard/auction_lots_enable_view.xml
index 8384524dad2..2a52c2aa048 100644
--- a/addons/auction/wizard/auction_lots_enable_view.xml
+++ b/addons/auction/wizard/auction_lots_enable_view.xml
@@ -7,11 +7,7 @@
form
-
-
-
-
-
+
@@ -20,7 +16,6 @@
-
-
diff --git a/addons/auction/wizard/auction_lots_make_invoice.py b/addons/auction/wizard/auction_lots_make_invoice.py
index ca069c96182..8e463937c50 100644
--- a/addons/auction/wizard/auction_lots_make_invoice.py
+++ b/addons/auction/wizard/auction_lots_make_invoice.py
@@ -34,14 +34,13 @@ class auction_lots_make_invoice(osv.osv_memory):
'amount': fields.float('Invoiced Amount', required =True, readonly=True),
'objects':fields.integer('# of objects', required =True, readonly=True),
'number':fields.char('Invoice Number', size=64),
-
}
_defaults = {
'number': lambda *a: False,
}
- def default_get(self, cr, uid, fields, context):
+ def default_get(self, cr, uid, fields, context=None):
"""
To get default values for the object.
@param self: The object pointer.
@@ -51,16 +50,18 @@ class auction_lots_make_invoice(osv.osv_memory):
@param context: A standard dictionary
@return: A dictionary which of fields with values.
"""
- res = super(auction_lots_make_invoice, self).default_get(cr, uid, fields, context=context)
- for lot in self.pool.get('auction.lots').browse(cr, uid, context.get('active_ids', [])):
+ if not context:
+ context={}
+ res = super(auction_lots_make_invoice, self).default_get(cr, uid, fields, context=context)
+ lots_obj = self.pool.get('auction.lots')
+ for lot in lots_obj.browse(cr, uid, context.get('active_ids', [])):
if 'amount' in fields:
- res.update({'amount': lot.buyer_price})
+ res.update({'amount': lot.seller_price})
if 'objects' in fields:
- res.update({'objects': len(context['active_ids'])})
+ res.update({'objects': len(context.get('active_ids', []))})
return res
-
- def makeInvoices(self, cr, uid, ids, context):
+ def makeInvoices(self, cr, uid, ids, context=None):
"""
Seller invoice :Create an invoice.
@param cr: the current row, from the database cursor.
@@ -68,11 +69,13 @@ class auction_lots_make_invoice(osv.osv_memory):
@param ids: List of Auction lots make invoice’s IDs
@return: dictionary of account invoice form.
"""
+ if not context:
+ context={}
order_obj = self.pool.get('auction.lots')
mod_obj = self.pool.get('ir.model.data')
result = mod_obj._get_id(cr, uid, 'account', 'view_account_invoice_filter')
id = mod_obj.read(cr, uid, result, ['res_id'])
- lots_ids = order_obj.seller_trans_create(cr, uid, context['active_ids'], context)
+ lots_ids = order_obj.seller_trans_create(cr, uid, context.get('active_ids', []), context)
return {
'domain': "[('id','in', ["+','.join(map(str, lots_ids))+"])]",
'name': 'Seller invoices',
diff --git a/addons/auction/wizard/auction_lots_make_invoice_buyer.py b/addons/auction/wizard/auction_lots_make_invoice_buyer.py
index 9357983c315..1c36570129c 100644
--- a/addons/auction/wizard/auction_lots_make_invoice_buyer.py
+++ b/addons/auction/wizard/auction_lots_make_invoice_buyer.py
@@ -21,8 +21,10 @@
from osv import fields, osv
class auction_lots_make_invoice_buyer(osv.osv_memory):
+ """Make Invoice for Buyer"""
+
_name = "auction.lots.make.invoice.buyer"
- _description = "Make invoice buyer "
+ _description = __doc__
_columns= {
'amount': fields.float('Invoiced Amount', required =True, readonly=True),
@@ -35,7 +37,7 @@ class auction_lots_make_invoice_buyer(osv.osv_memory):
'number': lambda *a: False,
}
- def default_get(self, cr, uid, fields, context):
+ def default_get(self, cr, uid, fields, context=None):
"""
To get default values for the object.
@param self: The object pointer.
@@ -45,14 +47,17 @@ class auction_lots_make_invoice_buyer(osv.osv_memory):
@param context: A standard dictionary
@return: A dictionary which of fields with values.
"""
+ if not context:
+ context={}
res = super(auction_lots_make_invoice_buyer, self).default_get(cr, uid, fields, context=context)
- for lot in self.pool.get('auction.lots').browse(cr, uid, context.get('active_ids', [])):
+ lots_obj=self.pool.get('auction.lots')
+ for lot in lots_obj.browse(cr, uid, context.get('active_ids', [])):
if 'amount' in fields:
res.update({'amount': lot.buyer_price})
if 'buyer_id' in fields:
res.update({'buyer_id': lot.ach_uid and lot.ach_uid.id or False})
if 'objects' in fields:
- res.update({'objects': len(context['active_ids'])})
+ res.update({'objects': len(context.get('active_ids', []))})
return res
def makeInvoices(self, cr, uid, ids, context):
@@ -67,12 +72,12 @@ class auction_lots_make_invoice_buyer(osv.osv_memory):
mod_obj = self.pool.get('ir.model.data')
result = mod_obj._get_id(cr, uid, 'account', 'view_account_invoice_filter')
id = mod_obj.read(cr, uid, result, ['res_id'])
- lots = order_obj.browse(cr, uid, context['active_ids'])
- for data in self.read(cr, uid, ids):
- invoice_number = data['number']
+ lots = order_obj.browse(cr, uid, context.get('active_ids', []))
+ for current in self.browse(cr, uid, ids, context):
+ invoice_number = current.number
for lot in lots:
- up_auction = order_obj.write(cr, uid, [lot.id], {'ach_uid': data['buyer_id']})
- lots_ids = order_obj.lots_invoice(cr, uid, context['active_ids'], context, data['number'])
+ up_auction = order_obj.write(cr, uid, [lot.id], {'ach_uid': current.buyer_id.id})
+ lots_ids = order_obj.lots_invoice(cr, uid, context.get('active_ids', []), context, current.number)
return {
'domain': "[('id','in', ["+','.join(map(str, lots_ids))+"])]",
'name': 'Buyer invoices',
diff --git a/addons/auction/wizard/auction_lots_make_invoice_buyer_view.xml b/addons/auction/wizard/auction_lots_make_invoice_buyer_view.xml
index ba4aac79ca6..d71cfb59414 100644
--- a/addons/auction/wizard/auction_lots_make_invoice_buyer_view.xml
+++ b/addons/auction/wizard/auction_lots_make_invoice_buyer_view.xml
@@ -16,8 +16,8 @@
-
-
+
+
@@ -29,8 +29,7 @@
view_mode="form"
target="new"
key2="client_action_multi"
- id="action_auction_lots_make_invoice_buyer"/>
-
-
+ id="action_auction_lots_make_invoice_buyer"/>
+
diff --git a/addons/auction/wizard/auction_lots_make_invoice_view.xml b/addons/auction/wizard/auction_lots_make_invoice_view.xml
index 29ef3e09348..ca650f48afd 100644
--- a/addons/auction/wizard/auction_lots_make_invoice_view.xml
+++ b/addons/auction/wizard/auction_lots_make_invoice_view.xml
@@ -14,8 +14,8 @@
-
-
+
+
diff --git a/addons/auction/wizard/auction_lots_sms_send.py b/addons/auction/wizard/auction_lots_sms_send.py
index a5736ce4990..09dabd291ab 100644
--- a/addons/auction/wizard/auction_lots_sms_send.py
+++ b/addons/auction/wizard/auction_lots_sms_send.py
@@ -21,11 +21,7 @@
from osv import fields, osv
from tools.translate import _
-import netsvc
-import pooler
-import time
import tools
-import wizard
class auction_lots_sms_send(osv.osv_memory):
@@ -36,7 +32,7 @@ class auction_lots_sms_send(osv.osv_memory):
'user':fields.char('Login', size=64, required=True),
'password':fields.char('Password', size=64, required=True),
'text':fields.text('SMS Message', required=True)
- }
+ }
def sms_send(self, cr, uid, ids, context):
"""
@@ -65,12 +61,6 @@ class auction_lots_sms_send(osv.osv_memory):
tools.smssend(data['user'], data['password'], data['app_id'], unicode(data['text'], 'utf-8').encode('latin1'), to)
nbr += 1
return {'sms_sent': nbr}
-
- if to:
- tools.smssend(data['user'], data['password'], data['app_id'], unicode(data['text'], 'utf-8').encode('latin1'), to)
- nbr += 1
- return {'sms_sent': nbr}
-#
auction_lots_sms_send()
diff --git a/addons/auction/wizard/auction_lots_sms_send_view.xml b/addons/auction/wizard/auction_lots_sms_send_view.xml
index 22aa9d681ac..f0bf665a882 100644
--- a/addons/auction/wizard/auction_lots_sms_send_view.xml
+++ b/addons/auction/wizard/auction_lots_sms_send_view.xml
@@ -9,17 +9,16 @@
-
-
+
-
-
+
+
-
+
-
-
+
+
diff --git a/addons/auction/wizard/auction_pay_buy.py b/addons/auction/wizard/auction_pay_buy.py
index ef8d5a98887..bc20eb75fbe 100644
--- a/addons/auction/wizard/auction_pay_buy.py
+++ b/addons/auction/wizard/auction_pay_buy.py
@@ -27,7 +27,6 @@ import tools
class auction_pay_buy(osv.osv_memory):
_name = "auction.pay.buy"
_description = "Pay buy"
-
_columns= {
'amount': fields.float('Amount paid', digits= (16, 2)),
'buyer_id':fields.many2one('res.partner', 'Buyer'),
@@ -39,7 +38,7 @@ class auction_pay_buy(osv.osv_memory):
'total': fields.float('Amount paid', digits = (16, 2), readonly =True),
}
- def default_get(self, cr, uid, fields, context):
+ def default_get(self, cr, uid, fields, context=None):
"""
To get default values for the object.
@param self: The object pointer.
@@ -49,8 +48,11 @@ class auction_pay_buy(osv.osv_memory):
@param context: A standard dictionary
@return: A dictionary which of fields with values.
"""
- res = super(auction_pay_buy, self).default_get(cr, uid, fields, context=context)
- for lot in self.pool.get('auction.lots').browse(cr, uid, context.get('active_ids', [])):
+ if not context:
+ context={}
+ res = super(auction_pay_buy, self).default_get(cr, uid, fields, context=context)
+ auction_lots_obj= self.pool.get('auction.lots')
+ for lot in auction_lots_obj.browse(cr, uid, context.get('active_ids', [])):
if 'amount' in fields:
res.update({'amount': lot.buyer_price})
if 'buyer_id' in fields:
@@ -73,22 +75,20 @@ class auction_pay_buy(osv.osv_memory):
for datas in self.read(cr, uid, ids):
if not abs(datas['total'] - (datas['amount'] + datas['amount2'] + datas['amount3'])) <0.01:
- rest = datas['total']-(datas['amount'] + datas['amount2'] + datas['amount3'])
+ rest = datas['total'] - (datas['amount'] + datas['amount2'] + datas['amount3'])
raise osv.except_osv('Payment aborted !', 'You should pay all the total: "%.2f" are missing to accomplish the payment.' %(round(rest, 2)))
lots = lot_obj.browse(cr, uid, context['active_ids'], context)
- ref_bk_s = bank_statement_line_obj
-
for lot in lots:
if datas['buyer_id']:
- lot_obj.write(cr, uid, [lot.id], {'ach_uid':datas['buyer_id']})
+ lot_obj.write(cr, uid, [lot.id], {'ach_uid': datas['buyer_id']})
if not lot.auction_id:
raise osv.except_osv('Error !', 'No auction date for "%s": Please set one.'%(lot.name))
lot_obj.write(cr, uid, [lot.id], {'is_ok':True})
for st, stamount in [('statement_id1', 'amount'), ('statement_id2', 'amount2'), ('statement_id3', 'amount3')]:
if datas[st]:
- new_id = ref_bk_s.create(cr, uid, {
+ new_id = bank_statement_line_obj.create(cr, uid, {
'name':'Buyer:'+ str(lot.ach_login or '')+', auction:'+ lots[0].auction_id.name,
'date': time.strftime('%Y-%m-%d'),
'partner_id': datas['buyer_id'] or False,
@@ -100,7 +100,6 @@ class auction_pay_buy(osv.osv_memory):
for lot in lots:
lot_obj.write(cr, uid, [lot.id], {'statement_id':[(4, new_id)]})
return {}
-
auction_pay_buy()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/auction/wizard/auction_pay_buy_view.xml b/addons/auction/wizard/auction_pay_buy_view.xml
index 0a9a3a6dcee..002c4ffd839 100644
--- a/addons/auction/wizard/auction_pay_buy_view.xml
+++ b/addons/auction/wizard/auction_pay_buy_view.xml
@@ -8,6 +8,7 @@
+
@@ -20,7 +21,7 @@
-
+
diff --git a/addons/auction/wizard/auction_payer_sel.py b/addons/auction/wizard/auction_payer_sel.py
index c422ee91857..087eacce9d7 100644
--- a/addons/auction/wizard/auction_payer_sel.py
+++ b/addons/auction/wizard/auction_payer_sel.py
@@ -26,7 +26,7 @@ class auction_payer(osv.osv_memory):
_description = "Auction payer"
def payer(self, cr, uid, ids, context):
- self.pool.get('auction.lots').write(cr, uid, context['active_ids'], {'is_ok':True, 'state':'paid'})
+ self.pool.get('auction.lots').write(cr, uid, context.get('active_ids', []), {'is_ok':True, 'state':'paid'})
return {}
auction_payer()
diff --git a/addons/auction/wizard/auction_taken.py b/addons/auction/wizard/auction_taken.py
index 005fd042646..6beadc6a312 100644
--- a/addons/auction/wizard/auction_taken.py
+++ b/addons/auction/wizard/auction_taken.py
@@ -38,20 +38,22 @@ class auction_taken(osv.osv_memory):
}
def _to_xml(s):
- return s.replace('&','&').replace('<','<').replace('>','>')
+ return s.replace('&', '&').replace('<', '<').replace('>', '>')
- def process(self, cr, uid, ids, context):
+ def process(self, cr, uid, ids, context=None):
"""
- Update Auction lots state to taken_away.
+ This Function update Auction lots state to taken_away.
@param cr: the current row, from the database cursor.
@param uid: the current user’s ID for security checks.
@param ids: List of Auction taken’s IDs
@return: dictionary of lot_ids fields with empty list
"""
+ if not context:
+ context={}
lot_obj = self.pool.get('auction.lots')
- for data in self.read(cr, uid, ids):
- if data['lot_ids']:
- lot_obj.write(cr, uid, data['lot_ids'], {'state':'taken_away'})
+ for current in self.browse(cr, uid, ids, context):
+ for lot in current.lot_ids:
+ lot_obj.write(cr, uid, lot.id, {'state':'taken_away'})
return {'lot_ids': []}
auction_taken()
diff --git a/addons/auction/wizard/auction_taken_view.xml b/addons/auction/wizard/auction_taken_view.xml
index 626caa473ad..b6d59a3b344 100644
--- a/addons/auction/wizard/auction_taken_view.xml
+++ b/addons/auction/wizard/auction_taken_view.xml
@@ -8,11 +8,11 @@
-
+
-
+
@@ -27,16 +27,7 @@
new
-
-
+
diff --git a/addons/base_setup/base_setup_installer.xml b/addons/base_setup/base_setup_installer.xml
index 48710b840ea..3af1a070104 100644
--- a/addons/base_setup/base_setup_installer.xml
+++ b/addons/base_setup/base_setup_installer.xml
@@ -23,18 +23,18 @@
Install Generic Modules
-
-
-
-
-
-
-
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
diff --git a/addons/base_setup/installer.py b/addons/base_setup/installer.py
index c95fa98d8fc..3e340ca8c6f 100644
--- a/addons/base_setup/installer.py
+++ b/addons/base_setup/installer.py
@@ -82,7 +82,7 @@ class base_setup_installer(osv.osv_memory):
help="Installs a preselected set of OpenERP "
"applications which will help you manage your association "
"more efficiently."),
- 'profile_auction':fields.boolean('Auction Houses',
+ 'auction':fields.boolean('Auction Houses',
help="Installs a preselected set of OpenERP "
"applications selected to help you manage your auctions "
"as well as the business processes around them."),