[MERGE] merge with same branch
bzr revid: qdp-launchpad@tinyerp.com-20101001152558-mpxmqb5fy0pbgd8o
This commit is contained in:
@@ -17,12 +17,12 @@
|
||||
<menuitem id="menu_finance_reporting_budgets" name="Budgets" parent="menu_finance_reporting"/>
|
||||
<menuitem id="menu_finance_legal_statement" name="Legal Reports" parent="menu_finance_reporting"/>
|
||||
<menuitem id="menu_finance_management_belgian_reports" name="Belgian Reports" parent="menu_finance_reporting"/>
|
||||
<menuitem id="menu_finance_configuration" name="Configuration" parent="menu_finance" sequence="13" groups="base.group_system"/>
|
||||
<menuitem id="menu_finance_accounting" name="Financial Accounting" parent="menu_finance_configuration" groups="base.group_system"/>
|
||||
<menuitem id="menu_analytic_accounting" name="Analytic Accounting" parent="menu_finance_configuration" groups="base.group_system"/>
|
||||
<menuitem id="menu_finance_configuration" name="Configuration" parent="menu_finance" sequence="13" groups="group_account_manager"/>
|
||||
<menuitem id="menu_finance_accounting" name="Financial Accounting" parent="menu_finance_configuration" groups="group_account_manager"/>
|
||||
<menuitem id="menu_analytic_accounting" name="Analytic Accounting" parent="menu_finance_configuration" groups="group_account_manager"/>
|
||||
<menuitem id="menu_analytic" parent="menu_analytic_accounting" name="Accounts" groups="analytic.group_analytic_accounting"/>
|
||||
<menuitem id="menu_low_level" name="Low Level" parent="menu_finance_accounting" groups="base.group_extended"/>
|
||||
<menuitem id="menu_configuration_misc" name="Miscellaneous" parent="menu_finance_configuration" sequence="30" groups="base.group_system"/>
|
||||
<menuitem id="menu_configuration_misc" name="Miscellaneous" parent="menu_finance_configuration" sequence="30" groups="group_account_manager"/>
|
||||
<menuitem id="base.menu_action_currency_form" parent="menu_configuration_misc" sequence="20"/>
|
||||
<menuitem id="menu_finance_generic_reporting" name="Generic Reporting" parent="menu_finance_reporting" sequence="100" groups="group_account_manager"/>
|
||||
<menuitem id="menu_finance_entries" name="Accounting" parent="menu_finance" sequence="4"
|
||||
|
||||
@@ -100,7 +100,7 @@ class general_ledger(rml_parse.rml_parse, common_report_header):
|
||||
FROM account_move_line l \
|
||||
WHERE l.account_id = %s AND %s '%(account.id, self.init_query))
|
||||
sum_currency += self.cr.fetchone()[0] or 0.0
|
||||
return str(sum_currency)
|
||||
return sum_currency
|
||||
|
||||
def get_children_accounts(self, account):
|
||||
res = []
|
||||
|
||||
@@ -266,10 +266,10 @@
|
||||
<tr>
|
||||
<td><para style="Standard"><font color="white">[[ '..'*(o.level-1) ]]</font>[[ o.code ]] [[ o.name ]]</para></td>
|
||||
<td><para style="Standard"></para></td>
|
||||
<td alignment="right"><para style="P9b"><u>[[formatLang(sum_debit_account(o)) ]]</u></para></td>
|
||||
<td alignment="right"><para style="P9b"><u>[[formatLang(sum_credit_account(o)) ]]</u></para></td>
|
||||
<td><para style="P9b"><u>[[formatLang(sum_balance_account(o)) ]] [[ company.currency_id.symbol ]]</u></para></td>
|
||||
<td><para style="P9b"><u>[[ o.currency_id and sum_currency_amount_account(o) +o.currency_id.code or '' ]]</u></para></td>
|
||||
<td alignment="right"><para style="P9b"><u>[[ formatLang(sum_debit_account(o), digits=get_digits(dp='Account')) ]]</u></para></td>
|
||||
<td alignment="right"><para style="P9b"><u>[[ formatLang(sum_credit_account(o), digits=get_digits(dp='Account')) ]]</u></para></td>
|
||||
<td><para style="P9b"><u>[[ formatLang(sum_balance_account(o), digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]]</u></para></td>
|
||||
<td><para style="P9b"><u>[[ o.currency_id and formatLang(sum_currency_amount_account(o), digits=get_digits(dp='Account')) + o.currency_id.code or '' ]]</u></para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</td>
|
||||
@@ -292,9 +292,9 @@
|
||||
<td><para style="P2_content">[[ line['move'] ]]</para></td>
|
||||
<td><para style="P3_content">[[ line['lname'] ]]</para></td>
|
||||
<td><para style="P3_content_center">[[ strip_name(line['line_corresp'].replace(', ',','),40) ]]</para></td>
|
||||
<td><para style="P4_content">[[ formatLang(line['debit']) ]]</para></td>
|
||||
<td><para style="P4_content">[[ formatLang(line['credit']) ]]</para></td>
|
||||
<td><para style="P4_content">[[ formatLang(line['progress']) ]] [[ company.currency_id.symbol ]]</para></td>
|
||||
<td><para style="P4_content">[[ formatLang(line['debit'], digits=get_digits(dp='Account')) ]]</para></td>
|
||||
<td><para style="P4_content">[[ formatLang(line['credit'], digits=get_digits(dp='Account')) ]]</para></td>
|
||||
<td><para style="P4_content">[[ formatLang(line['progress'], digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]]</para></td>
|
||||
<td><para style="P4_content">[[ formatLang(line['amount_currency'] or '')]] [[ line['currency_code'] or '' ]]</para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
@@ -327,9 +327,9 @@
|
||||
<tr>
|
||||
<td><para style="Standard"><font color="white">[[ '..'*(o.level-1) ]]</font>[[ o.code ]] [[ o.name ]]</para></td>
|
||||
<td><para style="Standard"></para></td>
|
||||
<td alignment="right"><para style="P9b"><u>[[formatLang(sum_debit_account(o)) ]]</u></para></td>
|
||||
<td alignment="right"><para style="P9b"><u>[[formatLang(sum_credit_account(o)) ]]</u></para></td>
|
||||
<td><para style="P9b"><u>[[formatLang(sum_balance_account(o)) ]] [[ company.currency_id.symbol ]]</u></para></td>
|
||||
<td alignment="right"><para style="P9b"><u>[[ formatLang(sum_debit_account(o), digits=get_digits(dp='Account')) ]]</u></para></td>
|
||||
<td alignment="right"><para style="P9b"><u>[[ formatLang(sum_credit_account(o), digits=get_digits(dp=Account)) ]]</u></para></td>
|
||||
<td><para style="P9b"><u>[[ formatLang(sum_balance_account(o), digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]]</u></para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
</td>
|
||||
@@ -352,9 +352,9 @@
|
||||
<td><para style="P2_content">[[ line['move'] ]]</para></td>
|
||||
<td><para style="P3_content">[[ line['lname'] ]]</para></td>
|
||||
<td><para style="P3_content_center">[[ strip_name(line['line_corresp'],15) ]]</para></td>
|
||||
<td><para style="P4_content">[[ formatLang(line['debit']) ]] </para></td>
|
||||
<td><para style="P4_content">[[ formatLang(line['credit']) ]]</para></td>
|
||||
<td><para style="P4_content">[[ formatLang(line['progress']) ]] [[ company.currency_id.symbol ]]</para></td>
|
||||
<td><para style="P4_content">[[ formatLang(line['debit'], dp='Account') ]] </para></td>
|
||||
<td><para style="P4_content">[[ formatLang(line['credit'], dp='Account') ]]</para></td>
|
||||
<td><para style="P4_content">[[ formatLang(line['progress'], dp='Account') ]] [[ company.currency_id.symbol ]]</para></td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
|
||||
|
||||
@@ -58,7 +58,9 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header):
|
||||
def set_context(self, objects, data, ids, report_type=None):
|
||||
obj_move = self.pool.get('account.move.line')
|
||||
self.query = obj_move._query_get(self.cr, self.uid, obj='l', context=data['form'].get('used_context', {}))
|
||||
self.init_query = obj_move._query_get(self.cr, self.uid, obj='l', context=data['form'].get('used_context_initial_bal', {}))
|
||||
ctx2 = data['form'].get('used_context',{}).copy()
|
||||
ctx2.update({'initial_bal': True})
|
||||
self.init_query = obj_move._query_get(self.cr, self.uid, obj='l', context=ctx2)
|
||||
self.reconcil = data['form'].get('reconcil', True)
|
||||
self.initial_balance = data['form'].get('initial_balance', True)
|
||||
self.result_selection = data['form'].get('result_selection', 'customer')
|
||||
|
||||
@@ -137,17 +137,17 @@
|
||||
<field eval="[(6,0,[ref('analytic.group_analytic_accounting')])]" name="groups_id"/>
|
||||
</record>
|
||||
|
||||
<record id="menu_finance_configuration" model="ir.ui.menu">
|
||||
<field eval="[(6,0,[ref('analytic.group_analytic_accounting')])]" name="groups_id"/>
|
||||
</record>
|
||||
<!--record id="menu_finance_configuration" model="ir.ui.menu">
|
||||
<field eval="[(6,0,[ref('analytic.group_analytic_accounting')])]" name="groups_id"/>
|
||||
</record-->
|
||||
|
||||
<record id="menu_finance_entries" model="ir.ui.menu">
|
||||
<field eval="[(6,0,[ref('analytic.group_analytic_accounting')])]" name="groups_id"/>
|
||||
</record>
|
||||
|
||||
<record id="menu_analytic_accounting" model="ir.ui.menu">
|
||||
<!--record id="menu_analytic_accounting" model="ir.ui.menu">
|
||||
<field eval="[(6,0,[ref('analytic.group_analytic_accounting')])]" name="groups_id"/>
|
||||
</record>
|
||||
</record-->
|
||||
|
||||
<record id="account_move_comp_rule" model="ir.rule">
|
||||
<field name="name">Account Entry</field>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
@@ -15,11 +15,11 @@
|
||||
# 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 <http://www.gnu.org/licenses/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import crossovered_budget
|
||||
import account_budget
|
||||
import report
|
||||
import wizard
|
||||
|
||||
|
||||
@@ -50,16 +50,16 @@ Three reports are available:
|
||||
'security/ir.model.access.csv',
|
||||
'security/account_budget_security.xml',
|
||||
'wizard/account_budget_spread_view.xml',
|
||||
'crossovered_budget_view.xml',
|
||||
'crossovered_budget_report.xml',
|
||||
'crossovered_budget_workflow.xml',
|
||||
'account_budget_view.xml',
|
||||
'account_budget_report.xml',
|
||||
'account_budget_workflow.xml',
|
||||
'wizard/account_budget_analytic_view.xml',
|
||||
'wizard/account_budget_report_view.xml',
|
||||
'wizard/account_budget_spread_view.xml',
|
||||
'wizard/account_budget_crossovered_summary_report_view.xml',
|
||||
'wizard/account_budget_crossovered_report_view.xml',
|
||||
],
|
||||
'demo_xml': ['crossovered_budget_demo.xml'],
|
||||
'demo_xml': ['account_budget_demo.xml'],
|
||||
'test':[
|
||||
'test/account_budget.yml',
|
||||
'test/account_budget_report.yml',
|
||||
|
||||
+7
-5
@@ -24,6 +24,8 @@ import datetime
|
||||
from osv import osv, fields
|
||||
from tools.translate import _
|
||||
|
||||
import decimal_precision as dp
|
||||
|
||||
def strToDate(dt):
|
||||
dt_date=datetime.date(int(dt[0:4]),int(dt[5:7]),int(dt[8:10]))
|
||||
return dt_date
|
||||
@@ -241,10 +243,10 @@ class crossovered_budget_lines(osv.osv):
|
||||
'date_from': fields.date('Start Date', required=True),
|
||||
'date_to': fields.date('End Date', required=True),
|
||||
'paid_date': fields.date('Paid Date'),
|
||||
'planned_amount': fields.float('Planned Amount', required=True, digits=(16,2)),
|
||||
'practical_amount': fields.function(_prac, method=True, string='Practical Amount', type='float', digits=(16,2)),
|
||||
'theoritical_amount': fields.function(_theo, method=True, string='Theoritical Amount', type='float', digits=(16,2)),
|
||||
'percentage': fields.function(_perc, method=True, string='Percentage', type='float'),
|
||||
'planned_amount':fields.float('Planned Amount', required=True, digits_compute=dp.get_precision('Account')),
|
||||
'practical_amount':fields.function(_prac, method=True, string='Practical Amount', type='float', digits_compute=dp.get_precision('Account')),
|
||||
'theoritical_amount':fields.function(_theo, method=True, string='Theoritical Amount', type='float', digits_compute=dp.get_precision('Account')),
|
||||
'percentage':fields.function(_perc, method=True, string='Percentage', type='float'),
|
||||
'company_id': fields.related('crossovered_budget_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True)
|
||||
}
|
||||
|
||||
@@ -259,4 +261,4 @@ class account_analytic_account(osv.osv):
|
||||
|
||||
account_analytic_account()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -148,16 +148,16 @@
|
||||
<para style="terp_default_9"><font color="white">[['.....' *(a['status']-1) ]]</font><font face="Helvetica">[[ (a['status']==1 and (setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]] </font>[[ a['name'] ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9"><font face="Helvetica">[[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]]</font> [[ '%.2f' % a['theo'] ]] [[ company.currency_id.symbol ]]</para>
|
||||
<para style="terp_default_Right_9"><font face="Helvetica">[[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]]</font> [[ formatLang(a['theo'], digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9"><font face="Helvetica">[[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]] </font>[[ '%.2f' % a['pln'] ]] [[ company.currency_id.symbol ]]</para>
|
||||
<para style="terp_default_Right_9"><font face="Helvetica">[[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]] </font>[[ formatLang(a['pln'], digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9"><font face="Helvetica">[[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]] </font>[[ '%.2f' % a['prac'] ]] [[ company.currency_id.symbol ]]</para>
|
||||
<para style="terp_default_Right_9"><font face="Helvetica">[[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]] </font>[[ formatLang(a['prac'], digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9"><font face="Helvetica">[[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]] </font>[[ '%.2f' % a['perc'] ]]%</para>
|
||||
<para style="terp_default_Right_9"><font face="Helvetica">[[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]] </font>[[ formatLang(a['perc'], digits=2) ]]%</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
@@ -168,16 +168,16 @@
|
||||
<para style="terp_default_Bold_9"><font face="Helvetica">[[ repeatIn(funct_total(data['form']),'b') ]]</font>Total:</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_right_9">[[ formatLang(b['tot_theo']) ]] [[ company.currency_id.symbol ]]</para>
|
||||
<para style="terp_default_Bold_right_9">[[ formatLang(b['tot_theo'], digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_right_9">[[ formatLang(b['tot_pln']) ]] [[ company.currency_id.symbol ]]</para>
|
||||
<para style="terp_default_Bold_right_9">[[ formatLang(b['tot_pln'], digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_right_9">[[ formatLang(b['tot_prac']) ]] [[ company.currency_id.symbol ]]</para>
|
||||
<para style="terp_default_Bold_right_9">[[ formatLang(b['tot_prac'], digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Bold_right_9">[[ '%.2f' % b['tot_perc'] ]]%</para>
|
||||
<para style="terp_default_Bold_right_9">[[ formatLang(b['tot_perc'], digits=2) ]]%</para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
@@ -185,4 +185,4 @@
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</story>
|
||||
</document>
|
||||
</document>
|
||||
|
||||
@@ -46,11 +46,11 @@ class decimal_precision(osv.osv):
|
||||
|
||||
def write(self, cr, uid, ids, data, *args, **argv):
|
||||
res = super(decimal_precision, self).write(cr, uid, ids, data, *args, **argv)
|
||||
for obj in self.pool.obj_list():
|
||||
for colname,col in self.pool.get(obj)._columns.items():
|
||||
if isinstance(col, fields.float):
|
||||
col.digits_change(cr)
|
||||
self.precision_get.clear_cache(cr.dbname)
|
||||
for obj in self.pool.obj_list():
|
||||
for colname, col in self.pool.get(obj)._columns.items():
|
||||
if isinstance(col, (fields.float, fields.function)):
|
||||
col.digits_change(cr)
|
||||
return res
|
||||
|
||||
decimal_precision()
|
||||
@@ -62,4 +62,3 @@ def get_precision(application):
|
||||
return (16, res)
|
||||
return change_digit
|
||||
|
||||
|
||||
|
||||
@@ -283,7 +283,7 @@
|
||||
<record id="mrp_routing_search_view" model="ir.ui.view">
|
||||
<field name="name">mrp.routing.search</field>
|
||||
<field name="model">mrp.routing</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Routing">
|
||||
<field name="code"/>
|
||||
|
||||
@@ -312,7 +312,7 @@
|
||||
<para style="terp_default_9">Net Total :</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(o.amount_untaxed ) ]] [[ o.pricelist_id.currency_id. symbol ]]</para>
|
||||
<para style="terp_default_Right_9">[[ formatLang(o.amount_untaxed, digits=get_digits(dp='Account')) ]] [[ o.pricelist_id.currency_id. symbol ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -325,7 +325,7 @@
|
||||
<para style="terp_default_9">Taxes :</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(o.amount_tax ) ]] [[ o.pricelist_id.currency_id. symbol ]]</para>
|
||||
<para style="terp_default_Right_9">[[ formatLang(o.amount_tax, digits=get_digits(dp='Account')) ]] [[ o.pricelist_id.currency_id. symbol ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -338,7 +338,7 @@
|
||||
<para style="terp_default_Bold_9">Total :</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9_Bold">[[ formatLang(o.amount_total ) ]] [[ o.pricelist_id.currency_id. symbol ]] </para>
|
||||
<para style="terp_default_Right_9_Bold">[[ formatLang(o.amount_total, digits=get_digits(dp='Account')) ]] [[ o.pricelist_id.currency_id. symbol ]] </para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
@@ -361,4 +361,4 @@
|
||||
<font color="white"> </font>
|
||||
</para>
|
||||
</story>
|
||||
</document>
|
||||
</document>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
@@ -14,21 +14,22 @@
|
||||
# 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 <http://www.gnu.org/licenses/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import time
|
||||
import pooler
|
||||
from report import report_sxw
|
||||
|
||||
|
||||
rml_parents = {
|
||||
'tr':1,
|
||||
'li':1,
|
||||
'tr': 1,
|
||||
'li': 1,
|
||||
'story': 0,
|
||||
'section': 0
|
||||
}
|
||||
|
||||
|
||||
class sale_order_1(report_sxw.rml_parse):
|
||||
def __init__(self, cr, uid, name, context):
|
||||
super(sale_order_1, self).__init__(cr, uid, name, context)
|
||||
@@ -39,98 +40,94 @@ class sale_order_1(report_sxw.rml_parse):
|
||||
})
|
||||
self.context = context
|
||||
|
||||
#
|
||||
def sale_order_lines(self, sale_order):
|
||||
result = []
|
||||
sub_total = {}
|
||||
info = []
|
||||
order_lines = []
|
||||
res = {}
|
||||
|
||||
def sale_order_lines(self,sale_order):
|
||||
result =[]
|
||||
sub_total={}
|
||||
info=[]
|
||||
order_lines=[]
|
||||
res={}
|
||||
list_in_seq=[]
|
||||
ids = self.pool.get('sale.order.line').search(self.cr, self.uid, [('order_id', '=', sale_order.id)])
|
||||
for id in range(0,len(ids)):
|
||||
order = self.pool.get('sale.order.line').browse(self.cr, self.uid,ids[id], self.context.copy())
|
||||
for id in range(0, len(ids)):
|
||||
order = self.pool.get('sale.order.line').browse(self.cr, self.uid, ids[id], self.context.copy())
|
||||
order_lines.append(order)
|
||||
|
||||
i=1
|
||||
j=0
|
||||
sum_flag={}
|
||||
sum_flag[j]=-1
|
||||
|
||||
i = 1
|
||||
j = 0
|
||||
sum_flag = {}
|
||||
sum_flag[j] = -1
|
||||
for entry in order_lines:
|
||||
res={}
|
||||
res = {}
|
||||
|
||||
if entry.layout_type=='article':
|
||||
res['tax_id']=', '.join(map(lambda x: x.name, entry.tax_id)) or ''
|
||||
res['name']=entry.name
|
||||
res['product_uom_qty']="%.2f"%(entry.product_uos and entry.product_uos_qty or entry.product_uom_qty or 0.00)
|
||||
res['product_uom']=entry.product_uos and entry.product_uos.name or entry.product_uom.name
|
||||
res['price_unit']="%.2f"%(entry.price_unit or 0.00)
|
||||
res['discount']="%.2f"%(entry.discount and entry.discount or 0.00)
|
||||
res['price_subtotal']="%.2f"%(entry.price_subtotal and entry.price_subtotal or 0.00)
|
||||
sub_total[i]= entry.price_subtotal and entry.price_subtotal
|
||||
i=i+1
|
||||
res['note']=entry.notes or ''
|
||||
res['currency']=sale_order.pricelist_id.currency_id.name
|
||||
res['layout_type']=entry.layout_type
|
||||
|
||||
if entry.layout_type == 'article':
|
||||
res['tax_id'] = ', '.join(map(lambda x: x.name, entry.tax_id)) or ''
|
||||
res['name'] = entry.name
|
||||
res['product_uom_qty'] = entry.product_uos and entry.product_uos_qty or entry.product_uom_qty or 0.00
|
||||
res['product_uom'] = entry.product_uos and entry.product_uos.name or entry.product_uom.name
|
||||
res['price_unit'] = entry.price_unit or 0.00
|
||||
res['discount'] = entry.discount and entry.discount or 0.00
|
||||
res['price_subtotal'] = entry.price_subtotal and entry.price_subtotal or 0.00
|
||||
sub_total[i] = entry.price_subtotal and entry.price_subtotal
|
||||
i = i + 1
|
||||
res['note'] = entry.notes or ''
|
||||
res['currency'] = sale_order.pricelist_id.currency_id.name
|
||||
res['layout_type'] = entry.layout_type
|
||||
else:
|
||||
res['product_uom_qty'] = ''
|
||||
res['price_unit'] = ''
|
||||
res['discount'] = ''
|
||||
res['tax_id'] = ''
|
||||
res['layout_type'] = entry.layout_type
|
||||
res['note'] = entry.notes or ''
|
||||
res['product_uom'] = ''
|
||||
|
||||
res['product_uom_qty']=''
|
||||
res['price_unit']=''
|
||||
res['discount']=''
|
||||
res['tax_id']=''
|
||||
res['layout_type']=entry.layout_type
|
||||
res['note']=entry.notes or ''
|
||||
res['product_uom']=''
|
||||
|
||||
if entry.layout_type=='subtotal':
|
||||
res['name']=entry.name
|
||||
sum=0
|
||||
sum_id=0
|
||||
if sum_flag[j]==-1:
|
||||
temp=1
|
||||
if entry.layout_type == 'subtotal':
|
||||
res['name'] = entry.name
|
||||
sum = 0
|
||||
sum_id = 0
|
||||
if sum_flag[j] == -1:
|
||||
temp = 1
|
||||
else:
|
||||
temp=sum_flag[j]
|
||||
temp = sum_flag[j]
|
||||
|
||||
for sum_id in range(temp,len(sub_total)+1):
|
||||
sum+=sub_total[sum_id]
|
||||
sum_flag[j+1]= sum_id +1
|
||||
for sum_id in range(temp, len(sub_total)+1):
|
||||
sum += sub_total[sum_id]
|
||||
sum_flag[j+1] = sum_id +1
|
||||
|
||||
j=j+1
|
||||
res['price_subtotal']="%.2f"%(sum)
|
||||
res['currency']=sale_order.pricelist_id.currency_id.name
|
||||
res['quantity']=''
|
||||
res['price_unit']=''
|
||||
res['discount']=''
|
||||
res['tax_id']=''
|
||||
res['product_uom']=''
|
||||
elif entry.layout_type=='title':
|
||||
res['name']=entry.name
|
||||
res['price_subtotal']=''
|
||||
res['currency']=''
|
||||
elif entry.layout_type=='text':
|
||||
res['name']=entry.name
|
||||
res['price_subtotal']=''
|
||||
res['currency']=''
|
||||
elif entry.layout_type=='line':
|
||||
res['product_uom_qty']='__________'
|
||||
res['price_unit']='______________'
|
||||
res['discount']='___________'
|
||||
res['tax_id']='_________________'
|
||||
res['product_uom']='_____'
|
||||
res['name']='_______________________________________'
|
||||
res['price_subtotal']='_________'
|
||||
res['currency']='_______'
|
||||
elif entry.layout_type=='break':
|
||||
res['layout_type']=entry.layout_type
|
||||
res['name']=entry.name
|
||||
res['price_subtotal']=''
|
||||
res['currency']=''
|
||||
j = j + 1
|
||||
res['price_subtotal'] = sum
|
||||
res['currency'] = sale_order.pricelist_id.currency_id.name
|
||||
res['quantity'] = ''
|
||||
res['price_unit'] = ''
|
||||
res['discount'] = ''
|
||||
res['tax_id'] = ''
|
||||
res['product_uom'] = ''
|
||||
elif entry.layout_type == 'title':
|
||||
res['name'] = entry.name
|
||||
res['price_subtotal'] = ''
|
||||
res['currency'] = ''
|
||||
elif entry.layout_type == 'text':
|
||||
res['name'] = entry.name
|
||||
res['price_subtotal'] = ''
|
||||
res['currency'] = ''
|
||||
elif entry.layout_type == 'line':
|
||||
res['product_uom_qty'] = '__________'
|
||||
res['price_unit'] = '______________'
|
||||
res['discount'] = '___________'
|
||||
res['tax_id'] = '_________________'
|
||||
res['product_uom'] = '_____'
|
||||
res['name'] = '_______________________________________'
|
||||
res['price_subtotal'] = '_________'
|
||||
res['currency'] = '_______'
|
||||
elif entry.layout_type == 'break':
|
||||
res['layout_type'] = entry.layout_type
|
||||
res['name'] = entry.name
|
||||
res['price_subtotal'] = ''
|
||||
res['currency'] = ''
|
||||
else:
|
||||
res['name']=entry.name
|
||||
res['price_subtotal']=''
|
||||
res['currency']=sale_order.pricelist_id.currency_id.name
|
||||
res['name'] = entry.name
|
||||
res['price_subtotal'] = ''
|
||||
res['currency'] = sale_order.pricelist_id.currency_id.name
|
||||
|
||||
result.append(res)
|
||||
return result
|
||||
|
||||
@@ -318,13 +318,13 @@
|
||||
<para style="terp_default_Right_9"><font>[[ a['layout_type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]]</font><font>[[ a['product_uom'] ]]</font></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9"><font>[[ a['layout_type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]] </font><font>[[ a['price_unit'] ]]</font></para>
|
||||
<para style="terp_default_Right_9"><font>[[ a['layout_type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]] </font><font>[[ formatLang(a['price_unit'], digits=get_digits(dp='Sale Price')) ]]</font></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Centre_9"><font>[[ a['layout_type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]]</font><font>[[ a['discount'] ]]</font></para>
|
||||
<para style="terp_default_Centre_9"><font>[[ a['layout_type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]]</font><font>[[ formatLang(a['discount'], digits=get_digits(dp='Sale Price')) ]]</font></para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9"><font>[[ a['layout_type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]]</font><font>[[ a['price_subtotal'] ]] [[ o.pricelist_id.currency_id.symbol ]]</font></para>
|
||||
<para style="terp_default_Right_9"><font>[[ a['layout_type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]]</font><font>[[ formatLang(a['price_subtotal'], digits=get_digits(dp='Sale Price')) ]] [[ o.pricelist_id.currency_id.symbol ]]</font></para>
|
||||
</td>
|
||||
</tr>
|
||||
</blockTable>
|
||||
@@ -397,7 +397,7 @@
|
||||
<para style="terp_default_9">Taxes :</para>
|
||||
</td>
|
||||
<td>
|
||||
<para style="terp_default_Right_9">[[ formatLang(o.amount_tax ) ]] [[ o.pricelist_id.currency_id.symbol ]]</para>
|
||||
<para style="terp_default_Right_9">[[ formatLang(o.amount_tax, digits=get_digits(dp='Account') ) ]] [[ o.pricelist_id.currency_id.symbol ]]</para>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
Reference in New Issue
Block a user