=== added directory 'mrp_repair_webkit' === added file 'mrp_repair_webkit/__init__.py' --- mrp_repair_webkit/__init__.py 1970-01-01 00:00:00 +0000 +++ mrp_repair_webkit/__init__.py 2014-03-21 16:49:59 +0000 @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# This module uses OpenERP, Open Source Management Solution Framework. +# Copyright (C) 2012-Today Serpent Consulting Services Pvt. Ltd.() +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see +# +############################################################################## +from . import report + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: === added file 'mrp_repair_webkit/__openerp__.py' --- mrp_repair_webkit/__openerp__.py 1970-01-01 00:00:00 +0000 +++ mrp_repair_webkit/__openerp__.py 2014-03-21 16:49:59 +0000 @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# This module uses OpenERP, Open Source Management Solution Framework. +# Copyright (C) 2012-Today Serpent Consulting Services Pvt. Ltd.() +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see +# +############################################################################## + +{ + 'name': 'Repairs Management', + 'version': '1.0', + 'category': 'Manufacturing', + 'description': """ +The aim is to have a complete module to manage all products repairs. +==================================================================== + It is conversion of rml report to Webkit Report. + +""", + 'author': 'Serpent Consulting Services Pvt. Ltd.', + 'website': 'http://www.serpentcs.com', + 'depends': ['mrp_repair', 'report_webkit'], + 'data': [ + 'mrp_repair_report.xml', + ], + 'installable': True, + 'auto_install': False, +} +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: === added file 'mrp_repair_webkit/mrp_repair_report.xml' --- mrp_repair_webkit/mrp_repair_report.xml 1970-01-01 00:00:00 +0000 +++ mrp_repair_webkit/mrp_repair_report.xml 2014-03-21 16:49:59 +0000 @@ -0,0 +1,194 @@ + + + + + + + + + + + + + + + + + + +
${ company.rml_footer or '' }
Contact : ${ user.name }
${_debug or ''|n} + + ]]>
+ Portrait + A4 + + + + + + + + + + + + +
${ helper.embed_image('png',company.logo,200,50)|n }

${ company.rml_header1 }
${_debug or ''|n} +

${company.name}



+ + + + + + + + + + +
+ Phone: ${company.phone or ''} +
+ Mail: ${company.email} +
+ ]]> +
+ + + + + MRP Header +
+ + +
+
=== added directory 'mrp_repair_webkit/report' === added file 'mrp_repair_webkit/report/__init__.py' --- mrp_repair_webkit/report/__init__.py 1970-01-01 00:00:00 +0000 +++ mrp_repair_webkit/report/__init__.py 2014-03-21 16:49:59 +0000 @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# This module uses OpenERP, Open Source Management Solution Framework. +# Copyright (C) 2013-Today Serpent Consulting Services Pvt. Ltd.() +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see +# +############################################################################## + +from . import order + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: === added file 'mrp_repair_webkit/report/order.mako' --- mrp_repair_webkit/report/order.mako 1970-01-01 00:00:00 +0000 +++ mrp_repair_webkit/report/order.mako 2014-03-21 16:49:59 +0000 @@ -0,0 +1,235 @@ + + + + qutation_order.pdf + + + %for o in objects: + + + + + + + + +
+
+ Shipping address :
+ ${ o.partner_id.name }
+ ${ o.address_id.street or '' }
+ ${ o.address_id.city or '' } ${ o.address_id.zip or '' }
+ ${ o.address_id.country_id.name or '' }
+ %if (o.address_id.phone): + Tel. : ${ o.address_id.phone or '' }
+ %endif + %if o.address_id.fax: + Fax : ${ o.address_id.fax or '' }
+ %endif + %if o.address_id.vat: + ${ o.address_id.vat or '' }
+ %endif + + +
+ ${ o.partner_id.name or '' } + ${ o.default_address_id.street or '' }
+ ${ o.default_address_id.city or '' } ${ o.default_address_id.zip or '' }
+ ${ o.default_address_id.country_id.name or '' }
+ %if (o.default_address_id.phone): + Tel. : ${ o.default_address_id.phone or '' }
+ %endif + %if o.default_address_id.fax: + Fax : ${ o.default_address_id.fax or '' }
+ %endif + %if o.default_address_id.vat: + ${ o.default_address_id.vat or '' } + %endif +
+ Invoice address :
+ ${ o.partner_id and o.partner_id.property_payment_term.name or ''}
+ ${ o.partner_invoice_id.name or ''}
+ ${ o.partner_invoice_id.street or '' }
+ ${ o.partner_invoice_id.city or '' } ${ o.partner_invoice_id.zip or '' }
+ ${ o.partner_invoice_id.country_id.name or '' }
+ %if (o.partner_invoice_id.phone): + Tel. : ${ o.partner_invoice_id.phone or '' }
+ %endif + %if o.partner_invoice_id.fax: + Fax : ${ o.partner_invoice_id.fax or '' }
+ %endif + %if o.partner_invoice_id.vat: + ${ o.partner_invoice_id.vat or '' } + %endif + +
+

