diff --git a/addons/account/report/account_analytic_entries_report_view.xml b/addons/account/report/account_analytic_entries_report_view.xml
index b837186f23c..1df0cf011fd 100644
--- a/addons/account/report/account_analytic_entries_report_view.xml
+++ b/addons/account/report/account_analytic_entries_report_view.xml
@@ -54,6 +54,17 @@
+
+
+
+
+
+
+
+
+
+
+
@@ -70,17 +81,6 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/account/report/account_entries_report_view.xml b/addons/account/report/account_entries_report_view.xml
index f6282046e00..f7dd6da49e3 100644
--- a/addons/account/report/account_entries_report_view.xml
+++ b/addons/account/report/account_entries_report_view.xml
@@ -56,7 +56,7 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -92,19 +105,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml
index 98dd3f64fb7..80985fb3d6a 100644
--- a/addons/account/report/account_invoice_report_view.xml
+++ b/addons/account/report/account_invoice_report_view.xml
@@ -97,6 +97,17 @@
+
+
+
+
+
+
+
+
+
+
+
@@ -118,17 +129,6 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/account_analytic_analysis/account_analytic_analysis.py b/addons/account_analytic_analysis/account_analytic_analysis.py
index 6bd2f2138ec..5a393e1dd83 100644
--- a/addons/account_analytic_analysis/account_analytic_analysis.py
+++ b/addons/account_analytic_analysis/account_analytic_analysis.py
@@ -126,8 +126,8 @@ class account_analytic_account(osv.osv):
where account_analytic_line.account_id IN %s \
and account_analytic_line.invoice_id is not null \
GROUP BY account_analytic_line.account_id",(parent_ids,))
- for account_id, sum in cr.fetchall():
- res[account_id] = sum
+ for account_id, lid in cr.fetchall():
+ res[account_id][f] = lid
for account in accounts:
for child in account.child_ids:
if res[account.id][f] < res.get(child.id, {}).get(f, ''):
@@ -141,8 +141,8 @@ class account_analytic_account(osv.osv):
where account_id IN %s \
and invoice_id is null \
GROUP BY account_analytic_line.account_id" ,(parent_ids,))
- for account_id, sum in cr.fetchall():
- res[account_id][f] = sum
+ for account_id, lwd in cr.fetchall():
+ res[account_id][f] = lwd
for account in accounts:
for child in account.child_ids:
if res[account.id][f] < res.get(child.id, {}).get(f, ''):
@@ -160,8 +160,8 @@ class account_analytic_account(osv.osv):
and invoice_id is null \
AND to_invoice IS NOT NULL \
GROUP BY account_analytic_line.account_id;",(parent_ids,))
- for account_id, sum in cr.fetchall():
- res[account_id][f] = round(sum, dp)
+ for account_id, sua in cr.fetchall():
+ res[account_id][f] = round(sua, dp)
for account in accounts:
for child in account.child_ids:
if account.id != child.id:
@@ -180,8 +180,8 @@ class account_analytic_account(osv.osv):
and account_analytic_journal.type='general' \
GROUP BY account_analytic_line.account_id",(parent_ids,))
ff = cr.fetchall()
- for account_id, sum in ff:
- res[account_id][f] = round(sum, dp)
+ for account_id, hq in ff:
+ res[account_id][f] = round(hq, dp)
for account in accounts:
for child in account.child_ids:
if account.id != child.id:
diff --git a/addons/auction/auction.py b/addons/auction/auction.py
index 5ea2441e6fd..1a61355f382 100644
--- a/addons/auction/auction.py
+++ b/addons/auction/auction.py
@@ -37,7 +37,7 @@ class auction_artists(osv.osv):
_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),
+ 'birth_death_dates':fields.char('Lifespan', size=64),
'biography': fields.text('Biography'),
}
auction_artists()
@@ -69,23 +69,50 @@ class auction_dates(osv.osv):
reads = self.read(cr, uid, ids, ['name', 'auction1'], context)
name = [(r['id'], '['+r['auction1']+'] '+ r['name']) for r in reads]
return name
+
+ def _get_buyer_invoice(self, cr, uid, ids, name, arg, context={}):
+ lots_obj = self.pool.get('auction.lots')
+ result = {}
+ for data in self.browse(cr, uid, ids):
+ inv_ids = []
+ lots_ids = lots_obj.search(cr, uid, [('auction_id','=',data.id),('ach_inv_id','!=',False)])
+ for lot in lots_obj.browse(cr, uid, lots_ids):
+ if lot.ach_inv_id:
+ inv_ids.append(lot.ach_inv_id.id)
+ result[data.id] = inv_ids
+ return result
+
+ def _get_seller_invoice(self, cr, uid, ids, name, arg, context={}):
+ lots_obj = self.pool.get('auction.lots')
+ lots_ids = lots_obj.search(cr, uid, [('auction_id','in',ids)])
+ result = {}
+ for data in self.browse(cr, uid, ids):
+ inv_ids = []
+ lots_ids = lots_obj.search(cr, uid, [('auction_id','=',data.id),('sel_inv_id','!=',False)])
+ for lot in lots_obj.browse(cr, uid, lots_ids):
+ if lot.sel_inv_id:
+ inv_ids.append(lot.sel_inv_id.id)
+ result[data.id] = inv_ids
+ return result
_columns = {
'name': fields.char('Auction Name', size=64, required=True),
- 'expo1': fields.date('First Exposition Day', required=True, help="Beginning Exposition Date For Auction"),
- 'expo2': fields.date('Last Exposition Day', required=True, help="Last Exposition Date For Auction"),
- 'auction1': fields.date('First Auction Day', required=True, help="Start Date Of Auction"),
- 'auction2': fields.date('Last Auction Day', required=True, help="End Date Of Auction"),
- 'journal_id': fields.many2one('account.journal', 'Buyer Journal', required=True, help="Account Journal For Buyer"),
- 'journal_seller_id': fields.many2one('account.journal', 'Seller Journal', required=True, help="Account Journal For Seller"),
- 'buyer_costs': fields.many2many('account.tax', 'auction_buyer_taxes_rel', 'auction_id', 'tax_id', 'Buyer Costs', help="Account Tax For Buyer"),
- 'seller_costs': fields.many2many('account.tax', 'auction_seller_taxes_rel', 'auction_id', 'tax_id', 'Seller Costs', help="Account Tax For Seller"),
+ 'expo1': fields.date('First Exposition Day', required=True, help="Beginning exposition date for auction"),
+ 'expo2': fields.date('Last Exposition Day', required=True, help="Last exposition date for auction"),
+ 'auction1': fields.date('First Auction Day', required=True, help="Start date of auction"),
+ 'auction2': fields.date('Last Auction Day', required=True, help="End date of auction"),
+ 'journal_id': fields.many2one('account.journal', 'Buyer Journal', required=True, help="Account journal for buyer"),
+ 'journal_seller_id': fields.many2one('account.journal', 'Seller Journal', required=True, help="Account journal for seller"),
+ 'buyer_costs': fields.many2many('account.tax', 'auction_buyer_taxes_rel', 'auction_id', 'tax_id', 'Buyer Costs', help="Account tax for buyer"),
+ 'seller_costs': fields.many2many('account.tax', 'auction_seller_taxes_rel', 'auction_id', 'tax_id', 'Seller Costs', help="Account tax for seller"),
'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),
+ 'buyer_invoice_history': fields.function(_get_buyer_invoice, relation='account.invoice', method=True, string="Buyer Invoice", type='many2many'),
+ 'seller_invoice_history': fields.function(_get_seller_invoice, relation='account.invoice', method=True, string="Seller Invoice", type='many2many'),
}
_defaults = {
@@ -355,15 +382,15 @@ class auction_lots(osv.osv):
_columns = {
'bid_lines':fields.one2many('auction.bid_line', 'lot_id', 'Bids'),
- 'auction_id': fields.many2one('auction.dates', 'Auction', select=1, help="Auction For Object"),
- 'bord_vnd_id': fields.many2one('auction.deposit', 'Depositer Inventory', required=True, help="Provide Deposit Information: seller, Withdrawned Method, Object, Deposit Costs"),
- 'name': fields.char('Title', size=64, required=True, help='Auction Object Name'),
+ 'auction_id': fields.many2one('auction.dates', 'Auction', select=1, help="Auction for object"),
+ 'bord_vnd_id': fields.many2one('auction.deposit', 'Depositer Inventory', required=True, help="Provide deposit information: seller, Withdrawned Method, Object, Deposit Costs"),
+ 'name': fields.char('Title', size=64, required=True, help='Auction object name'),
'name2': fields.char('Short Description (2)', size=64),
'lot_type': fields.selection(_type_get, 'Object category', size=64),
- 'author_right': fields.many2one('account.tax', 'Author rights', help="Account Tax For Author Commission"),
+ 'author_right': fields.many2one('account.tax', 'Author rights', help="Account tax for author commission"),
'lot_est1': fields.float('Minimum Estimation', help="Minimum Estimate Price"),
'lot_est2': fields.float('Maximum Estimation', help="Maximum Estimate Price"),
- 'lot_num': fields.integer('List Number', required=True, select=1, help="List Number In Depositer Inventory"),
+ 'lot_num': fields.integer('List Number', required=True, select=1, help="List number in depositer inventory"),
'create_uid': fields.many2one('res.users', 'Created by', readonly=True),
'history_ids':fields.one2many('auction.lot.history', 'lot_id', 'Auction history'),
'lot_local':fields.char('Location', size=64, help="Auction Location"),
@@ -380,15 +407,15 @@ class auction_lots(osv.osv):
'ach_login': fields.char('Buyer Username', size=64),
'ach_uid': fields.many2one('res.partner', 'Buyer'),
'seller_id': fields.related('bord_vnd_id','partner_id', type='many2one', relation='res.partner', string='Seller', readonly=True),
- 'ach_emp': fields.boolean('Taken Away', readonly=True, help="When state is Taken Away, This field is Marked as True"),
- 'is_ok': fields.boolean('Buyer\'s payment', help="When Buyer Pay For Bank statement', This field is Marked"),
+ 'ach_emp': fields.boolean('Taken Away', readonly=True, help="When state is Taken Away, this field is marked as True"),
+ 'is_ok': fields.boolean('Buyer\'s payment', help="When buyer pay for bank statement', this field is marked"),
'ach_inv_id': fields.many2one('account.invoice', 'Buyer Invoice', readonly=True, states={'draft':[('readonly', False)]}),
'sel_inv_id': fields.many2one('account.invoice', 'Seller Invoice', readonly=True, states={'draft':[('readonly', False)]}),
'vnd_lim': fields.float('Seller limit'),
'vnd_lim_net': fields.boolean('Net limit ?', readonly=True),
'image': fields.binary('Image', help="Object Image"),
- 'paid_vnd':fields.function(_getprice, string='Seller Paid', method=True, type='boolean', store=True, multi="paid_vnd", help="When state of Seller Invoice is 'Paid', This field is selected as True."),
- 'paid_ach':fields.function(_getprice, string='Buyer Invoice Reconciled', method=True, type='boolean', store=True, multi="paid_ach", help="When state of Buyer Invoice is 'Paid', This field is selected as True."),
+ 'paid_vnd':fields.function(_getprice, string='Seller Paid', method=True, type='boolean', store=True, multi="paid_vnd", help="When state of Seller Invoice is 'Paid', this field is selected as True."),
+ 'paid_ach':fields.function(_getprice, string='Buyer Invoice Reconciled', method=True, type='boolean', store=True, multi="paid_ach", help="When state of Buyer Invoice is 'Paid', this field is selected as True."),
'state': fields.selection((
('draft', 'Draft'),
('unsold', 'Unsold'),
@@ -404,7 +431,7 @@ class auction_lots(osv.osv):
'gross_revenue':fields.function(_getprice, method=True, string='Gross revenue', store=True, multi="gross_revenue", help="Buyer Price - Seller Price"),
'gross_margin':fields.function(_getprice, method=True, string='Gross Margin (%)', store=True, multi="gross_margin", help="(Gross Revenue*100.0)/ Object Price"),
'costs':fields.function(_getprice, method=True, string='Indirect costs', store=True, multi="costs", help="Deposit cost"),
- 'statement_id': fields.many2many('account.bank.statement.line', 'auction_statement_line_rel', 'auction_id', 'statement', 'Payment', help="Bank statement Line For Given Buyer"),
+ 'statement_id': fields.many2many('account.bank.statement.line', 'auction_statement_line_rel', 'auction_id', 'statement', 'Payment', help="Bank statement line for given buyer"),
'net_revenue':fields.function(_getprice, method=True, string='Net revenue', store=True, multi="net_revenue", help="Buyer Price - Seller Price - Indirect Cost"),
'net_margin':fields.function(_getprice, method=True, string='Net Margin (%)', store=True, multi="net_margin", help="(Net Revenue * 100)/ Object Price"),
}
@@ -761,7 +788,7 @@ class auction_bid(osv.osv):
_order = 'id desc'
_columns = {
'partner_id': fields.many2one('res.partner', 'Buyer Name', required=True),
- 'contact_tel':fields.char('Contact', size=64),
+ 'contact_tel':fields.char('Contact Number', 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'),
diff --git a/addons/auction/auction_view.xml b/addons/auction/auction_view.xml
index f91f77429ca..d149fc89f1c 100644
--- a/addons/auction/auction_view.xml
+++ b/addons/auction/auction_view.xml
@@ -1,7 +1,7 @@
-
+
@@ -14,9 +14,8 @@
tree
-
-
-
+
+
@@ -26,12 +25,15 @@
form
@@ -105,27 +107,39 @@
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
@@ -136,6 +150,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -332,13 +384,10 @@
-
-
-
+ height="575" width="285" widget="one2many_list">
@@ -352,14 +401,12 @@
-
-
-
+
@@ -369,6 +416,9 @@
+
+
+
@@ -450,8 +500,7 @@
src_model="auction.lots"
id="act_auction_lot_open_bid"/>
-
-
+
auction.deposit.form
@@ -459,14 +508,15 @@
form
diff --git a/addons/auction/report/bids_lots.rml b/addons/auction/report/bids_lots.rml
index 9d688868d30..c2cad707a57 100644
--- a/addons/auction/report/bids_lots.rml
+++ b/addons/auction/report/bids_lots.rml
@@ -74,10 +74,10 @@
[[ o.ach_uid and o.ach_uid.name or False]]
- [[o.bid_lines[0] and o.bid_lines[0].bid_id.name or removeParentNode('font')]]
+ [[ o.bid_lines and o.bid_lines[0] and o.bid_lines[0].bid_id.name or removeParentNode('font')]]
- [[o.bid_lines[0] and o.bid_lines[0].bid_id.contact_tel or removeParentNode('font')]]
+ [[o.bid_lines and o.bid_lines[0] and o.bid_lines[0].bid_id.contact_tel or removeParentNode('font')]]
- [[o.bid_lines[0] and o.bid_lines[0].bid_id.contact_tel or removeParentNode('font')]]
+ [[o.bid_lines and o.bid_lines[0] and o.bid_lines[0].bid_id.contact_tel or removeParentNode('font')]]
diff --git a/addons/auction/wizard/auction_lots_make_invoice_view.xml b/addons/auction/wizard/auction_lots_make_invoice_view.xml
index ddd82ac3cda..56903865e5f 100644
--- a/addons/auction/wizard/auction_lots_make_invoice_view.xml
+++ b/addons/auction/wizard/auction_lots_make_invoice_view.xml
@@ -15,7 +15,8 @@
-
+
+
diff --git a/addons/auction/wizard/auction_pay_buy_view.xml b/addons/auction/wizard/auction_pay_buy_view.xml
index d4ba91cad84..f7059d1374e 100644
--- a/addons/auction/wizard/auction_pay_buy_view.xml
+++ b/addons/auction/wizard/auction_pay_buy_view.xml
@@ -30,7 +30,8 @@
-
+
+
diff --git a/addons/auction/wizard/auction_taken.py b/addons/auction/wizard/auction_taken.py
index 6beadc6a312..7db905cd576 100644
--- a/addons/auction/wizard/auction_taken.py
+++ b/addons/auction/wizard/auction_taken.py
@@ -53,7 +53,7 @@ class auction_taken(osv.osv_memory):
lot_obj = self.pool.get('auction.lots')
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'})
+ lot_obj.write(cr, uid, lot.id, {'state':'taken_away', 'ach_emp': True})
return {'lot_ids': []}
auction_taken()
diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml
index f9a3a1fb629..41d41ef0502 100644
--- a/addons/crm/crm_lead_view.xml
+++ b/addons/crm/crm_lead_view.xml
@@ -31,7 +31,7 @@
-
+
Lead Sources
@@ -337,6 +337,20 @@
help="Show Sales Team"/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -354,20 +368,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/crm/crm_opportunity_view.xml b/addons/crm/crm_opportunity_view.xml
index e816e3f0b1d..8101a0bcfb2 100644
--- a/addons/crm/crm_opportunity_view.xml
+++ b/addons/crm/crm_opportunity_view.xml
@@ -311,6 +311,20 @@
help="Show Sales Team"/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -335,20 +349,6 @@
help="Expected Closing" domain="[]"
context="{'group_by':'date_deadline'}" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/crm/report/crm_lead_report_view.xml b/addons/crm/report/crm_lead_report_view.xml
index 42adda76dbe..1939965c0dc 100644
--- a/addons/crm/report/crm_lead_report_view.xml
+++ b/addons/crm/report/crm_lead_report_view.xml
@@ -110,7 +110,22 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -144,21 +159,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/crm/report/crm_phonecall_report_view.xml b/addons/crm/report/crm_phonecall_report_view.xml
index 69402603d17..8024ca78bd5 100644
--- a/addons/crm/report/crm_phonecall_report_view.xml
+++ b/addons/crm/report/crm_phonecall_report_view.xml
@@ -110,7 +110,20 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -139,20 +152,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/crm_claim/report/crm_claim_report_view.xml b/addons/crm_claim/report/crm_claim_report_view.xml
index 3a1e8f45f26..edb3dc2b6db 100644
--- a/addons/crm_claim/report/crm_claim_report_view.xml
+++ b/addons/crm_claim/report/crm_claim_report_view.xml
@@ -119,7 +119,24 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -157,25 +174,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/crm_fundraising/report/crm_fundraising_report_view.xml b/addons/crm_fundraising/report/crm_fundraising_report_view.xml
index 8e9f1611af6..989b364a488 100644
--- a/addons/crm_fundraising/report/crm_fundraising_report_view.xml
+++ b/addons/crm_fundraising/report/crm_fundraising_report_view.xml
@@ -118,7 +118,22 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
@@ -146,23 +161,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/crm_helpdesk/report/crm_helpdesk_report_view.xml b/addons/crm_helpdesk/report/crm_helpdesk_report_view.xml
index 2544a506fd5..1d494103dc3 100644
--- a/addons/crm_helpdesk/report/crm_helpdesk_report_view.xml
+++ b/addons/crm_helpdesk/report/crm_helpdesk_report_view.xml
@@ -114,7 +114,12 @@
-
+
+
+
+
+
@@ -141,15 +146,7 @@
-
-
-
-
-
-
-
diff --git a/addons/crm_partner_assign/report/crm_lead_report_view.xml b/addons/crm_partner_assign/report/crm_lead_report_view.xml
index 3424fc44fbe..2d38cd8862b 100644
--- a/addons/crm_partner_assign/report/crm_lead_report_view.xml
+++ b/addons/crm_partner_assign/report/crm_lead_report_view.xml
@@ -31,6 +31,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -69,19 +82,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
+
diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py
index 33828840eeb..1a71114c336 100644
--- a/addons/mrp/mrp.py
+++ b/addons/mrp/mrp.py
@@ -361,11 +361,12 @@ class many2many_domain(fields.many2many):
for i in ids:
res[i] = []
valid_move_ids = move_obj.search(cr, user, self._domain) # move ids relative to domain argument
- cr.execute("SELECT production_id, move_id from mrp_production_move_ids where production_id in %s and move_id in %s",
- [tuple(ids), tuple(valid_move_ids)])
- related_move_map = cr.fetchall()
- related_move_dict = dict((k, list(set([v[1] for v in itr]))) for k, itr in groupby(related_move_map, itemgetter(0)))
- res.update(related_move_dict)
+ if valid_move_ids:
+ cr.execute("SELECT production_id, move_id from mrp_production_move_ids where production_id in %s and move_id in %s",
+ [tuple(ids), tuple(valid_move_ids)])
+ related_move_map = cr.fetchall()
+ related_move_dict = dict((k, list(set([v[1] for v in itr]))) for k, itr in groupby(related_move_map, itemgetter(0)))
+ res.update(related_move_dict)
return res
diff --git a/addons/mrp_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py
index 527ef5c1e55..9c4a11cb9e0 100644
--- a/addons/mrp_repair/mrp_repair.py
+++ b/addons/mrp_repair/mrp_repair.py
@@ -19,12 +19,10 @@
#
##############################################################################
-import time
from osv import fields,osv
import netsvc
import mx.DateTime
-from mx.DateTime import RelativeDateTime, today, DateTime, localtime
-from tools import config
+from mx.DateTime import RelativeDateTime, today
from tools.translate import _
import decimal_precision as dp
@@ -95,6 +93,16 @@ class mrp_repair(osv.osv):
cur = repair.pricelist_id.currency_id
res[id] = cur_obj.round(cr, uid, cur, untax.get(id, 0.0) + tax.get(id, 0.0))
return res
+
+ def _get_default_address(self, cr, uid, ids, field_name, arg, context):
+ res = {}
+ partner_obj = self.pool.get('res.partner')
+ for data in self.browse(cr, uid, ids):
+ adr_id = False
+ if data.partner_id:
+ adr_id = partner_obj.address_get(cr, uid, [data.partner_id.id], ['default'])['default']
+ res[data.id] = adr_id
+ return res
def _get_lines(self, cr, uid, ids, context=None):
if context is None:
@@ -109,6 +117,7 @@ class mrp_repair(osv.osv):
'product_id': fields.many2one('product.product', string='Product to Repair', required=True, readonly=True, states={'draft':[('readonly',False)]}),
'partner_id' : fields.many2one('res.partner', 'Partner', select=True, help='This field allow you to choose the parner that will be invoiced and delivered'),
'address_id': fields.many2one('res.partner.address', 'Delivery Address', domain="[('partner_id','=',partner_id)]"),
+ 'default_address_id': fields.function(_get_default_address, method=True, type="many2one", relation="res.partner.address"),
'prodlot_id': fields.many2one('stock.production.lot', 'Lot Number', select=True, domain="[('product_id','=',product_id)]"),
'state': fields.selection([
('draft','Quotation'),
@@ -275,7 +284,6 @@ class mrp_repair(osv.osv):
if not lot:
return data
- lot_info = prodlot_obj.browse(cr, uid, lot)
move_ids = move_obj.search(cr, uid, [('prodlot_id', '=', lot)])
if not len(move_ids):
@@ -328,7 +336,6 @@ class mrp_repair(osv.osv):
""" Cancels repair order.
@return: True
"""
- ok=True
mrp_line_obj = self.pool.get('mrp.repair.line')
for repair in self.browse(cr, uid, ids):
mrp_line_obj.write(cr, uid, [l.id for l in repair.operations], {'state': 'cancel'})
@@ -509,7 +516,6 @@ class mrp_repair(osv.osv):
repair_line_obj = self.pool.get('mrp.repair.line')
seq_obj = self.pool.get('ir.sequence')
pick_obj = self.pool.get('stock.picking')
- company = self.pool.get('res.users').browse(cr, uid, uid).company_id
for repair in self.browse(cr, uid, ids, context=context):
for move in repair.operations:
move_id = move_obj.create(cr, uid, {
diff --git a/addons/mrp_repair/report/order.py b/addons/mrp_repair/report/order.py
index 298e1f237ff..3257ba3df7a 100644
--- a/addons/mrp_repair/report/order.py
+++ b/addons/mrp_repair/report/order.py
@@ -30,10 +30,8 @@ class order(report_sxw.rml_parse):
self.localcontext.update({
'time': time,
'total': self.total,
- 'adr_get' : self._adr_get
})
-
def total(self, repair):
total = 0.0
for operation in repair.operations:
@@ -43,13 +41,6 @@ class order(report_sxw.rml_parse):
total = total + repair.amount_tax
return total
- def _adr_get(self, partner, type):
- res_partner = pooler.get_pool(self.cr.dbname).get('res.partner')
- res_partner_address = pooler.get_pool(self.cr.dbname).get('res.partner.address')
- addresses = res_partner.address_get(self.cr, self.uid, [partner.id], [type])
- adr_id = addresses and addresses[type] or False
- return adr_id and res_partner_address.read(self.cr, self.uid, [adr_id])[0] or False
-
report_sxw.report_sxw('report.repair.order','mrp.repair','addons/mrp_repair/report/order.rml',parser=order)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/mrp_repair/report/order.rml b/addons/mrp_repair/report/order.rml
index c71abb614cf..149a2650bfd 100644
--- a/addons/mrp_repair/report/order.rml
+++ b/addons/mrp_repair/report/order.rml
@@ -175,7 +175,7 @@
- Invoice address
+ Invoice address :[[ o.partner_id and o.partner_id.property_payment_term.name ]][[ o.partner_invoice_id.street ]][[ o.partner_invoice_id.street2 or removeParentNode('para') ]]
@@ -189,12 +189,12 @@
- [[ o.partner_id.name ]]
- [[ o.partner_id and adr_get(o.partner_id, 'default')['street'] ]]
- [[ o.partner_id and adr_get(o.partner_id, 'default')['street2'] or removeParentNode('para') ]]
- [[ o.partner_id and adr_get(o.partner_id, 'default')['zip'] ]][[ o.partner_id and adr_get(o.partner_id, 'default')['city'] ]]
- [[ (o.partner_id and adr_get(o.partner_id, 'default')['state_id'] and adr_get(o.partner_id, 'default')['state_id'][1]) or removeParentNode('para') ]]
- [[ o.partner_id and adr_get(o.partner_id, 'default')['country_id'] and adr_get(o.partner_id, 'default')['country_id'][1] ]]
+ [[ o.partner_id.name or removeParentNode('para') ]]
+ [[ o.default_address_id and o.default_address_id.street or removeParentNode('para') ]]
+ [[ o.default_address_id and o.default_address_id.street2 or removeParentNode('para') ]]
+ [[ o.default_address_id and o.default_address_id.zip or removeParentNode('para') ]][[ o.default_address_id and o.default_address_id.city or removeParentNode('para') ]]
+ [[ o.default_address_id and o.default_address_id.state_id and o.default_address_id.state_id.name or removeParentNode('para') ]]
+ [[ o.default_address_id and o.default_address_id.country_id and o.default_address_id.country_id.name or removeParentNode('para') ]]
diff --git a/addons/mrp_repair/wizard/mrp_repair_cancel_view.xml b/addons/mrp_repair/wizard/mrp_repair_cancel_view.xml
index 811551aedbf..e307580be7b 100644
--- a/addons/mrp_repair/wizard/mrp_repair_cancel_view.xml
+++ b/addons/mrp_repair/wizard/mrp_repair_cancel_view.xml
@@ -14,8 +14,8 @@
-
+
diff --git a/addons/mrp_repair/wizard/mrp_repair_make_invoice_view.xml b/addons/mrp_repair/wizard/mrp_repair_make_invoice_view.xml
index 62edf984b20..982ee5d4bc0 100644
--- a/addons/mrp_repair/wizard/mrp_repair_make_invoice_view.xml
+++ b/addons/mrp_repair/wizard/mrp_repair_make_invoice_view.xml
@@ -15,8 +15,8 @@
-
+
diff --git a/addons/point_of_sale/report/all_closed_cashbox_of_the_day.py b/addons/point_of_sale/report/all_closed_cashbox_of_the_day.py
index dcbba147b59..fce080dfd0b 100644
--- a/addons/point_of_sale/report/all_closed_cashbox_of_the_day.py
+++ b/addons/point_of_sale/report/all_closed_cashbox_of_the_day.py
@@ -67,7 +67,7 @@ class all_closed_cashbox_of_the_day(report_sxw.rml_parse):
def _get_bal(self,data):
res = {}
- sql =""" select sum(pieces*number) as bal from singer_statement where starting_id = %d """%(data['id'])
+ sql =""" select sum(pieces*number) as bal from account_cashbox_line where starting_id = %d """%(data['id'])
self.cr.execute(sql)
res = self.cr.dictfetchall()
if res :
@@ -115,7 +115,7 @@ class all_closed_cashbox_of_the_day(report_sxw.rml_parse):
res = self.cr.dictfetchall()
for r in res :
total_ending_bal += (r['net_total'] or 0.0)
- sql1 =""" select sum(pieces*number) as bal from singer_statement where starting_id = %d"""%(r['id'])
+ sql1 =""" select sum(pieces*number) as bal from account_cashbox_line where starting_id = %d"""%(r['id'])
self.cr.execute(sql1)
data = self.cr.dictfetchall()
if data[0]['bal']:
diff --git a/addons/point_of_sale/report/pos_payment_report_user.py b/addons/point_of_sale/report/pos_payment_report_user.py
index dc829859c3e..c7f31ffcd6f 100644
--- a/addons/point_of_sale/report/pos_payment_report_user.py
+++ b/addons/point_of_sale/report/pos_payment_report_user.py
@@ -53,7 +53,7 @@ class pos_payment_report_user(report_sxw.rml_parse):
"and po.state='paid' and to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::date = current_date " \
"and po.user_id IN %s",(tuple(ids),))
res=self.cr.fetchone()
- res = res and res[0] or None
+ res = res and res[0] or 0.0
return res
diff --git a/addons/point_of_sale/wizard/pos_add_product.py b/addons/point_of_sale/wizard/pos_add_product.py
index c0604fc0bee..5735d2976a4 100644
--- a/addons/point_of_sale/wizard/pos_add_product.py
+++ b/addons/point_of_sale/wizard/pos_add_product.py
@@ -29,7 +29,7 @@ class add_product(osv.osv_memory):
_columns = {
'product_id': fields.many2one('product.product', 'Product', required=True),
- 'quantity': fields.float('Quantity ', required=True),
+ 'quantity': fields.float('Quantity', required=True),
}
_defaults = {
'quantity': lambda *a: 1,
@@ -73,7 +73,6 @@ class add_product(osv.osv_memory):
record_id = context and context.get('active_id', False)
order_obj= self.pool.get('pos.order')
- order_line_obj= self.pool.get('pos.order.line')
obj=order_obj.browse(cr, uid, record_id)
order_obj.write(cr, uid, [record_id], {'state':'done'})
if obj.amount_total != obj.amount_paid:
diff --git a/addons/point_of_sale/wizard/pos_add_product.xml b/addons/point_of_sale/wizard/pos_add_product.xml
index 966a21baa4b..ac5fd1c6f65 100644
--- a/addons/point_of_sale/wizard/pos_add_product.xml
+++ b/addons/point_of_sale/wizard/pos_add_product.xml
@@ -4,25 +4,32 @@
- Add Product
+ Add Productpos.add.productform