[MERGE] merged the xrg branch containing several bugfixes

bzr revid: qdp-launchpad@tinyerp.com-20101230115309-drnbznu04hx52cbj
This commit is contained in:
qdp-launchpad@tinyerp.com 2010-12-30 12:53:09 +01:00
commit 32589e25b4
20 changed files with 108 additions and 96 deletions

View File

@ -479,7 +479,7 @@
<para style="terp_default_Bold_9_Right">[[ formatLang(sum_balance_account(o), digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]]</para>
</td>
<td>
<para style="terp_default_Bold_9_Right">[[ o.currency_id and formatLang(sum_currency_amount_account(o), digits=get_digits(dp='Account')) + o.currency_id.code or '' ]]</para>
<para style="terp_default_Bold_9_Right">[[ o.currency_id and formatLang(sum_currency_amount_account(o), digits=get_digits(dp='Account')) + o.currency_id.symbol or '' ]]</para>
</td>
</tr>
</blockTable>

View File

@ -508,7 +508,7 @@
<para style="terp_default_Bold_7_Right">[[ formatLang(sum_balance_account(o), digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]]</para>
</td>
<td>
<para style="terp_default_Bold_7_Right">[[ o.currency_id and formatLang(sum_currency_amount_account(o), digits=get_digits(dp='Account')) + o.currency_id.code or '' ]]</para>
<para style="terp_default_Bold_7_Right">[[ o.currency_id and formatLang(sum_currency_amount_account(o), digits=get_digits(dp='Account')) + o.currency_id.symbol or '' ]]</para>
</td>
</tr>
</blockTable>

View File

@ -28,8 +28,6 @@ from common_report_header import common_report_header
class partner_balance(report_sxw.rml_parse, common_report_header):
def __init__(self, cr, uid, name, context=None):
if context is None:
context = {}
super(partner_balance, self).__init__(cr, uid, name, context=context)
self.account_ids = []
self.localcontext.update( {
@ -276,6 +274,7 @@ class partner_balance(report_sxw.rml_parse, common_report_header):
return temp_res
def _sum_litige(self):
#gives the total of move lines with blocked boolean set to TRUE for the report selection
move_state = ['draft','posted']
if self.target_move == 'posted':
move_state = ['posted']
@ -296,12 +295,15 @@ class partner_balance(report_sxw.rml_parse, common_report_header):
return temp_res
def _get_partners(self):
cr, uid = self.cr, self.uid
context = self.localcontext # all of it?
if self.result_selection == 'customer':
return 'Receivable Accounts'
return _('Receivable Accounts')
elif self.result_selection == 'supplier':
return 'Payable Accounts'
return _('Payable Accounts')
elif self.result_selection == 'customer_supplier':
return 'Receivable and Payable Accounts'
return _('Receivable and Payable Accounts')
return ''
report_sxw.report_sxw('report.account.partner.balance', 'res.partner', 'account/report/account_partner_balance.rml',parser=partner_balance, header="internal")

View File

@ -384,7 +384,7 @@ class account_analytic_account(osv.osv):
'ca_to_invoice': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='float', string='Uninvoiced Amount',
help="If invoice from analytic account, the remaining amount you can invoice to the customer based on the total costs.",
digits_compute=dp.get_precision('Account')),
'ca_theorical': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='float', string='Theorical Revenue',
'ca_theorical': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='float', string='Theoretical Revenue',
help="Based on the costs you had on the project, what would have been the revenue if all these costs have been invoiced at the normal sale price provided by the pricelist.",
digits_compute=dp.get_precision('Account')),
'hours_quantity': fields.function(_analysis_all, method=True, multi='analytic_analysis', type='float', string='Hours Tot',
@ -410,7 +410,7 @@ class account_analytic_account(osv.osv):
'real_margin': fields.function(_real_margin_calc, method=True, type='float', string='Real Margin',
help="Computed using the formula: Invoiced Amount - Total Costs.",
digits_compute=dp.get_precision('Account')),
'theorical_margin': fields.function(_theorical_margin_calc, method=True, type='float', string='Theorical Margin',
'theorical_margin': fields.function(_theorical_margin_calc, method=True, type='float', string='Theoretical Margin',
help="Computed using the formula: Theorial Revenue - Total Costs",
digits_compute=dp.get_precision('Account')),
'real_margin_rate': fields.function(_real_margin_rate_calc, method=True, type='float', string='Real Margin Rate (%)',

View File

@ -4,11 +4,7 @@
<record id="demo_message1" model="notify.message">
<field name="name">OpenERP SA</field>
<field name="msg">ERP &amp; CRM Solutions....</field>
</record>
<record id="demo_message1" model="notify.message">
<field name="name">Tiny sprl</field>
<field name="msg">Be Expert with the Experts...</field>
<field name="msg">ERP &amp; CRM Solutions...</field>
</record>
</data>
</openerp>

View File

@ -776,7 +776,7 @@ class account_voucher(osv.osv):
'date': inv.date,
'credit': diff > 0 and diff or 0.0,
'debit': diff < 0 and -diff or 0.0,
'amount_currency': company_currency <> current_currency and currency_pool.compute(cr, uid, company_currency, current_currency, diff * -1, context=context_multi_currency) or 0.0,
'amount_currency': company_currency <> current_currency and currency_pool.compute(cr, uid, company_currency, current_currency, diff * -1, context=context_multi_currency) or 0.0,
'currency_id': company_currency <> current_currency and current_currency or False,
}

View File

@ -55,6 +55,7 @@
name: 'ABC FUEL CO 829264 - 10002 units'
section_id: crm.section_sales_department
user_id: base.user_demo
categ_id: crm.categ_phone1
- |
schedule phonecall by apply (action_apply)function of opportunity2phoncall wizard
-

View File

@ -5,9 +5,8 @@
date: '2010-04-21 18:59:00'
name: Interview call
section_id: crm.section_sales_department
- |
-
Now , I select partner by click on "Create a Partner" button.
-
!record {model: crm.phonecall2partner, id: crm_phonecall2partner_1}:
action: exist
@ -85,6 +84,7 @@
name: Interview call
section_id: crm.section_sales_department
user_id: base.user_root
categ_id: crm.categ_phone1
- |
I click on "Schedule" button of this wizard.
-

View File

@ -85,7 +85,7 @@ class crm_opportunity2phonecall(osv.osv_memory):
This converts Opportunity to Phonecall and opens Phonecall view
@param self: The object pointer
@param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks,
@param uid: the current user's ID for security checks,
@param ids: List of Opportunity to Phonecall IDs
@param context: A standard dictionary for contextual values

View File

@ -1,12 +1,6 @@
<?xml version="1.0"?>
<openerp>
<data noupdate="0">
<record model="document.directory.content.type" id="pdf">
<field name="code">.pdf</field>
<field name="name">PDF Report</field>
<field name="mimetype">application/pdf</field>
</record>
<data noupdate="1">
<record model="document.storage" id="storage_default">
<field name="name">Database storage</field>
@ -28,6 +22,14 @@
<field name="ressource_id">0</field>
</record>
</data>
<data noupdate="0">
<record model="document.directory.content.type" id="pdf">
<field name="code">.pdf</field>
<field name="name">PDF Report</field>
<field name="mimetype">application/pdf</field>
</record>
<record model="document.directory" id="dir_partner_category">
<field name="name">Partners by Category</field>

View File

@ -142,7 +142,7 @@ class hr_expense_expense(osv.osv):
else:
acc = property_obj.get(cr, uid, 'property_account_expense_categ', 'product.category')
if not acc:
raise osv.except_osv(_('Error !'), _('Please configure Default Expanse account for Product purchase, `property_account_expense_categ`'))
raise osv.except_osv(_('Error !'), _('Please configure Default Expense account for Product purchase, `property_account_expense_categ`'))
lines.append((0, False, {
'name': l.name,

View File

@ -64,7 +64,7 @@ class hr_employee(osv.osv):
method=True,
domain="[('type', '=', 'liquidity')]",
view_load=True,
help="Select Bank Account from where Salary Expanse will be Paid"),
help="Select Bank Account from where Salary Expense will be Paid"),
'salary_account':fields.property(
'account.account',
type='many2one',
@ -73,7 +73,7 @@ class hr_employee(osv.osv):
method=True,
domain="[('type', '=', 'other')]",
view_load=True,
help="Expanse account when Salary Expanse will be recorded"),
help="Expense account when Salary Expense will be recorded"),
'employee_account':fields.property(
'account.account',
type='many2one',
@ -99,7 +99,7 @@ class payroll_register(osv.osv):
_description = 'Payroll Register'
_columns = {
'journal_id': fields.many2one('account.journal', 'Expanse Journal'),
'journal_id': fields.many2one('account.journal', 'Expense Journal'),
'bank_journal_id': fields.many2one('account.journal', 'Bank Journal'),
'period_id': fields.many2one('account.period', 'Force Period', domain=[('state','<>','done')], help="Keep empty to use the period of the validation(Payslip) date."),
}
@ -213,7 +213,7 @@ class hr_payslip(osv.osv):
_description = 'Pay Slip'
_columns = {
'journal_id': fields.many2one('account.journal', 'Expanse Journal'),
'journal_id': fields.many2one('account.journal', 'Expense Journal'),
'bank_journal_id': fields.many2one('account.journal', 'Bank Journal'),
'move_ids':fields.one2many('hr.payslip.account.move', 'slip_id', 'Accounting vouchers'),
'move_line_ids':fields.many2many('account.move.line', 'payslip_lines_rel', 'slip_id', 'line_id', 'Accounting Lines', readonly=True),
@ -336,7 +336,7 @@ class hr_payslip(osv.osv):
name = '[%s]-%s' % (slip.number, line.name)
invoice_pool.pay_and_reconcile(cr, uid, invids, amount, acc_id, period_id, journal_id, False, period_id, False, context, name)
other_pay -= amount
#TODO: link this account entries to the Payment Lines also Expanse Entries to Account Lines
#TODO: link this account entries to the Payment Lines also Expense Entries to Account Lines
l_ids = movel_pool.search(cr, uid, [('name','=',name)], context=context)
line_ids += l_ids

View File

@ -40,14 +40,14 @@ class l10n_chart_it_report_libroIVA (osv.osv):
_columns = {
'name': fields.char('Fiscal year',size=64),
'company_id': fields.many2one('res.company', 'Company'),
'company_id': fields.many2one('res.company', 'Company'),
}
def init (self, cr) :
cr.execute("""DROP VIEW IF EXISTS account_report_libroiva""")
cr.execute("""
CREATE VIEW account_report_libroiva AS (
SELECT id, name, company_id FROM account_fiscalyear
cr.execute("""
CREATE VIEW account_report_libroiva AS (
SELECT id, name, company_id FROM account_fiscalyear
)""")
l10n_chart_it_report_libroIVA()

View File

@ -27,7 +27,7 @@ class make_invoice(osv.osv_memory):
_description = 'Make Invoice'
_columns = {
'group': fields.boolean('Group by partner invoice address'),
'group': fields.boolean('Group by partner invoice address'),
}
def make_invoices(self, cr, uid, ids, context=None):

View File

@ -63,14 +63,19 @@ class order(report_sxw.rml_parse):
WHERE absl.pos_statement_id = %d"""%(order_id.id)
self.cr.execute(sql)
res = self.cr.fetchone()
lst.append(res[0])
if not res:
return ['', 0.0]
lst.append(res[0]) # todo: improve
sql2 = """ select sum(absl.amount) as amt from account_bank_statement as abs
LEFT JOIN account_bank_statement_line as absl ON abs.id = absl.statement_id
LEFT JOIN account_journal as aj ON aj.id = abs.journal_id
where aj.name = '%s' """%(res[0])
self.cr.execute(sql2)
res1 = self.cr.fetchone()
lst.append(res1[0])
if res1:
lst.append(res1[0])
else:
lst.append(0.0)
return lst
report_sxw.report_sxw('report.pos.receipt.with.remboursment', 'pos.order', 'addons/point_of_sale/report/pos_receipt_with_remboursment.rml', parser=order, header=False)

View File

@ -63,14 +63,19 @@ class order(report_sxw.rml_parse):
WHERE absl.pos_statement_id = %d"""%(order_id.id)
self.cr.execute(sql)
res = self.cr.fetchone()
lst.append(res[0])
if not res:
return ['', 0.0]
lst.append(res[0]) # todo: improve
sql2 = """ select sum(absl.amount) as amt from account_bank_statement as abs
LEFT JOIN account_bank_statement_line as absl ON abs.id = absl.statement_id
LEFT JOIN account_journal as aj ON aj.id = abs.journal_id
where aj.name = '%s' """%(res[0])
self.cr.execute(sql2)
res1 = self.cr.fetchone()
lst.append(res1[0])
if res1:
lst.append(res1[0])
else:
lst.append(0.0)
return lst
report_sxw.report_sxw('report.pos.receipt.without.remboursment', 'pos.order', 'addons/point_of_sale/report/pos_receipt_without_remboursment.rml', parser=order, header=False)

View File

@ -103,9 +103,9 @@ class purchase_report(osv.osv):
extract(epoch from age(l.date_planned,s.date_order))/(24*60*60)::decimal(16,2) as delay_pass,
count(*) as nbr,
(l.price_unit*l.product_qty*u.factor)::decimal(16,2) as price_total,
avg(100.0 * (l.price_unit*l.product_qty*u.factor) / (t.standard_price*l.product_qty*u.factor))::decimal(16,2) as negociation,
avg(100.0 * (l.price_unit*l.product_qty*u.factor) / NULLIF(t.standard_price*l.product_qty*u.factor, 0.0))::decimal(16,2) as negociation,
sum(t.standard_price*l.product_qty*u.factor)::decimal(16,2) as price_standard,
(sum(l.product_qty*l.price_unit)/sum(l.product_qty/u.factor))::decimal(16,2) as price_average
(sum(l.product_qty*l.price_unit)/NULLIF(sum(l.product_qty*u.factor),0.0))::decimal(16,2) as price_average
from purchase_order s
left join purchase_order_line l on (s.id=l.order_id)
left join product_product p on (l.product_id=p.id)

View File

@ -95,8 +95,8 @@ class sale_report(osv.osv):
else
u.name
end) as uom_name,
sum(l.product_uom_qty/u.factor) as product_uom_qty,
sum(l.product_uom_qty*l.price_unit) as price_total,
sum(l.product_uom_qty * u.factor) as product_uom_qty,
sum(l.product_uom_qty * l.price_unit) as price_total,
pt.categ_id, l.order_id
from
sale_order_line l ,product_uom u, product_product p, product_template pt

View File

@ -65,7 +65,10 @@ class survey_question_wiz(osv.osv_memory):
context = {}
if view_type in ['form']:
wiz_id = 0
if not context.has_key('sur_name_id'):
sur_name_rec = None
if 'sur_name_id' in context:
sur_name_rec = surv_name_wiz.browse(cr, uid, context['sur_name_id'], context=context)
elif 'survey_id' in context:
res_data = {
'survey_id': context.get('survey_id', False),
'page_no': -1,
@ -76,8 +79,6 @@ class survey_question_wiz(osv.osv_memory):
wiz_id = surv_name_wiz.create(cr, uid, res_data)
sur_name_rec = surv_name_wiz.browse(cr, uid, wiz_id, context=context)
context.update({'sur_name_id' :wiz_id})
else:
sur_name_rec = surv_name_wiz.browse(cr, uid, context['sur_name_id'], context=context)
if context.has_key('active_id'):
context.pop('active_id')
@ -85,7 +86,7 @@ class survey_question_wiz(osv.osv_memory):
survey_id = context.get('survey_id', False)
if not survey_id:
# Try one more time to find it
if sur_name_rec.survey_id:
if sur_name_rec and sur_name_rec.survey_id:
survey_id = sur_name_rec.survey_id[0]
else:
# raise osv.except_osv(_('Error!'), _("Cannot locate survey for the question wizard!"))