Merge lp:~serpentcs/purchase-report/purchase-serpentcs into lp:~purchase-core-editors/purchase-report/7.0

Proposed by Nishant Jogi (Serpent Consulting Services)
Status: Work in progress
Proposed branch: lp:~serpentcs/purchase-report/purchase-serpentcs
Merge into: lp:~purchase-core-editors/purchase-report/7.0
Diff against target: 1127 lines (+1051/-0)
14 files modified
purchase_requisition_webkit/__init__.py (+25/-0)
purchase_requisition_webkit/__openerp__.py (+42/-0)
purchase_requisition_webkit/purchase_requisition_report.xml (+160/-0)
purchase_requisition_webkit/report/__init__.py (+24/-0)
purchase_requisition_webkit/report/purchase_requisition.mako (+141/-0)
purchase_requisition_webkit/report/requisition.py (+37/-0)
purchase_webkit/__init__.py (+25/-0)
purchase_webkit/__openerp__.py (+43/-0)
purchase_webkit/purchase_report.xml (+175/-0)
purchase_webkit/report/__init__.py (+23/-0)
purchase_webkit/report/order.mako (+190/-0)
purchase_webkit/report/order.py (+35/-0)
purchase_webkit/report/request_quotation.mako (+94/-0)
purchase_webkit/report/request_quotation.py (+37/-0)
To merge this branch: bzr merge lp:~serpentcs/purchase-report/purchase-serpentcs
Reviewer Review Type Date Requested Status
Alexandre Fayolle - camptocamp Needs Resubmitting
Lorenzo Battistini (community) Needs Fixing
Review via email: mp+190323@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Lorenzo Battistini (elbati) wrote :

Hello Nishant,
I think the purchase_webkit module overlaps the purchase_order_webkit
http://bazaar.launchpad.net/~purchase-core-editors/purchase-report/7.0/files/10/purchase_order_webkit
Is it wanted?

review: Needs Information
Revision history for this message
Nishant Jogi (Serpent Consulting Services) (njogi-serpentcs) wrote :

Hello Lorenzo,
Yes, you are right.
Both module contains same things.
I think it was committed by mistake by me.
It is not wanted.
Thank you.

Revision history for this message
Lorenzo Battistini (elbati) :
review: Needs Fixing
Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

Hello,

The management of the project has moved to Github: https://github.com/OCA/purchase-reporting

Please migrate your merge proposal to Github. You may want to check https://github.com/OCA/maintainers-tools/wiki/How-to-move-a-Merge-Proposal-to-GitHub for an explanation on how to proceed.

Thanks for contributing to the project

review: Needs Resubmitting

Unmerged revisions

11. By Nishant Jogi (Serpent Consulting Services)

[ADD] Added Purchase report with rml to webkit conversion.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added directory 'purchase_requisition_webkit'
=== added file 'purchase_requisition_webkit/__init__.py'
--- purchase_requisition_webkit/__init__.py 1970-01-01 00:00:00 +0000
+++ purchase_requisition_webkit/__init__.py 2013-10-10 09:53:37 +0000
@@ -0,0 +1,25 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>)
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20############################################################################
21
22
23import report
24# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
25
026
=== added file 'purchase_requisition_webkit/__openerp__.py'
--- purchase_requisition_webkit/__openerp__.py 1970-01-01 00:00:00 +0000
+++ purchase_requisition_webkit/__openerp__.py 2013-10-10 09:53:37 +0000
@@ -0,0 +1,42 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>)
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20############################################################################
21
22{
23 'name': 'Purchase Requisitions',
24 'version': '0.1',
25 'author': 'Serpent Consulting Services',
26 'category': 'Purchase Management',
27 'website': 'http://www.serpentcs.com',
28 'description': """
29This module allows you to manage your Purchase Requisition.
30===========================================================
31 It is conversion of rml report to Webkit Report.
32
33""",
34 'depends' : ['purchase_requisition','report_webkit'],
35 'data': [
36 'purchase_requisition_report.xml',
37 ],
38 'auto_install': False,
39 'installable': True,
40}
41# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
42
043
=== added file 'purchase_requisition_webkit/purchase_requisition_report.xml'
--- purchase_requisition_webkit/purchase_requisition_report.xml 1970-01-01 00:00:00 +0000
+++ purchase_requisition_webkit/purchase_requisition_report.xml 2013-10-10 09:53:37 +0000
@@ -0,0 +1,160 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <record id="Purchase_Req_webkit_header" model="ir.header_webkit">
5 <field name="footer_html"><![CDATA[]]></field>
6 <field name="orientation">Portrait</field>
7 <field name="format">A4</field>
8 <field name="html"><![CDATA[
9<html>
10 <head>
11 <meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
12 <script>
13 function subst() {
14 var vars={};
15 var x=document.location.search.substring(1).split('&');
16 for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);}
17 var x=['frompage','topage','page','webpage','section','subsection','subsubsection'];
18 for(var i in x) {
19 var y = document.getElementsByClassName(x[i]);
20 for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]];
21 }
22 }
23 </script>
24 <style type="text/css">
25
26 ${css}
27 </style>
28 </head>
29
30 ${_debug or ''|n} </body>
31</html>]]>
32 </field>
33 <field name="orientation">Portrait</field>
34 <field name="format">A4</field>
35 <field name="html"><![CDATA[
36<html>
37 <head>
38 <meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
39 <script>
40 function subst() {
41 var vars={};
42 var x=document.location.search.substring(1).split('&');
43 for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);}
44 var x=['frompage','topage','page','webpage','section','subsection','subsubsection'];
45 for(var i in x) {
46 var y = document.getElementsByClassName(x[i]);
47 for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]];
48 }
49 }
50 </script>
51 <style type="text/css">
52 ${css}
53 </style>
54 </head>
55 <body style="border:0; margin:0 ;" onload="subst()">
56 <table class="header" style="border-bottom: 1px solid black; width: 100%">
57 <tr >
58 <td style="text-align:right;font-size:12;" width="20%">${ helper.embed_image('png',company.logo,200,40)|n }</td>
59 <td style="text-align:right;font-size:12;" width="80%"></br></br>${ company.rml_header1 }</td>
60 </tr>
61 </table> ${_debug or ''|n} </body>
62 <p style="text-align:left;font-size:12;">${company.name}</p></br></br></br>
63 <table width="100%">
64 <tr>
65 <td style="text-align:left;font-size:10;" width="25%">
66 Phone: ${company.phone or ''}
67 </td>
68 <td width="75%"></td>
69 </tr>
70
71 <tr>
72 <td style="text-align:left;font-size:10; border-bottom: 1px solid black;" width="25%">
73 Mail: ${company.email}
74 </td>
75 <td width="75%"></td>
76 </tr>
77 </table>
78
79</html>]]>
80 </field>
81 <field eval="55.0" name="margin_top"/>
82 <field eval="5.0" name="margin_bottom"/>
83 <field name="css"><![CDATA[
84
85
86 .list_table {
87 border-color:black;
88 text-align:center;
89 border-collapse: collapse;
90 }
91 .list_table td {
92 border-bottom:1px solid #ccc;
93 text-align:left;
94 font-size:10px;
95 padding-left:3px
96 padding-right:3px
97 padding-top:3px
98 padding-bottom:3px
99 }
100 .list_table1 {
101 border-color:black;
102 text-align:center;
103 border-collapse: collapse;
104 }
105 .list_table1 td {
106 border-bottom:1px solid black;
107 text-align:left;
108 font-size:11px;
109 padding-left:3px;
110 padding-right:3px;
111 padding-top:3px;
112 padding-bottom:3px;
113 }
114
115 .basic_table {
116 border-color:#ccc;
117 text-align:center;
118 border-collapse: collapse;
119 font-family: Helvetica;
120 }
121 .basic_table td {
122 border-color:#ccc;
123 border:1px solid #ccc;
124 text-align:center;
125 font-size:12px;
126 padding-left:5px;
127 padding-right:3px;
128 padding-top:3px;
129 padding-bottom:3px;
130 font-family: Helvetica;
131 }
132
133 .title{
134 text-align:left
135 font-size:15px;
136 font-family: Helvetica-Bold;
137 }
138
139 .title1{
140 text-align:left;
141 font-size:11px;
142 font-family: Helvetica-Bold;
143 }
144
145]]>
146 </field>
147 <field name="name">Purchase Requisition webkit header</field>
148 </record>
149
150 <report
151 auto="False"
152 id="report_purchase_requisition"
153 model="purchase.requisition"
154 name="purchase.requisition.webkit"
155 file="purchase_requisition_webkit/report/purchase_requisition.mako"
156 string="Purchase Requisition"
157 report_type="webkit"
158 webkit_header="Purchase_Req_webkit_header"/>
159 </data>
160</openerp>
0161
=== added directory 'purchase_requisition_webkit/report'
=== added file 'purchase_requisition_webkit/report/__init__.py'
--- purchase_requisition_webkit/report/__init__.py 1970-01-01 00:00:00 +0000
+++ purchase_requisition_webkit/report/__init__.py 2013-10-10 09:53:37 +0000
@@ -0,0 +1,24 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>)
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20############################################################################
21import requisition
22
23# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
24
025
=== added file 'purchase_requisition_webkit/report/purchase_requisition.mako'
--- purchase_requisition_webkit/report/purchase_requisition.mako 1970-01-01 00:00:00 +0000
+++ purchase_requisition_webkit/report/purchase_requisition.mako 2013-10-10 09:53:37 +0000
@@ -0,0 +1,141 @@
1<!DOCTYPE html SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
3<html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5 <style type="text/css">
6 ${css}
7 </style>
8 <title>Purchase for Requisitions.pdf</title>
9 </head>
10 <body>
11 %for requisition in objects:
12 <table width="100%" class="title">
13 <tr>
14 <td><br/><br/>
15 <b> ${ _('Purchase for Requisitions') } ${requisition.name}</b><br/><br/>
16 </td>
17 </tr>
18 </table>
19
20 <table class="basic_table" width="100%">
21 <tr>
22 <td width="30%">
23 <b>${ _('Requisition Reference') }</b>
24 </td>
25 <td width="30%">
26 <b>${ _('Requisition Date') }</b>
27 </td>
28 <td width="20%">
29 <b>${ _('Type') }</b>
30 </td>
31 <td width="20%">
32 <b>${ _('Source') }</b>
33 </td>
34 </tr>
35 </table>
36
37 <table class="basic_table" width="100%">
38 <tr>
39 <td width="30%">
40 ${requisition.name}
41 </td>
42 <td width="30%">
43 ${formatLang(requisition.date_start,date_time='True')}
44 </td>
45 <td width="20%">
46 ${requisition.exclusive=='multiple' and 'Multiple Requisitions' or requisition.exclusive=='exclusive' and 'Purchase Requisitions (exclusive)'}
47 </td>
48 <td width="20%">
49 ${requisition.origin or ''}
50 </td>
51 </tr>
52 </table><br/>
53
54 %if requisition.line_ids==[]:
55
56 %else:
57 <table width="100%" class="title1">
58 <tr>
59 <td>
60 <b> ${ _('Product Detail') }</b><br/>
61 </td>
62 </tr>
63 </table>
64 </br>
65 <table class="list_table1" width="100%">
66 <tr>
67 <td style="text-align:left ;padding-left:5px" width="60%">
68 <b>${ _('Description') }</b>
69 </td>
70 <td style="text-align:right;" width="20%">
71 <b>${ _('Qty') }</b>
72 </td>
73 <td style="text-align:center;"width="20%">
74 <b>${ _('Product UoM') }</b>
75 </td>
76 </tr>
77 </table>
78
79 %for line_ids in requisition.line_ids:
80 <table class="list_table" width="100%">
81 <tr>
82 <td style="text-align:left;padding-left:5px"width="60%">
83 [${line_ids.product_id and line_ids.product_id.code or ''}] ${line_ids.product_id and line_ids.product_id.name or ''}
84 </td>
85 <td style="text-align:right;"width="20%">
86 ${ formatLang(line_ids.product_qty) }
87 </td>
88 <td style="text-align:center;"width="20%">
89 ${line_ids.product_uom_id and line_ids.product_uom_id.category_id and line_ids.product_uom_id.category_id.name or ''}
90 </td>
91 </tr>
92 </table><br/>
93 %endfor
94 %endif
95
96 %if requisition.purchase_ids ==[]:
97
98 %else:
99 <table width="100%" class="title1">
100 <tr>
101 <td>
102 <b> ${ _('Quotation Detail') }</b><br/>
103 </td>
104 </tr>
105 </table>
106 </br>
107 <table class="list_table1" width="100%">
108 <tr>
109 <td style="text-align:left ;padding-left:5px"width="60%">
110 <b>${ _('Supplier') }<b/>
111 </td>
112 <td style="text-align:center;"width="20%">
113 <b>${ _('Date Ordered') }<b/>
114 </td>
115 <td style="text-align:center;"width="20%">
116 <b>${ _('Order Reference') }<b/>
117 </td>
118 </tr>
119 </table>
120
121 %for purchase_ids in requisition.purchase_ids:
122 <table class="list_table " width="100%">
123 <tr>
124 <td style="text-align:left; padding-left:5px" width="60%">
125 ${purchase_ids.partner_id and purchase_ids.partner_id.name or ''}
126 </td>
127 <td style="text-align:center;"width="20%">
128 ${formatLang(purchase_ids.date_order,date='True')}
129 </td>
130 <td style="text-align:center;"width="20%">
131 ${purchase_ids.name}
132 </td>
133 </tr>
134 </table>
135 %endfor
136 %endif
137
138 <p style="page-break-after:always"></p>
139 %endfor
140 </body>
141</html>
0\ No newline at end of file142\ No newline at end of file
1143
=== added file 'purchase_requisition_webkit/report/requisition.py'
--- purchase_requisition_webkit/report/requisition.py 1970-01-01 00:00:00 +0000
+++ purchase_requisition_webkit/report/requisition.py 2013-10-10 09:53:37 +0000
@@ -0,0 +1,37 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>)
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20############################################################################
21
22import time
23from openerp.report import report_sxw
24from openerp.osv import osv
25from openerp import pooler
26
27class requisition(report_sxw.rml_parse):
28 def __init__(self, cr, uid, name, context):
29 super(requisition, self).__init__(cr, uid, name, context=context)
30 self.localcontext.update({
31 'time': time,
32 })
33
34report_sxw.report_sxw('report.purchase.requisition.webkit','purchase.requisition','addons/purchase_requisition_webkit/report/purchase_requisition.mako',parser=requisition)
35
36# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
37
038
=== added directory 'purchase_webkit'
=== added file 'purchase_webkit/__init__.py'
--- purchase_webkit/__init__.py 1970-01-01 00:00:00 +0000
+++ purchase_webkit/__init__.py 2013-10-10 09:53:37 +0000
@@ -0,0 +1,25 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22import report
23
24# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
25
026
=== added file 'purchase_webkit/__openerp__.py'
--- purchase_webkit/__openerp__.py 1970-01-01 00:00:00 +0000
+++ purchase_webkit/__openerp__.py 2013-10-10 09:53:37 +0000
@@ -0,0 +1,43 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2011-2013 Serpent Consulting Services (<http://www.serpentcs.com>)
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20############################################################################
21
22{
23 'name': 'Purchase Management',
24 'version': '1.1',
25 'category': 'Purchase Management',
26 'summary': 'Purchase Orders, Receptions, Supplier Invoices',
27 'description': """
28Manage goods requirement by Purchase Orders easily
29==================================================
30
31 It is conversion of rml report to Webkit Report.
32 """,
33 'author': 'Serpent Consulting Services',
34 'website': 'http://www.serpentcs.com',
35 'depends': ['purchase','report_webkit'],
36 'data': [
37 'purchase_report.xml',
38 ],
39 'installable': True,
40 'auto_install': False,
41 'application': True,
42}
43# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
044
=== added file 'purchase_webkit/purchase_report.xml'
--- purchase_webkit/purchase_report.xml 1970-01-01 00:00:00 +0000
+++ purchase_webkit/purchase_report.xml 2013-10-10 09:53:37 +0000
@@ -0,0 +1,175 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4 <record id="purchase_order_header" model="ir.header_webkit">
5 <field name="footer_html"><![CDATA[
6 <html>
7 <head>
8 <meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
9 <script>
10 function subst() {
11 var vars={};
12 var x=document.location.search.substring(1).split('&');
13 for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);}
14 var x=['frompage','topage','page','webpage','section','subsection','subsubsection'];
15 for(var i in x) {
16 var y = document.getElementsByClassName(x[i]);
17 for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]];
18 }
19 }
20 </script>
21 <style type="text/css">
22
23 ${css}
24 </style>
25 </head>
26 <body style="border:0; margin: 0;" onload="subst()">
27 <table class="header" style="border-top: 1px solid black; width: 100%">
28 <tr >
29 <td style="text-align:center;font-size:12;" >${ company.rml_footer }</td>
30 </tr>
31 <tr >
32 <td style="text-align:center;font-size:12;" >Contact : ${ user.name }</td>
33 </tr>
34 </table> ${_debug or ''|n} </body>
35 </html>
36 ]]></field>
37 <field name="orientation">Portrait</field>
38 <field name="format">A4</field>
39 <field name="html"><![CDATA[
40 <html>
41 <head>
42 <meta content="text/html; charset=UTF-8" http-equiv="content-type"/>
43 <script>
44 function subst() {
45 var vars={};
46 var x=document.location.search.substring(1).split('&');
47 for(var i in x) {var z=x[i].split('=',2);vars[z[0]] = unescape(z[1]);}
48 var x=['frompage','topage','page','webpage','section','subsection','subsubsection'];
49 for(var i in x) {
50 var y = document.getElementsByClassName(x[i]);
51 for(var j=0; j<y.length; ++j) y[j].textContent = vars[x[i]];
52 }
53 }
54 </script>
55 <style type="text/css">
56
57 ${css}
58 </style>
59 </head>
60 <body style="border:0; margin: 0;" onload="subst()">
61 <table class="header" style="border-bottom: 1px solid black; width: 100%">
62 <tr >
63 <td style="text-align:left;font-size:12;" width="20%">${ helper.embed_image('png',company.logo,200,50)|n }</td>
64 <td style="text-align:right;font-size:12;" width="80%"></br></br>${ company.rml_header1 }</td>
65 </tr>
66 </table> ${_debug or ''|n} </body>
67 <p style="text-align:left;font-size:12;">${company.name}</p>
68 </html>]]>
69 </field>
70 <field eval="25.0" name="margin_top"/>
71 <field eval="25.0" name="margin_bottom"/>
72 <field name="css"><![CDATA[
73
74 body, table, td, span, div {
75 font-family: Helvetica, Arial;
76 }
77
78 body {
79 font-family:Arial;
80 font-size:9;
81
82 }
83
84
85 .header {
86 margin-left:0;
87 text-align:left;
88 width:300px;
89 font-size:12;
90 }
91 .title {
92 font-size:16;
93 font-weight: bold;
94 font-family: Helvetica, Arial;
95 }
96
97
98 .basic_table{
99 width:100%;
100 text-align:center;
101 border:1px solid lightGrey;
102 border-collapse: collapse;
103 font-family: Helvetica;
104 }
105 .basic_table td {
106 border:1px solid lightGrey;
107 font-size:12;
108 font-family: Helvetica;
109 }
110
111 .list_table {
112 border-color:black;
113 text-align:center;
114 border-collapse: collapse;
115 font-family: Helvetica;
116 }
117 .tbl_header{
118 width:100%;
119 font-size:10px;
120 }
121 .tr_bottom_line{
122 border-bottom: thin solid black;
123 width:100%;
124 font-size:12px;
125 font-weight: bold;
126 font-family: Helvetica;
127 }
128 .tr_bottom_line_dark_grey{
129 border-top: thin solid #ccc;
130 width:100%;
131 font-size:12px;
132 font-family: Helvetica;
133 }
134 .tr_top{
135 border-top: thin solid black;
136 width:100%;
137 font-size:12px;
138 font-family: Helvetica;
139 }
140
141 .td_f12{
142 font-size:12px;
143 font-family: Helvetica;
144 }
145
146
147
148 ]]>
149 </field>
150 <field name="name">Purchase Order Header</field>
151 </record>
152
153 <report
154 auto="False"
155 id="report_purchase_quotation"
156 model="purchase.order"
157 name="purchase.quotation.webkit"
158 file="purchase_webkit/report/request_quotation.mako"
159 string="Request for Quotation"
160 report_type="webkit"
161 webkit_header="purchase_order_header" />
162
163 <report
164 auto="False"
165 id="report_purchase_order"
166 model="purchase.order"
167 name="purchase.order.webkit"
168 file="purchase_webkit/report/order.mako"
169 usage="default"
170 string="Purchase Order"
171 report_type="webkit"
172 webkit_header="purchase_order_header"/>
173
174 </data>
175</openerp>
0176
=== added directory 'purchase_webkit/report'
=== added file 'purchase_webkit/report/__init__.py'
--- purchase_webkit/report/__init__.py 1970-01-01 00:00:00 +0000
+++ purchase_webkit/report/__init__.py 2013-10-10 09:53:37 +0000
@@ -0,0 +1,23 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22import order
23import request_quotation
024
=== added file 'purchase_webkit/report/order.mako'
--- purchase_webkit/report/order.mako 1970-01-01 00:00:00 +0000
+++ purchase_webkit/report/order.mako 2013-10-10 09:53:37 +0000
@@ -0,0 +1,190 @@
1<html>
2<head>
3 <style type="text/css">
4 ${css}
5 </style>
6</head>
7<body>
8</br>
9 </br>
10 </br>
11
12 %for o in objects:
13 </br>
14 <table class="td_f12 tr_bottom_line_dark" width="40%" >
15 <tr>
16 <td width="25%">Phone</td>
17 <td>:&nbsp;${ company.phone or ''}</td>
18 </tr>
19 <tr>
20 <td>Mail</td>
21 <td>:&nbsp;${ company.email or '' }</td>
22 </tr>
23 </table>
24 </br>
25 </br>
26 <table width="100%">
27 <tr>
28 <td width="3%"></td>
29 <td class="td_f12" >
30 <b>${_('Shipping address :')}</b></br>
31 ${(o.dest_address_id and o.dest_address_id.name) or (o.warehouse_id and o.warehouse_id.name) or ''}</br>
32 ${(o.dest_address_id and display_address(o.dest_address_id)) or (o.warehouse_id and display_address(o.warehouse_id.partner_id)) or ''}</br>
33 </br>
34
35
36 </td>
37 <td class="td_f12" >
38 ${o.partner_id and o.partner_id and o.partner_id.name or '' }</br>
39 ${o.partner_id.street}</br>
40 ${o.partner_id.city or '' }&nbsp;${o.partner_id.zip or '' }</br>
41 ${o.partner_id.country_id.name or ''}
42 </td>
43 <td> </td>
44 </tr>
45 </table>
46 </br>
47 </br>
48 %if o.state =='draft':
49 <h1><b>Purchase Order Confirmation N° ${ o.name }</b></h1>
50 %endif
51 %if o.state <>'draft':
52 <h1><b> Request for Quotation N° ${ o.name } </b></h1>
53 %endif
54 </br>
55 </br>
56 <table class="basic_table">
57 <tr>
58 <td width="25%">
59 <b>${_('Our Order Reference')}</b>
60 </td>
61 <td width="25%">
62 <b>${_('Your Order Reference')}</b>
63 </td>
64 <td width="25%">
65 <b>${_('Order Date')}</b>
66 </td>
67 <td width="25%">
68 <b>${_('Validated By')}</b>
69 </td>
70 </tr>
71 <tr>
72 <td>
73 ${ o.name or '' }
74 </td>
75 <td>
76 ${ o.partner_ref or '' }
77 </td>
78 <td>
79 ${ o.date_order }
80 </td>
81 <td>
82 ${ (o.validator and o.validator.name) or '' }
83 </td>
84 </tr>
85 </table>
86 </br>
87 </br>
88 <table class="tr_bottom_line">
89 <tr>
90 <td width="34%">
91 <b>${_('Description')}</b>
92 </td>
93 <td width="10%">
94 <b>${_('Taxes')}</b>
95 </td>
96 <td width="15%">
97 <b>${_('Date Req.')}</b>
98 </td>
99 <td width="15%" align="right">
100 <b>${_('Qty')}</b>
101 </td>
102 <td width="13%" align="right">
103 <b>${_('Unit Price')}</b>
104 </td>
105 <td width="13%" align="right">
106 <b>${_('Net Price')}</b>
107 </td>
108 </tr>
109 </table>
110 %for line in o.order_line:
111 <table class="tr_bottom_line_dark_grey">
112 <tr>
113 <td width="34%">
114 ${ line.name }
115 </td>
116 <td width="10%">
117 ${ ', '.join(map(lambda x: x.name, line.taxes_id)) }
118 </td>
119 <td width="15%">
120 ${ formatLang( line.date_planned, date=True)}
121 </td>
122 <td width="15%" align="right">
123 ${ formatLang(line.product_qty )} ${ line.product_uom.name }
124 </td>
125 <td width="13%" align="right">
126 ${ formatLang(line.price_unit, digits=get_digits(dp='Product Price') ) }
127 </td>
128 <td width="13%" align="right">
129 ${ formatLang(line.price_subtotal, digits=get_digits(dp='Account'), currency_obj=o.pricelist_id.currency_id ) }
130 </td>
131 </tr>
132 </table>
133 %endfor
134 <table width="100%">
135 <tr>
136 <td width="70%">
137 </td>
138 <td width="30%">
139 <table class="tr_top">
140 <tr>
141 <td>
142 Net Total :
143 </td>
144 <td>
145 </td>
146 <td align="right">
147 ${ formatLang(o.amount_untaxed, digits=get_digits(dp='Account'), currency_obj=o.pricelist_id.currency_id ) }
148 </td>
149 </tr>
150 <tr>
151 <td>
152 Taxes :
153 </td>
154 <td>
155 </td>
156 <td align="right">
157 ${ formatLang(o.amount_tax, dp='Account', currency_obj=o.pricelist_id.currency_id) }
158 </td>
159 </tr>
160 </table>
161 <table class="tr_top">
162 <tr>
163 <td>
164 <b>Total :</b>
165 </td>
166 <td>
167 </td>
168 <td>
169 <td align="right">
170 <b>${ formatLang(o.amount_total, digits=get_digits(dp='Account') , currency_obj=o.pricelist_id.currency_id ) }</b>
171 </td>
172 </tr>
173 </table>
174 </td>
175 </tr>
176 </table>
177 </br>
178 <table>
179 <tr>
180 <td>
181
182 ${ (o.notes or '') }
183 </td>
184 </tr>
185 </table>
186 <p style="page-break-after:always">
187 </p>
188 %endfor
189</body>
190</html>
0\ No newline at end of file191\ No newline at end of file
1192
=== added file 'purchase_webkit/report/order.py'
--- purchase_webkit/report/order.py 1970-01-01 00:00:00 +0000
+++ purchase_webkit/report/order.py 2013-10-10 09:53:37 +0000
@@ -0,0 +1,35 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22import time
23from openerp.report import report_sxw
24from openerp.osv import osv
25from openerp import pooler
26
27class order(report_sxw.rml_parse):
28 def __init__(self, cr, uid, name, context):
29 super(order, self).__init__(cr, uid, name, context=context)
30 self.localcontext.update({'time': time})
31
32report_sxw.report_sxw('report.purchase.order.webkit','purchase.order','purchase_webkit/report/order.mako',parser=order)
33
34# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
35
036
=== added file 'purchase_webkit/report/request_quotation.mako'
--- purchase_webkit/report/request_quotation.mako 1970-01-01 00:00:00 +0000
+++ purchase_webkit/report/request_quotation.mako 2013-10-10 09:53:37 +0000
@@ -0,0 +1,94 @@
1<html>
2<head>
3 <style type="text/css">
4 ${css}
5 </style>
6 <title>requestforquotation.pdf</title>
7</head>
8<body>
9 %for order in objects:
10 </br>
11 </br>
12 </br>
13 </br>
14 <table class="td_f12" width="40%" >
15 <tr>
16 <td width="25%">Phone</td>
17 <td>:&nbsp;${ company.phone or ''}</td>
18 </tr>
19 <tr>
20 <td>Mail</td>
21 <td>:&nbsp;${ company.email or '' }</td>
22 </tr>
23 </table>
24 </br>
25 </br>
26 <table width="100%">
27 <tr>
28 <td width="70%">
29 <table width="100%" class="td_f12">
30 <tr>
31 <td>
32 <b>Expected Delivery address:</b></br>
33 ${ (order.dest_address_id and order.dest_address_id.name) or (order.warehouse_id and order.warehouse_id.name) or ''}</br>
34 ${ order.dest_address_id and display_address(order.dest_address_id) }</br></br>
35 </td>
36 </tr>
37 </table>
38 </td>
39 <td>
40 </td>
41 <td width="70%" class="td_f12">
42 ${ (order .partner_id and order.partner_id.title and order.partner_id.title.name) or '' } ${ (order .partner_id and order.partner_id.name) or '' }</br>
43 ${ order.partner_id and display_address(order .partner_id) }</br>
44 Tel.: ${ (order.partner_id and order.partner_id.phone) or '' }</br>
45 Fax: ${ (order.partner_id and order.partner_id.fax) or ''}</br>
46 TVA: ${ (order.partner_id and order.partner_id.vat) or '' }</br>
47 </td>
48 </tr>
49 </table>
50 </br>
51 <b>Request for Quotation : ${ order.name }</b>
52 <table class="tr_bottom_line">
53 <tr>
54 <td width="65%">
55 <b>${_('Description')}</b>
56 </td>
57 <td width="20%">
58 <b>${_('Expected Date')}</b>
59 </td>
60 <td width="15%">
61 <b>${_('Qty')}</b>
62 </td>
63 </tr>
64 </table>
65 %for order_line in order.order_line:
66 <table class="tr_bottom_line_dark_grey">
67 <tr>
68 <td width="65%">
69 ${ order_line.name }
70 </td>
71 <td width="20%">
72 ${ formatLang(order_line.date_planned, date = True) }
73 </td>
74 <td width="15%" align="right">
75 ${ formatLang(order_line.product_qty )}
76 <i>${ (order_line.product_uom and order_line.product_uom.name) or '' }</i>
77 </td>
78 </tr>
79 </table>
80 %endfor
81 </br>
82 <p class="td_f12">
83 ${ order.notes or '' }</br>
84 ${_('Regards,')}
85 </br>
86 ${ user.signature or ''}</br>
87 </p>
88
89 <p style="page-break-after:always">
90 </p>
91
92 %endfor
93</body>
94</html>
0\ No newline at end of file95\ No newline at end of file
196
=== added file 'purchase_webkit/report/request_quotation.py'
--- purchase_webkit/report/request_quotation.py 1970-01-01 00:00:00 +0000
+++ purchase_webkit/report/request_quotation.py 2013-10-10 09:53:37 +0000
@@ -0,0 +1,37 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22import time
23from openerp.report import report_sxw
24from openerp.osv import osv
25from openerp import pooler
26
27class request_quotation(report_sxw.rml_parse):
28 def __init__(self, cr, uid, name, context):
29 super(request_quotation, self).__init__(cr, uid, name, context=context)
30 self.localcontext.update({
31 'time': time,
32 'user': self.pool.get('res.users').browse(cr, uid, uid, context)
33 })
34report_sxw.report_sxw('report.purchase.quotation.webkit','purchase.order','addons/purchase_webkit/report/request_quotation.mako',parser=request_quotation)
35
36# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
37

Subscribers

People subscribed via source and target branches