+ %if o.state <> 'draft' or '': + Repair Quotation N° : ${ o.name } + %endif + %if o.state=='draft' or '' : + Repair Order N° : ${ o.name } + %endif +

+ + + + + + + + + + + + + +
+ ${_("Product to Repair")} + + ${_("Lot Number")} + + ${_("Guarantee Limit")} + + ${_("Printing Date")} +
+ ${ o.product_id.name or '' } + + ${ o.prodlot_id.name or ' ' } + + ${ formatLang(o.guarantee_limit,date = True) } + + ${ formatLang(time.strftime('%Y-%m-%d'),date = True)} +
+
+ + + + + + + + +
+ ${_("Description")} + + ${_("Tax")} + + ${_("Quantity")} + + ${_("Unit Price")} + + ${_("Price")} +
+

Operation Line(s)

+ %for line in o.operations: + %if line['to_invoice']==True: + + + + + + + + +
+ %if line.type == 'add' or '': + (Add)${ line.name } + %endif + %if line.type == 'remove' or '': + (Remove) ${ line.name } + %endif + + ${ ','.join(map( lambda x: x.name, line.tax_id)) } + + ${ formatLang(line.product_uom_qty) } ${ line.product_uom.name } + + ${ formatLang(line.price_unit) } + + ${ formatLang(line.price_subtotal, currency_obj = o.pricelist_id.currency_id) } +
+ %endif + %endfor + %if len(o.fees_lines) != 0 : + +

Fees Line(s)

+ %for fees in o.fees_lines: + %if fees.to_invoice==True: + + + + + + + + +
+ ${ fees.name } + + ${ ','.join(map( lambda x: x.name, fees.tax_id)) } + + ${ formatLang(fees.product_uom_qty) } ${ fees.product_uom.name } + + ${ formatLang(fees.price_unit) } + + ${ formatLang(fees.price_subtotal, currency_obj = o.pricelist_id.currency_id) } +
+ %endif + %endfor + %endif + + + + + + + + + +
+ + + + + + + + + + +
+ Net Total : + + ${ formatLang(o.amount_untaxed, dp='Sale Price', currency_obj=o.pricelist_id.currency_id) } +
+ ${_("Taxes:")} + + ${ formatLang(o.amount_tax, dp='Account', currency_obj=o.pricelist_id.currency_id) } +
+
+ + + + + + +
+ ${_("Total :")} + + ${ formatLang(total(o), dp='Sale Price', currency_obj=o.pricelist_id.currency_id) } +
+
+ + + + +
+ ${ o.quotation_notes or '' } +
+

+

+ %endfor + + === added file 'mrp_repair_webkit/report/order.py' --- mrp_repair_webkit/report/order.py 1970-01-01 00:00:00 +0000 +++ mrp_repair_webkit/report/order.py 2014-03-21 16:49:59 +0000 @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# This module uses OpenERP, Open Source Management Solution Framework. +# Copyright (C) 2012-Today Serpent Consulting Services Pvt. Ltd.() +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see +# +############################################################################## +import time + +from openerp.report import report_sxw + + +class order(report_sxw.rml_parse): + def __init__(self, cr, uid, name, context): + super(order, self).__init__(cr, uid, name, context=context) + self.localcontext.update({ + 'time': time, + 'total': self.total, + }) + + def total(self, repair): + print "repair", repair + total = 0.0 + for operation in repair.operations: + total += operation.price_subtotal + for fee in repair.fees_lines: + total += fee.price_subtotal + total = total + repair.amount_tax + return total + +report_sxw.report_sxw('report.repair.order.webkit', + 'mrp.repair', + 'addons/mrp_repair_webkit/report/order.mako', + parser=order) + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: