diff --git a/addons/account/account_analytic_line.py b/addons/account/account_analytic_line.py index a0ac15301d8..7981bac255e 100644 --- a/addons/account/account_analytic_line.py +++ b/addons/account/account_analytic_line.py @@ -55,7 +55,7 @@ class account_analytic_line(osv.osv): return False return True _constraints = [ - (_check_company, 'You can not create analytic line that is not in the same company than the account line', ['account_id']) +# (_check_company, 'You can not create analytic line that is not in the same company than the account line', ['account_id']) ] def on_change_unit_amount(self, cr, uid, id, prod_id, unit_amount, diff --git a/addons/account/report/invoice.rml b/addons/account/report/invoice.rml index 08423ce8538..6247ca00818 100644 --- a/addons/account/report/invoice.rml +++ b/addons/account/report/invoice.rml @@ -195,6 +195,7 @@ + @@ -203,7 +204,7 @@ - + @@ -241,29 +242,29 @@ - [[ o.partner_id.title or '' ]] [[ o.partner_id.name ]] - [[ o.address_invoice_id.title or '' ]] [[ o.address_invoice_id.name ]] + [[ o.partner_id.title or '' ]][[ o.partner_id.name ]] + [[ o.address_invoice_id.title or '' ]][[ o.address_invoice_id.name ]] [[ o.address_invoice_id.street ]] [[ o.address_invoice_id.street2 or '' ]] - [[ o.address_invoice_id.zip or '' ]] [[ o.address_invoice_id.city or '' ]] + [[ o.address_invoice_id.zip or '' ]][[ o.address_invoice_id.city or '' ]] [[ o.address_invoice_id.state_id and o.address_invoice_id.state_id.name or '' ]] [[ o.address_invoice_id.country_id and o.address_invoice_id.country_id.name or '' ]] - Tel. : [[ o.address_invoice_id.phone or removeParentNode('para') ]] + Tel. : [[ o.address_invoice_id.phone or removeParentNode('para') ]] Fax : [[ o.address_invoice_id.fax or removeParentNode('para') ]] VAT : [[ o.partner_id.vat or removeParentNode('para') ]] - Invoice [[ ((o.type == 'out_invoice' and (o.state == 'open' or o.state == 'paid')) or removeParentNode('para')) and '' ]] [[ o.number ]] + Invoice [[ ((o.type == 'out_invoice' and (o.state == 'open' or o.state == 'paid')) or removeParentNode('para')) and '' ]][[ o.number ]] PRO-FORMA [[ ((o.type == 'out_invoice' and o.state == 'proforma') or removeParentNode('para')) and '' ]] - PRO-FORMA [[ ((o.type == 'out_invoice' and o.state == 'draft') or removeParentNode('para')) and '' ]] + PRO-FORMA [[ ((o.type == 'out_invoice' and o.state == 'draft') or removeParentNode('para')) and '' ]] Canceled Invoice [[ ((o.type == 'out_invoice' and o.state == 'cancel') or removeParentNode('para')) and '' ]] - Refund [[ (o.type=='out_refund' or removeParentNode('para')) and '' ]] [[ o.number ]] - Supplier Refund [[ (o.type=='in_refund' or removeParentNode('para')) and '' ]] [[ o.number ]] - Supplier Invoice [[ (o.type=='in_invoice' or removeParentNode('para')) and '' ]] [[ o.number ]] + Refund [[ (o.type=='out_refund' or removeParentNode('para')) and '' ]][[ o.number ]] + Supplier Refund [[ (o.type=='in_refund' or removeParentNode('para')) and '' ]][[ o.number ]] + Supplier Invoice [[ (o.type=='in_invoice' or removeParentNode('para')) and '' ]][[ o.number ]] @@ -276,7 +277,7 @@ Invoice Date - Partner Code + Partner Ref. @@ -289,7 +290,7 @@ [[ o.date_invoice ]] - [[ o.address_invoice_id.partner_id.ref or '' ]] + [[ o.address_invoice_id.partner_id.ref or '' ]] @@ -314,7 +315,7 @@ Disc. (%) - Price + Price @@ -326,22 +327,22 @@ [[ l.name ]] - [[ ', '.join([lt.name for lt in l.invoice_line_tax_id]) ]] + [[ ', '.join([lt.name for lt in l.invoice_line_tax_id]) or '0.00' ]] - [[ formatLang(l.quantity) ]] + [[ formatLang(l.quantity) or '0.00' ]] [[ (l.uos_id and l.uos_id.name) or '' ]] - [[ formatLang(l.price_unit) ]] + [[ formatLang(l.price_unit) or '0.00' ]] - [[ l.discount and formatLang (l.discount) or '' ]] + [[ l.discount and formatLang (l.discount) or '0.00' ]] - [[ formatLang(l.price_subtotal) ]] + [[ formatLang(l.price_subtotal) or '0.00' ]] [[ o.currency_id.code ]] @@ -349,7 +350,10 @@ - [[ format(l.note or removeParentNode('tr')) ]] + [[ format(l.note or removeParentNode('tr')) ]] + + + @@ -389,10 +393,10 @@ - + - + @@ -408,13 +412,13 @@ - + - Net Total: + Net Total: - [[ formatLang(o.amount_untaxed) ]] + [[ formatLang(o.amount_untaxed) or '0.00' ]] [[ o.currency_id.code ]] @@ -424,13 +428,13 @@ - + - Taxes: + Taxes: - [[ formatLang(o.amount_tax) ]] + [[ formatLang(o.amount_tax) or '0.00']] [[ o.currency_id.code ]] @@ -440,13 +444,13 @@ - + - Total: + Total: - [[ formatLang(o.amount_total) ]] + [[ formatLang(o.amount_total) or '0.00' ]] [[ o.currency_id.code ]] @@ -459,20 +463,23 @@ - [[ format(o.amount_tax or removeParentNode('blockTable')) ]] + [[ format(o.amount_tax or removeParentNode('blockTable')) ]] - Tax + Tax - Base + Base - Amount + Amount + + + @@ -487,7 +494,7 @@ [[ formatLang(t.base) ]] - [[ formatLang(t.amount) or 0.00 ]] + [[ formatLang(t.amount) or 0.00 ]] @@ -534,7 +541,7 @@ - [[ format(o.comment or removeParentNode('blockTable')) ]] + [[ format(o.comment or removeParentNode('blockTable')) ]] @@ -544,7 +551,7 @@ - [[ format((o.payment_term and o.payment_term.note) or removeParentNode('blockTable')) ]] + [[ format((o.payment_term and o.payment_term.note) or removeParentNode('blockTable')) ]] diff --git a/addons/hr_timesheet_invoice/hr_timesheet_invoice.py b/addons/hr_timesheet_invoice/hr_timesheet_invoice.py index 88e8a26758b..fcc3dc8c6c2 100644 --- a/addons/hr_timesheet_invoice/hr_timesheet_invoice.py +++ b/addons/hr_timesheet_invoice/hr_timesheet_invoice.py @@ -114,9 +114,14 @@ class hr_analytic_timesheet(osv.osv): if not account_id: return res res.setdefault('value',{}) - st = self.pool.get('account.analytic.account').browse(cr, uid, - account_id).to_invoice.id + acc = self.pool.get('account.analytic.account').browse(cr, uid, account_id) + st = acc.to_invoice.id res['value']['to_invoice'] = st or False + if acc.state=='pending': + res['warning'] = { + 'title': 'Warning', + 'message': 'The analytic account is in pending state.\nYou should not work on this account !' + } return res def copy(self, cursor, user, obj_id, default=None, context=None): diff --git a/addons/sale/report/order.rml b/addons/sale/report/order.rml index 54a0dc6c527..30ce25b4952 100644 --- a/addons/sale/report/order.rml +++ b/addons/sale/report/order.rml @@ -140,18 +140,18 @@ Shipping address : - [[ o.partner_id.title or '' ]] [[ o.partner_id.name ]] - [[ o.partner_shipping_id.title or '' ]] [[ o.partner_shipping_id.name ]] + [[ o.partner_id.title or '' ]][[ o.partner_id.name ]] + [[ o.partner_shipping_id.title or '' ]][[ o.partner_shipping_id.name ]] [[ o.partner_shipping_id.street ]] - [[ o.partner_shipping_id.street2 or '' ]] - [[ o.partner_shipping_id.city or '' ]] [[ o.partner_shipping_id.zip or '' ]] - [[ o.partner_shipping_id.state_id and o.partner_shipping_id.state_id.name or '' ]] [[ o.partner_shipping_id.country_id and o.partner_shipping_id.country_id.name or '' ]] + [[ o.partner_shipping_id.street2 or '' ]] + [[ o.partner_shipping_id.city or '' ]][[ o.partner_shipping_id.zip or '' ]] + [[ o.partner_shipping_id.state_id and o.partner_shipping_id.state_id.name or '' ]][[ o.partner_shipping_id.country_id and o.partner_shipping_id.country_id.name or '' ]] - Invoice address :[[ o.partner_id.property_payment_term and o.partner_id.property_payment_term.name or '' ]] - [[ o.partner_invoice_id.street ]] [[ o.partner_invoice_id.street2 and (', %s' % o.partner_invoice_id.street2 or '') ]] - [[ o.partner_invoice_id.zip or '' ]] [[ o.partner_invoice_id.city or '' ]] [[ o.partner_invoice_id.country_id and (', %s' % (o.partner_invoice_id.country_id and o.partner_invoice_id.country_id.name or '')) ]] + Invoice address :[[ o.partner_id.property_payment_term.name ]] + [[ o.partner_invoice_id.street ]][[ o.partner_invoice_id.street2 and (', %s' % o.partner_invoice_id.street2 or '') ]] + [[ o.partner_invoice_id.zip or '' ]][[ o.partner_invoice_id.city or '' ]][[ o.partner_invoice_id.country_id and (', %s' % (o.partner_invoice_id.country_id and o.partner_invoice_id.country_id.name or '')) ]] @@ -159,17 +159,17 @@ - [[ o.partner_id.title or '' ]] [[ o.partner_id.name ]] - [[ o.partner_order_id.title or '' ]] [[ o.partner_order_id.name ]] + [[ o.partner_id.title or '' ]][[ o.partner_id.name ]] + [[ o.partner_order_id.title or '' ]][[ o.partner_order_id.name ]] [[ o.partner_order_id.street ]] [[ o.partner_order_id.street2 or '' ]] - [[ o.partner_order_id.zip or '' ]] [[ o.partner_order_id.city or '' ]] - [[ o.partner_order_id.state_id and o.partner_order_id.state_id.name or '' ]] [[ o.partner_order_id.country_id and o.partner_order_id.country_id.name or '' ]] + [[ o.partner_order_id.zip or '' ]][[ o.partner_order_id.city or '' ]] + [[ o.partner_order_id.state_id and o.partner_order_id.state_id.name or '' ]][[ o.partner_order_id.country_id and o.partner_order_id.country_id.name or '' ]] Tel. : [[ o.partner_order_id.phone or removeParentNode('para') ]] - Fax : [[ o.partner_order_id.fax or removeParentNode('para') ]] + Fax : [[ o.partner_order_id.fax or removeParentNode('para') ]] TVA : [[ o.partner_id.vat or removeParentNode('para') ]] @@ -191,7 +191,7 @@ Your Reference - Date + Date Ordered Our Salesman @@ -204,7 +204,7 @@ - [[ o.client_order_ref or '' ]] + [[ o.name ]] [[ o.date_order ]] @@ -213,7 +213,7 @@ [[ o.user_id.name ]] - [[ o.partner_id.property_payment_term['name'] or o.payment_term and o.payment_term.name or '' ]] + [[ o.partner_id and o.partner_id.property_payment_term and o.partner_id.property_payment_term['name'] or '' ]] @@ -244,28 +244,28 @@
[[ repeatIn(o.order_line,'line') ]] - + [[ line.name ]] - [[ ', '.join(map(lambda x: x.name, line.tax_id)) ]] + [[ ', '.join(map(lambda x: x.name, line.tax_id)) or '0.00' ]] - [[ line.product_uos and line.product_uos_qty or line.product_uom_qty ]] + [[ line.product_uos and line.product_uos_qty or line.product_uom_qty or '0.00']] [[ line.product_uos and line.product_uos.name or line.product_uom.name ]] - [[ line.price_unit ]] + [[ line.price_unit or '0.00' ]] - [[ line.discount and str(line.discount) or '' ]] + [[ line.discount and str(line.discount) or '0.00' ]] - [[ line.price_subtotal ]] + [[ line.price_subtotal or '0.00' ]] @@ -316,7 +316,7 @@ Net Total : - [[ o.amount_untaxed ]] + [[ o.amount_untaxed or '0.00' ]] [[ o.pricelist_id.currency_id.name ]] @@ -332,7 +332,7 @@ Taxes : - [[ o.amount_tax ]] + [[ o.amount_tax or '0.00' ]] [[ o.pricelist_id.currency_id.name ]] @@ -348,7 +348,7 @@ Total : - [[ o.amount_total ]] + [[ o.amount_total or '0.00' ]] [[ o.pricelist_id.currency_id.name ]] @@ -358,7 +358,7 @@ - + [[ format(o.note or '') ]] @@ -374,4 +374,4 @@ - + \ No newline at end of file