openerp-community-reviewer team mailing list archive
-
openerp-community-reviewer team
-
Mailing list archive
-
Message #05970
[Merge] lp:~camptocamp/purchase-report/purchase_print_button into lp:purchase-report
Vincent Renaville@camptocamp has proposed merging lp:~camptocamp/purchase-report/purchase_print_button into lp:purchase-report.
Requested reviews:
Purchase Core Editors (purchase-core-editors)
For more details, see:
https://code.launchpad.net/~camptocamp/purchase-report/purchase_print_button/+merge/216024
This branches add the following fixes:
- remove unused <tr> in repport
- fix button to print quotation to print the correct webkit report
And add the feature
- Print the purchase order when the quotation is confirmed
--
https://code.launchpad.net/~camptocamp/purchase-report/purchase_print_button/+merge/216024
Your team Purchase Core Editors is requested to review the proposed merge of lp:~camptocamp/purchase-report/purchase_print_button into lp:purchase-report.
=== modified file 'purchase_order_webkit/__init__.py'
--- purchase_order_webkit/__init__.py 2014-01-10 11:04:45 +0000
+++ purchase_order_webkit/__init__.py 2014-04-16 07:56:18 +0000
@@ -27,4 +27,5 @@
#
##############################################################################
-from . import report
\ No newline at end of file
+from . import report
+from . import purchase_order
\ No newline at end of file
=== modified file 'purchase_order_webkit/__openerp__.py'
--- purchase_order_webkit/__openerp__.py 2014-02-21 13:18:22 +0000
+++ purchase_order_webkit/__openerp__.py 2014-04-16 07:56:18 +0000
@@ -39,7 +39,8 @@
'author': 'Camptocamp',
'website': 'http://www.camptocamp.com',
'depends': ['base', 'report_webkit', 'base_headers_webkit', 'purchase'],
- 'data': ['purchase_report.xml'],
+ 'data': ['purchase_report.xml',
+ 'view/purchase_view.xml'],
'test': [],
'installable': True,
'active': False,
=== modified file 'purchase_order_webkit/report/request_quotation.mako'
--- purchase_order_webkit/report/request_quotation.mako 2014-04-07 16:11:22 +0000
+++ purchase_order_webkit/report/request_quotation.mako 2014-04-16 07:56:18 +0000
@@ -267,23 +267,23 @@
<h3 style="clear:both; padding-top: 20px;">${_("Request for Quotation:")} ${purch.name}</h3>
<table class="list_main_table" width="100%" >
<thead>
- <tr>
+ <tr>
<th class="list_main_headers" style="width: 100%">
<table style="width:100%">
+ <tr>
<th class="main_col1">${_("Description")}</th>
<th class="main_col3">${_("Expected Date")}</th>
<th style="text-align:center" class="amount main_col4">${_("Qty")}</th>
</tr>
</table>
</th>
- </tr>
+ </tr>
</thead>
<tbody>
<tr>
<td class="list_main_lines" style="width: 100%">
<div class="nobreak">
<table style="width:100%">
- <tr>
%for line in purch.order_line :
<tr class="line">
<td class="main_col1">${line.name.replace('\n','<br/>') or '' | n}</td>
=== added directory 'purchase_order_webkit/view'
=== added file 'purchase_order_webkit/view/purchase_view.xml'
--- purchase_order_webkit/view/purchase_view.xml 1970-01-01 00:00:00 +0000
+++ purchase_order_webkit/view/purchase_view.xml 2014-04-16 07:56:18 +0000
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<openerp>
+ <data>
+
+ <record model="ir.ui.view" id="purchase_order_form_over">
+ <field name="name">purchase.order.form.add.notes</field>
+ <field name="model">purchase.order</field>
+ <field name="inherit_id" ref="purchase.purchase_order_form"/>
+ <field name="arch" type="xml">
+ <xpath expr="//button[@name='print_quotation'][last()]" position="after">
+ <button name="print_purchase" string="Print" type="object" states="approved,except_picking,except_invoice" groups="base.group_user"/>
+ </xpath>
+ </field>
+ </record>
+
+ </data>
+</openerp>
=== modified file 'purchase_order_webkit_with_notes/purchase_order.py'
--- purchase_order_webkit_with_notes/purchase_order.py 2013-12-19 10:16:53 +0000
+++ purchase_order_webkit_with_notes/purchase_order.py 2014-04-16 07:56:18 +0000
@@ -87,6 +87,21 @@
'form': self.read(cr, uid, ids[0], context=context),
}
return {'type': 'ir.actions.report.xml',
+ 'report_name': 'purchase.quotation.webkit',
+ 'datas': datas,
+ 'nodestroy': True}
+
+ def print_purchase(self, cr, uid, ids, context=None):
+ """
+ This function prints the purchase order and mark it as sent,
+ so that we can see more easily the next step of the workflow
+ """
+ datas = {'model': 'purchase.order',
+ 'ids': ids,
+ 'form': self.read(cr, uid, ids[0], context=context),
+ }
+ return {'type': 'ir.actions.report.xml',
'report_name': 'purchase.order.webkit',
'datas': datas,
'nodestroy': True}
+
=== modified file 'purchase_order_webkit_with_notes/report/request_quotation.mako'
--- purchase_order_webkit_with_notes/report/request_quotation.mako 2014-04-07 16:14:25 +0000
+++ purchase_order_webkit_with_notes/report/request_quotation.mako 2014-04-16 07:56:18 +0000
@@ -273,6 +273,7 @@
<tr>
<th class="list_main_headers" style="width: 100%">
<table style="width:100%">
+ <tr>
<th class="main_col1">${_("Description")}</th>
<th class="main_col3">${_("Expected Date")}</th>
<th style="text-align:center" class="amount main_col4">${_("Qty")}</th>
=== modified file 'purchase_order_webkit_with_notes/view/purchase_view.xml'
--- purchase_order_webkit_with_notes/view/purchase_view.xml 2014-01-13 08:54:55 +0000
+++ purchase_order_webkit_with_notes/view/purchase_view.xml 2014-04-16 07:56:18 +0000
@@ -50,6 +50,9 @@
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_form"/>
<field name="arch" type="xml">
+ <xpath expr="//button[@name='print_quotation'][last()]" position="after">
+ <button name="print_purchase" string="Print" type="object" states="approved,except_picking,except_invoice" groups="base.group_user"/>
+ </xpath>
<xpath expr="//page[last()]" position="after">
<page string="Conditions">
<group>
Follow ups