Merge lp:~pedro.baeza/purchase-wkfl/7.0-purchase_discount into lp:~purchase-core-editors/purchase-wkfl/7.0

Proposed by Pedro Manuel Baeza
Status: Merged
Merged at revision: 38
Proposed branch: lp:~pedro.baeza/purchase-wkfl/7.0-purchase_discount
Merge into: lp:~purchase-core-editors/purchase-wkfl/7.0
Diff against target: 867 lines (+806/-0)
11 files modified
purchase_discount/__init__.py (+21/-0)
purchase_discount/__openerp__.py (+52/-0)
purchase_discount/i18n/es.po (+43/-0)
purchase_discount/i18n/es_ES.po (+43/-0)
purchase_discount/i18n/pt_BR.po (+43/-0)
purchase_discount/i18n/purchase_discount.pot (+42/-0)
purchase_discount/models/purchase_discount.py (+135/-0)
purchase_discount/report/order.rml (+365/-0)
purchase_discount/report/purchase_discount_report.xml (+11/-0)
purchase_discount/views/account_invoice_view.xml (+16/-0)
purchase_discount/views/purchase_discount_view.xml (+35/-0)
To merge this branch: bzr merge lp:~pedro.baeza/purchase-wkfl/7.0-purchase_discount
Reviewer Review Type Date Requested Status
Guewen Baconnier @ Camptocamp code review Approve
Lorenzo Battistini (community) code review Approve
Omar (Pexego) code review no test Approve
Review via email: mp+217030@code.launchpad.net

Description of the change

[ADD] purchase_discount: Module that I ported some time ago to v7 and included in vauxoo-addons. I think this module deserves to be in OCA repositories to have a "standard" way for this common need.

To post a comment you must log in.
32. By Pedro Manuel Baeza

[FIX] purchase_discount: Supplier invoice view with discount

Revision history for this message
Lorenzo Battistini (elbati) wrote :
Download full text (3.3 KiB)

Thanks Pedro,

line 349: I think discount should not be < -100 too
line 399: amount_untaxed and following fields are present 2 times

some PEP8:

purchase_discount/__openerp__.py:21:1: O603 Manifest "license" key is missing
purchase_discount/__openerp__.py:29:5: O600 Warning unknown Manifest key ('contributors')
purchase_discount/__openerp__.py:43:5: O600 Warning unknown Manifest key ('active')
purchase_discount/purchase_discount.py:21:1: O603 Manifest "license" key is missing
purchase_discount/purchase_discount.py:24:1: E302 expected 2 blank lines, found 1
purchase_discount/purchase_discount.py:29:5: O600 Warning unknown Manifest key ('contributors')
purchase_discount/purchase_discount.py:35:75: W291 trailing whitespace
purchase_discount/purchase_discount.py:43:5: O600 Warning unknown Manifest key ('active')
purchase_discount/purchase_discount.py:43:75: W291 trailing whitespace
purchase_discount/purchase_discount.py:44:33: E128 continuation line under-indented for visual indent
purchase_discount/purchase_discount.py:52:56: W291 trailing whitespace
purchase_discount/purchase_discount.py:86:29: E127 continuation line over-indented for visual indent
purchase_discount/purchase_discount.py:103:13: E128 continuation line under-indented for visual indent
purchase_discount/purchase_discount.py:104:13: E128 continuation line under-indented for visual indent
purchase_discount/purchase_discount.py:105:13: E128 continuation line under-indented for visual indent
purchase_discount/purchase_discount.py:109:13: E128 continuation line under-indented for visual indent
purchase_discount/purchase_discount.py:110:13: E128 continuation line under-indented for visual indent
purchase_discount/purchase_discount.py:114:17: E128 continuation line under-indented for visual indent
purchase_discount/purchase_discount.py:115:13: E128 continuation line under-indented for visual indent
purchase_discount/purchase_discount.py:118:55: W291 trailing whitespace
purchase_discount/purchase_discount.py:119:13: E128 continuation line under-indented for visual indent
purchase_discount/purchase_discount.py:119:28: E251 unexpected spaces around keyword / parameter equals
purchase_discount/purchase_discount.py:119:57: W291 trailing whitespace
purchase_discount/purchase_discount.py:120:13: E128 continuation line under-indented for visual indent
purchase_discount/purchase_discount.py:121:13: E128 continuation line under-indented for visual indent
purchase_discount/purchase_discount.py:123:60: W291 trailing whitespace
purchase_discount/purchase_discount.py:125:51: W291 trailing whitespace
purchase_discount/purchase_discount.py:126:13: E128 continuation line under-indented for visual indent
purchase_discount/purchase_discount.py:126:28: E251 unexpected spaces around keyword / parameter equals
purchase_discount/purchase_discount.py:127:13: E128 continuation line under-indented for visual indent
purchase_discount/purchase_discount.py:130:53: W291 trailing whitespace
purchase_discount/purchase_discount.py:131:13: E128 continuation line under-indented for visual indent
purchase_discount/purchase_discount.py:131:28: E251 unexpected spaces around keyword / parameter equals
purchase_discount/purch...

Read more...

review: Needs Fixing
33. By Pedro Manuel Baeza

PEP8 errors corrected

Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Hi, Lorenzo, thanks for your review.

I have corrected flake8 output.

But about negative restriction in the percentage amount, I don't think it's a good idea, because you can apply a surcharge of whatever percentage you want: for example, -100% to double original price, -200% to triple it, and so on.

Regards.

Revision history for this message
Lorenzo Battistini (elbati) wrote :

Ok, thanks.

What about the
amount_untaxed, amount_tax, amount_total
fields repeated 2 times?

34. By Pedro Manuel Baeza

[FIX] Duplicated field definition.
[IMP] self.pool[] instead of self.pool.get

Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

You're right. I don't know how can I overpassed that!

I have corrected.

Thanks. Regards.

Revision history for this message
Omar (Pexego) (omar7r) wrote :

Thanks Pedro, I had long wanted to propose this module on the branch.

review: Approve (code review no test)
Revision history for this message
Lorenzo Battistini (elbati) :
review: Approve (code review)
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Hi,

I left some diff comments.
I'm also annoyed by the incompatibily introduced by this module (override of amount_all and amount_line), but on the other hand there is maybe no other way to do that.

Thanks Pedro

review: Needs Fixing
35. By Pedro Manuel Baeza

Some changes from Guewen's review

Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Hi, Guewen, thanks for the review.

I have fixed your remarks.

I don't like also to overwrite function fields methods, but I assure you that there's no other way for now. I'm going to propose a hook method for purchase line base price on core to see if we can improve this module for next version.

Regards.

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Great, thanks!

review: Approve (code review)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'purchase_discount'
2=== added file 'purchase_discount/__init__.py'
3--- purchase_discount/__init__.py 1970-01-01 00:00:00 +0000
4+++ purchase_discount/__init__.py 2014-06-20 10:14:35 +0000
5@@ -0,0 +1,21 @@
6+# -*- encoding: utf-8 -*-
7+##############################################################################
8+#
9+# OpenERP, Open Source Management Solution
10+# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
11+#
12+# This program is free software: you can redistribute it and/or modify
13+# it under the terms of the GNU Affero General Public License as
14+# published by the Free Software Foundation, either version 3 of the
15+# License, or (at your option) any later version.
16+#
17+# This program is distributed in the hope that it will be useful,
18+# but WITHOUT ANY WARRANTY; without even the implied warranty of
19+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20+# GNU Affero General Public License for more details.
21+#
22+# You should have received a copy of the GNU Affero General Public License
23+# along with this program. If not, see <http://www.gnu.org/licenses/>.
24+#
25+##############################################################################
26+from . import models
27
28=== added file 'purchase_discount/__openerp__.py'
29--- purchase_discount/__openerp__.py 1970-01-01 00:00:00 +0000
30+++ purchase_discount/__openerp__.py 2014-06-20 10:14:35 +0000
31@@ -0,0 +1,52 @@
32+# -*- encoding: utf-8 -*-
33+##############################################################################
34+#
35+# OpenERP, Open Source Management Solution
36+# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
37+#
38+# This program is free software: you can redistribute it and/or modify
39+# it under the terms of the GNU Affero General Public License as
40+# published by the Free Software Foundation, either version 3 of the
41+# License, or (at your option) any later version.
42+#
43+# This program is distributed in the hope that it will be useful,
44+# but WITHOUT ANY WARRANTY; without even the implied warranty of
45+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
46+# GNU Affero General Public License for more details.
47+#
48+# You should have received a copy of the GNU Affero General Public License
49+# along with this program. If not, see <http://www.gnu.org/licenses/>.
50+#
51+##############################################################################
52+{
53+ "name": "Purchase order lines with discounts",
54+ "author": "Tiny, Acysos S.L.",
55+ "description": """
56+It allows to define a discount per line in the purchase
57+orders. This discount can be also negative, interpreting it as an increment.
58+
59+**REMARK**: This module can be incompatible with other modules that modify
60+purchase prices, because it overwrites computation methods.
61+
62+**Contributors**:
63+ * Pedro Manuel Baeza <pedro.baeza@serviciosbaeza.com>
64+ """,
65+ "version": "1.0",
66+ "contributors": [
67+ 'Pedro M. Baeza',
68+ ],
69+ "category": "Generic Modules/Sales & Purchases",
70+ "depends": [
71+ "stock",
72+ "purchase",
73+ ],
74+ "demo": [],
75+ "data": [
76+ "purchase_discount_view.xml",
77+ "account_invoice_view.xml",
78+ "report/purchase_discount_report.xml",
79+ ],
80+ "license": 'AGPL-3',
81+ "installable": True
82+}
83+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
84
85=== added directory 'purchase_discount/i18n'
86=== added file 'purchase_discount/i18n/es.po'
87--- purchase_discount/i18n/es.po 1970-01-01 00:00:00 +0000
88+++ purchase_discount/i18n/es.po 2014-06-20 10:14:35 +0000
89@@ -0,0 +1,43 @@
90+# Translation of OpenERP Server.
91+# This file contains the translation of the following modules:
92+# * purchase_discount
93+#
94+msgid ""
95+msgstr ""
96+"Project-Id-Version: OpenERP Server 5.0.11\n"
97+"Report-Msgid-Bugs-To: support@openerp.com\n"
98+"POT-Creation-Date: 2013-11-07 01:07+0000\n"
99+"PO-Revision-Date: 2013-11-08 17:57+0000\n"
100+"Last-Translator: hbto [Vauxoo] http://www.vauxoo.com "
101+"<humbertoarocha@gmail.com>\n"
102+"Language-Team: \n"
103+"MIME-Version: 1.0\n"
104+"Content-Type: text/plain; charset=UTF-8\n"
105+"Content-Transfer-Encoding: 8bit\n"
106+"X-Launchpad-Export-Date: 2014-01-29 06:04+0000\n"
107+"X-Generator: Launchpad (build 16916)\n"
108+
109+#. module: purchase_discount
110+#: model:ir.model,name:purchase_discount.model_purchase_order
111+msgid "Purchase Order"
112+msgstr "Orden de Compra"
113+
114+#. module: purchase_discount
115+#: model:ir.model,name:purchase_discount.model_stock_picking
116+msgid "Picking List"
117+msgstr "Albarán"
118+
119+#. module: purchase_discount
120+#: sql_constraint:purchase.order.line:0
121+msgid "Discount must be lower than 100%."
122+msgstr "El desduento debe ser menor al 100%."
123+
124+#. module: purchase_discount
125+#: model:ir.model,name:purchase_discount.model_purchase_order_line
126+msgid "Purchase Order Line"
127+msgstr "Línea orden de compra"
128+
129+#. module: purchase_discount
130+#: field:purchase.order.line,discount:0
131+msgid "Discount (%)"
132+msgstr "(%) Descuento"
133
134=== added file 'purchase_discount/i18n/es_ES.po'
135--- purchase_discount/i18n/es_ES.po 1970-01-01 00:00:00 +0000
136+++ purchase_discount/i18n/es_ES.po 2014-06-20 10:14:35 +0000
137@@ -0,0 +1,43 @@
138+# Translation of OpenERP Server.
139+# This file contains the translation of the following modules:
140+# * purchase_discount
141+#
142+msgid ""
143+msgstr ""
144+"Project-Id-Version: OpenERP Server 5.0.11\n"
145+"Report-Msgid-Bugs-To: support@openerp.com\n"
146+"POT-Creation-Date: 2013-11-07 01:07+0000\n"
147+"PO-Revision-Date: 2013-11-07 04:36+0000\n"
148+"Last-Translator: Moisés López - http://www.vauxoo.com "
149+"<moylop260@vauxoo.com>\n"
150+"Language-Team: \n"
151+"MIME-Version: 1.0\n"
152+"Content-Type: text/plain; charset=UTF-8\n"
153+"Content-Transfer-Encoding: 8bit\n"
154+"X-Launchpad-Export-Date: 2014-01-29 06:04+0000\n"
155+"X-Generator: Launchpad (build 16916)\n"
156+
157+#. module: purchase_discount
158+#: model:ir.model,name:purchase_discount.model_purchase_order
159+msgid "Purchase Order"
160+msgstr ""
161+
162+#. module: purchase_discount
163+#: model:ir.model,name:purchase_discount.model_stock_picking
164+msgid "Picking List"
165+msgstr ""
166+
167+#. module: purchase_discount
168+#: sql_constraint:purchase.order.line:0
169+msgid "Discount must be lower than 100%."
170+msgstr ""
171+
172+#. module: purchase_discount
173+#: model:ir.model,name:purchase_discount.model_purchase_order_line
174+msgid "Purchase Order Line"
175+msgstr ""
176+
177+#. module: purchase_discount
178+#: field:purchase.order.line,discount:0
179+msgid "Discount (%)"
180+msgstr "(%) Descuento"
181
182=== added file 'purchase_discount/i18n/pt_BR.po'
183--- purchase_discount/i18n/pt_BR.po 1970-01-01 00:00:00 +0000
184+++ purchase_discount/i18n/pt_BR.po 2014-06-20 10:14:35 +0000
185@@ -0,0 +1,43 @@
186+# Brazilian Portuguese translation for addons-vauxoo
187+# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013
188+# This file is distributed under the same license as the addons-vauxoo package.
189+# FIRST AUTHOR <EMAIL@ADDRESS>, 2013.
190+#
191+msgid ""
192+msgstr ""
193+"Project-Id-Version: addons-vauxoo\n"
194+"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
195+"POT-Creation-Date: 2013-11-07 01:07+0000\n"
196+"PO-Revision-Date: 2013-07-28 13:28+0000\n"
197+"Last-Translator: Claudio de Araujo Santos <claudioaraujosantos@gmail.com>\n"
198+"Language-Team: Brazilian Portuguese <pt_BR@li.org>\n"
199+"MIME-Version: 1.0\n"
200+"Content-Type: text/plain; charset=UTF-8\n"
201+"Content-Transfer-Encoding: 8bit\n"
202+"X-Launchpad-Export-Date: 2014-01-29 06:04+0000\n"
203+"X-Generator: Launchpad (build 16916)\n"
204+
205+#. module: purchase_discount
206+#: model:ir.model,name:purchase_discount.model_purchase_order
207+msgid "Purchase Order"
208+msgstr "Ordem de Compra"
209+
210+#. module: purchase_discount
211+#: model:ir.model,name:purchase_discount.model_stock_picking
212+msgid "Picking List"
213+msgstr ""
214+
215+#. module: purchase_discount
216+#: sql_constraint:purchase.order.line:0
217+msgid "Discount must be lower than 100%."
218+msgstr ""
219+
220+#. module: purchase_discount
221+#: model:ir.model,name:purchase_discount.model_purchase_order_line
222+msgid "Purchase Order Line"
223+msgstr ""
224+
225+#. module: purchase_discount
226+#: field:purchase.order.line,discount:0
227+msgid "Discount (%)"
228+msgstr "Desconto (%)"
229
230=== added file 'purchase_discount/i18n/purchase_discount.pot'
231--- purchase_discount/i18n/purchase_discount.pot 1970-01-01 00:00:00 +0000
232+++ purchase_discount/i18n/purchase_discount.pot 2014-06-20 10:14:35 +0000
233@@ -0,0 +1,42 @@
234+# Translation of OpenERP Server.
235+# This file contains the translation of the following modules:
236+# * purchase_discount
237+#
238+msgid ""
239+msgstr ""
240+"Project-Id-Version: OpenERP Server 7.0\n"
241+"Report-Msgid-Bugs-To: \n"
242+"POT-Creation-Date: 2013-11-07 01:07+0000\n"
243+"PO-Revision-Date: 2013-11-07 01:07+0000\n"
244+"Last-Translator: <>\n"
245+"Language-Team: \n"
246+"MIME-Version: 1.0\n"
247+"Content-Type: text/plain; charset=UTF-8\n"
248+"Content-Transfer-Encoding: \n"
249+"Plural-Forms: \n"
250+
251+#. module: purchase_discount
252+#: model:ir.model,name:purchase_discount.model_purchase_order
253+msgid "Purchase Order"
254+msgstr ""
255+
256+#. module: purchase_discount
257+#: model:ir.model,name:purchase_discount.model_stock_picking
258+msgid "Picking List"
259+msgstr ""
260+
261+#. module: purchase_discount
262+#: sql_constraint:purchase.order.line:0
263+msgid "Discount must be lower than 100%."
264+msgstr ""
265+
266+#. module: purchase_discount
267+#: model:ir.model,name:purchase_discount.model_purchase_order_line
268+msgid "Purchase Order Line"
269+msgstr ""
270+
271+#. module: purchase_discount
272+#: field:purchase.order.line,discount:0
273+msgid "Discount (%)"
274+msgstr ""
275+
276
277=== added directory 'purchase_discount/models'
278=== added file 'purchase_discount/models/purchase_discount.py'
279--- purchase_discount/models/purchase_discount.py 1970-01-01 00:00:00 +0000
280+++ purchase_discount/models/purchase_discount.py 2014-06-20 10:14:35 +0000
281@@ -0,0 +1,135 @@
282+# -*- encoding: utf-8 -*-
283+##############################################################################
284+#
285+# OpenERP, Open Source Management Solution
286+# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
287+#
288+# This program is free software: you can redistribute it and/or modify
289+# it under the terms of the GNU Affero General Public License as
290+# published by the Free Software Foundation, either version 3 of the
291+# License, or (at your option) any later version.
292+#
293+# This program is distributed in the hope that it will be useful,
294+# but WITHOUT ANY WARRANTY; without even the implied warranty of
295+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
296+# GNU Affero General Public License for more details.
297+#
298+# You should have received a copy of the GNU Affero General Public License
299+# along with this program. If not, see <http://www.gnu.org/licenses/>.
300+#
301+##############################################################################
302+from openerp.osv import fields, orm
303+import openerp.addons.decimal_precision as dp
304+
305+
306+class PurchaseOrderLine(orm.Model):
307+ _inherit = "purchase.order.line"
308+
309+ def _amount_line(self, cr, uid, ids, field_name, arg, context=None):
310+ res = {}
311+ cur_obj = self.pool['res.currency']
312+ tax_obj = self.pool['account.tax']
313+ for line in self.browse(cr, uid, ids, context=context):
314+ discount = line.discount or 0.0
315+ new_price_unit = line.price_unit * (1 - discount / 100.0)
316+ taxes = tax_obj.compute_all(cr, uid, line.taxes_id, new_price_unit,
317+ line.product_qty, line.product_id,
318+ line.order_id.partner_id)
319+ currency = line.order_id.pricelist_id.currency_id
320+ res[line.id] = cur_obj.round(cr, uid, currency, taxes['total'])
321+ return res
322+
323+ _columns = {
324+ 'discount': fields.float('Discount (%)', dp.get_precision('Discount'),
325+ 'price_subtotal': fields.function(
326+ _amount_line, string='Subtotal',
327+ digits_compute=dp.get_precision('Account')),
328+ }
329+
330+ _defaults = {
331+ 'discount': 0.0,
332+ }
333+
334+ _sql_constraints = [
335+ ('discount_limit', 'CHECK (discount <= 100.0)',
336+ 'Discount must be lower than 100%.'),
337+ ]
338+
339+
340+class PurchaseOrder(orm.Model):
341+ _inherit = "purchase.order"
342+
343+ def _amount_all(self, cr, uid, ids, field_name, arg, context=None):
344+ res = {}
345+ cur_obj = self.pool['res.currency']
346+ tax_obj = self.pool['account.tax']
347+ for order in self.browse(cr, uid, ids, context=context):
348+ val = {}
349+ amount_taxed = amount_untaxed = 0.0
350+ currency = order.pricelist_id.currency_id
351+ for line in order.order_line:
352+ amount_untaxed += line.price_subtotal
353+ discount = line.discount or 0.0
354+ new_price_unit = line.price_unit * (1 - discount / 100.0)
355+ for c in tax_obj.compute_all(cr, uid, line.taxes_id,
356+ new_price_unit,
357+ line.product_qty,
358+ line.product_id.id,
359+ order.partner_id)['taxes']:
360+ amount_taxed += c.get('amount', 0.0)
361+ val['amount_tax'] = cur_obj.round(cr, uid, currency, amount_taxed)
362+ val['amount_untaxed'] = cur_obj.round(cr, uid, currency,
363+ amount_untaxed)
364+ val['amount_total'] = (val['amount_untaxed'] + val['amount_tax'])
365+ res[order.id] = val
366+ return res
367+
368+ def _prepare_inv_line(self, cr, uid, account_id, order_line,
369+ context=None):
370+ result = super(PurchaseOrder, self)._prepare_inv_line(cr, uid,
371+ account_id,
372+ order_line,
373+ context)
374+ result['discount'] = order_line.discount or 0.0
375+ return result
376+
377+ def _get_order(self, cr, uid, ids, context=None):
378+ result = set()
379+ po_line_obj = self.pool['purchase.order.line']
380+ for line in po_line_obj.browse(cr, uid, ids, context=context):
381+ result.add(line.order_id.id)
382+ return list(result)
383+
384+ _columns = {
385+ 'amount_untaxed': fields.function(
386+ _amount_all, digits_compute=dp.get_precision('Account'),
387+ string='Untaxed Amount',
388+ store={
389+ 'purchase.order.line': (_get_order, None, 10),
390+ }, multi="sums", help="The amount without tax"),
391+ 'amount_tax': fields.function(
392+ _amount_all, digits_compute=dp.get_precision('Account'),
393+ string='Taxes',
394+ store={
395+ 'purchase.order.line': (_get_order, None, 10),
396+ }, multi="sums", help="The tax amount"),
397+ 'amount_total': fields.function(
398+ _amount_all, digits_compute=dp.get_precision('Account'),
399+ string='Total',
400+ store={
401+ 'purchase.order.line': (_get_order, None, 10),
402+ }, multi="sums", help="The total amount"),
403+ }
404+
405+
406+class StockPicking(orm.Model):
407+ _inherit = 'stock.picking'
408+
409+ def _invoice_line_hook(self, cr, uid, move_line, invoice_line_id):
410+ if move_line.purchase_line_id:
411+ line = {'discount': move_line.purchase_line_id.discount}
412+ self.pool['account.invoice.line'].write(cr, uid,
413+ [invoice_line_id], line)
414+ return super(StockPicking, self)._invoice_line_hook(cr, uid,
415+ move_line,
416+ invoice_line_id)
417
418=== added directory 'purchase_discount/report'
419=== added file 'purchase_discount/report/order.rml'
420--- purchase_discount/report/order.rml 1970-01-01 00:00:00 +0000
421+++ purchase_discount/report/order.rml 2014-06-20 10:14:35 +0000
422@@ -0,0 +1,365 @@
423+<?xml version="1.0"?>
424+<document filename="test.pdf">
425+ <template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
426+ <pageTemplate id="first">
427+ <frame id="first" x1="18.0" y1="42.0" width="535" height="758"/>
428+ </pageTemplate>
429+ </template>
430+ <stylesheet>
431+ <blockTableStyle id="Standard_Outline">
432+ <blockAlignment value="LEFT"/>
433+ <blockValign value="TOP"/>
434+ </blockTableStyle>
435+ <blockTableStyle id="Tableau1">
436+ <blockAlignment value="LEFT"/>
437+ <blockValign value="TOP"/>
438+ </blockTableStyle>
439+ <blockTableStyle id="Tableau2">
440+ <blockAlignment value="LEFT"/>
441+ <blockValign value="TOP"/>
442+ </blockTableStyle>
443+ <blockTableStyle id="Header_Order_Reference_Tbl">
444+ <blockAlignment value="LEFT"/>
445+ <blockValign value="TOP"/>
446+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
447+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
448+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
449+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
450+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
451+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
452+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
453+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
454+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
455+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
456+ <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
457+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
458+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
459+ </blockTableStyle>
460+ <blockTableStyle id="Content_Order_Reference_Table">
461+ <blockAlignment value="LEFT"/>
462+ <blockValign value="TOP"/>
463+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="0,0" stop="0,-1"/>
464+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="0,0" stop="0,0"/>
465+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
466+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="1,0" stop="1,-1"/>
467+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="1,0" stop="1,0"/>
468+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
469+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="2,0" stop="2,-1"/>
470+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="2,0" stop="2,0"/>
471+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
472+ <lineStyle kind="LINEBEFORE" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
473+ <lineStyle kind="LINEAFTER" colorName="#e6e6e6" start="3,0" stop="3,-1"/>
474+ <lineStyle kind="LINEABOVE" colorName="#e6e6e6" start="3,0" stop="3,0"/>
475+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
476+ </blockTableStyle>
477+ <blockTableStyle id="Table_Header_Pur_ord_Line">
478+ <blockAlignment value="LEFT"/>
479+ <blockValign value="TOP"/>
480+ <lineStyle kind="LINEBELOW" colorName="#000000" start="0,-1" stop="0,-1"/>
481+ <lineStyle kind="LINEBELOW" colorName="#000000" start="1,-1" stop="1,-1"/>
482+ <lineStyle kind="LINEBELOW" colorName="#000000" start="2,-1" stop="2,-1"/>
483+ <lineStyle kind="LINEBELOW" colorName="#000000" start="3,-1" stop="3,-1"/>
484+ <lineStyle kind="LINEBELOW" colorName="#000000" start="4,-1" stop="4,-1"/>
485+ <lineStyle kind="LINEBELOW" colorName="#000000" start="5,-1" stop="5,-1"/>
486+ <lineStyle kind="LINEBELOW" colorName="#000000" start="6,-1" stop="6,-1"/>
487+ </blockTableStyle>
488+ <blockTableStyle id="Table_Order_Pur_line_Content">
489+ <blockAlignment value="LEFT"/>
490+ <blockValign value="TOP"/>
491+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
492+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
493+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
494+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
495+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
496+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
497+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="6,-1" stop="6,-1"/>
498+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="0,-1" stop="0,-1"/>
499+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="1,-1" stop="1,-1"/>
500+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="2,-1" stop="2,-1"/>
501+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="3,-1" stop="3,-1"/>
502+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="4,-1" stop="4,-1"/>
503+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="5,-1" stop="5,-1"/>
504+ <lineStyle kind="LINEBELOW" colorName="#e6e6e6" start="6,-1" stop="6,-1"/>
505+ </blockTableStyle>
506+ <blockTableStyle id="Table_All_Total_Detail">
507+ <blockAlignment value="LEFT"/>
508+ <blockValign value="TOP"/>
509+ <lineStyle kind="LINEABOVE" colorName="#ffffff" start="0,0" stop="0,0"/>
510+ <lineStyle kind="LINEABOVE" colorName="#000000" start="1,0" stop="1,0"/>
511+ <lineStyle kind="LINEABOVE" colorName="#000000" start="2,0" stop="2,0"/>
512+ <lineStyle kind="LINEABOVE" colorName="#000000" start="1,2" stop="1,2"/>
513+ <lineStyle kind="LINEABOVE" colorName="#000000" start="2,2" stop="2,2"/>
514+ </blockTableStyle>
515+ <blockTableStyle id="Table_Outer_Notes">
516+ <blockAlignment value="LEFT"/>
517+ <blockValign value="TOP"/>
518+ </blockTableStyle>
519+ <initialize>
520+ <paraStyle name="all" alignment="justify"/>
521+ </initialize>
522+ <paraStyle name="Standard" fontName="Helvetica"/>
523+ <paraStyle name="Text body" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
524+ <paraStyle name="Header" fontName="Helvetica" fontSize="14.0" leading="17" spaceBefore="12.0" spaceAfter="6.0"/>
525+ <paraStyle name="List" fontName="Helvetica" spaceBefore="0.0" spaceAfter="6.0"/>
526+ <paraStyle name="Table Contents" fontName="Helvetica"/>
527+ <paraStyle name="Table Heading" fontName="Helvetica" alignment="CENTER"/>
528+ <paraStyle name="Caption" fontName="Helvetica" fontSize="12.0" leading="15" spaceBefore="6.0" spaceAfter="6.0"/>
529+ <paraStyle name="Index" fontName="Helvetica"/>
530+ <paraStyle name="Footer" fontName="Helvetica"/>
531+ <paraStyle name="Horizontal Line" fontName="Helvetica" fontSize="6.0" leading="8" spaceBefore="0.0" spaceAfter="14.0"/>
532+ <paraStyle name="terp_header" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
533+ <paraStyle name="Heading 9" fontName="Helvetica-Bold" fontSize="75%" leading="NaN" spaceBefore="12.0" spaceAfter="6.0"/>
534+ <paraStyle name="terp_tblheader_General" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
535+ <paraStyle name="terp_tblheader_Details" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="6.0" spaceAfter="6.0"/>
536+ <paraStyle name="terp_default_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
537+ <paraStyle name="terp_default_Bold_8" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
538+ <paraStyle name="terp_tblheader_General_Centre" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
539+ <paraStyle name="terp_tblheader_General_Right" fontName="Helvetica-Bold" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
540+ <paraStyle name="terp_tblheader_Details_Centre" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="6.0" spaceAfter="6.0"/>
541+ <paraStyle name="terp_tblheader_Details_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="6.0" spaceAfter="6.0"/>
542+ <paraStyle name="terp_default_Right_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
543+ <paraStyle name="terp_default_Centre_8" fontName="Helvetica" fontSize="8.0" leading="10" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
544+ <paraStyle name="terp_header_Right" fontName="Helvetica-Bold" fontSize="15.0" leading="19" alignment="LEFT" spaceBefore="12.0" spaceAfter="6.0"/>
545+ <paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="12.0" leading="15" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
546+ <paraStyle name="terp_default_address" fontName="Helvetica" fontSize="10.0" leading="13" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
547+ <paraStyle name="terp_default_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
548+ <paraStyle name="terp_default_Bold_9" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
549+ <paraStyle name="terp_default_Centre_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="CENTER" spaceBefore="0.0" spaceAfter="0.0"/>
550+ <paraStyle name="terp_default_Right_9" fontName="Helvetica" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
551+ <paraStyle name="terp_default_Bold_9_Right" fontName="Helvetica-Bold" fontSize="9.0" leading="11" alignment="RIGHT" spaceBefore="0.0" spaceAfter="0.0"/>
552+ <paraStyle name="terp_default_8_Italic" fontName="Helvetica-Oblique" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
553+ <paraStyle name="terp_default_2" fontName="Helvetica" fontSize="2.0" leading="3" alignment="LEFT" spaceBefore="0.0" spaceAfter="0.0"/>
554+ <images/>
555+ </stylesheet>
556+ <story>
557+ <para style="terp_default_8">[[repeatIn(objects,'o')]]</para>
558+ <para style="terp_default_8">[[ setLang(o.partner_id.lang) ]]</para>
559+ <para style="terp_default_9">
560+ <font color="white"> </font>
561+ </para>
562+ <blockTable colWidths="253.0,59.0,223.0" style="Tableau1">
563+ <tr>
564+ <td>
565+ <blockTable colWidths="253.0" style="Tableau2">
566+ <tr>
567+ <td>
568+ <para style="terp_default_9">
569+ <font color="white"> </font>
570+ </para>
571+ </td>
572+ </tr>
573+ <tr>
574+ <td>
575+ <para style="terp_default_9">[[ repeatIn(o.dest_address_id and [o.dest_address_id] or [],'addr') ]]</para>
576+ <para style="terp_default_Bold_9">Shipping address :</para>
577+ <para style="terp_default_9">[[ (o.dest_address_id and o.dest_address_id.name) or (o.warehouse_id and o.warehouse_id.name) or '']] </para>
578+ <para style="terp_default_9">[[ (o.dest_address_id and display_address(o.dest_address_id)) or (o.warehouse_id and display_address(o.warehouse_id.partner_address_id)) or '']]</para>
579+ </td>
580+ </tr>
581+ </blockTable>
582+ <para style="terp_default_9">
583+ <font color="white"> </font>
584+ </para>
585+ </td>
586+ <td>
587+ <para style="terp_default_9">
588+ <font color="white"> </font>
589+ </para>
590+ </td>
591+ <td>
592+ <para style="terp_default_9">[[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]] </para>
593+ <para style="terp_default_9">[[ o.partner_id and display_address(o.partner_id) ]] </para>
594+ <para style="terp_default_9">Tél. : [[ (o.partner_address_id and o.partner_address_id.phone) or removeParentNode('para') ]]</para>
595+ <para style="terp_default_9">Fax : [[ (o.partner_address_id and o.partner_address_id.fax) or removeParentNode('para') ]]</para>
596+ <para style="terp_default_9">TVA : [[ (o.partner_id and o.partner_id.vat) or removeParentNode('para') ]]</para>
597+ </td>
598+ </tr>
599+ </blockTable>
600+ <para style="terp_default_9">
601+ <font color="white"> </font>
602+ </para>
603+ <para style="terp_header">[[ o.state=='draft' and removeParentNode('para') ]] Purchase Order Confirmation N° [[ o.name ]]</para>
604+ <para style="terp_header">[[ o.state&lt;&gt;'draft' and removeParentNode('para') ]] Request for Quotation N° [[ o.name ]]</para>
605+ <para style="terp_default_8">
606+ <font color="white"> </font>
607+ </para>
608+ <blockTable colWidths="136.0,132.0,133.0,133.0" style="Header_Order_Reference_Tbl">
609+ <tr>
610+ <td>
611+ <para style="terp_tblheader_General_Centre">Our Order Reference</para>
612+ </td>
613+ <td>
614+ <para style="terp_tblheader_General_Centre">Your Order Reference</para>
615+ </td>
616+ <td>
617+ <para style="terp_tblheader_General_Centre">Order Date</para>
618+ </td>
619+ <td>
620+ <para style="terp_tblheader_General_Centre">Validated By</para>
621+ </td>
622+ </tr>
623+ </blockTable>
624+ <blockTable colWidths="136.0,132.0,133.0,133.0" style="Content_Order_Reference_Table">
625+ <tr>
626+ <td>
627+ <para style="terp_default_Centre_8">[[ o.name or '' ]]</para>
628+ </td>
629+ <td>
630+ <para style="terp_default_Centre_8">[[ o.partner_ref or '' ]]</para>
631+ </td>
632+ <td>
633+ <para style="terp_default_Centre_8">[[formatLang(o.date_order,date=True) ]]</para>
634+ </td>
635+ <td>
636+ <para style="terp_default_Centre_8">[[ (o.validator and o.validator.name) or '' ]]</para>
637+ </td>
638+ </tr>
639+ </blockTable>
640+ <para style="terp_default_9">
641+ <font color="white"> </font>
642+ </para>
643+ <blockTable colWidths="163.0,77.0,64.0,64.0,51.0,54.0,61.0" repeatRows="1" style="Table_Header_Pur_ord_Line">
644+ <tr>
645+ <td>
646+ <para style="terp_tblheader_Details">Description</para>
647+ </td>
648+ <td>
649+ <para style="terp_tblheader_Details">Taxes</para>
650+ </td>
651+ <td>
652+ <para style="terp_tblheader_Details_Centre">Date Req.</para>
653+ </td>
654+ <td>
655+ <para style="terp_tblheader_Details_Centre">Qty</para>
656+ </td>
657+ <td>
658+ <para style="terp_tblheader_Details_Right">Unit Price</para>
659+ </td>
660+ <td>
661+ <para style="terp_tblheader_Details_Right">% Discount</para>
662+ </td>
663+ <td>
664+ <para style="terp_tblheader_Details_Right">Net Price</para>
665+ </td>
666+ </tr>
667+ </blockTable>
668+ <section>
669+ <para style="terp_default_8">[[repeatIn(o.order_line,'line')]]</para>
670+ <blockTable colWidths="162.0,77.0,64.0,64.0,51.0,54.0,61.0" style="Table_Order_Pur_line_Content">
671+ <tr>
672+ <td>
673+ <para style="terp_default_9">[[ line.name ]]</para>
674+ </td>
675+ <td>
676+ <para style="terp_default_9">[[ ', '.join(map(lambda x: x.name, line.taxes_id)) ]]</para>
677+ </td>
678+ <td>
679+ <para style="terp_default_Centre_9">[[ formatLang( line.date_planned, date=True) ]]</para>
680+ </td>
681+ <td>
682+ <para style="terp_default_Right_9">[[ formatLang(line.product_qty ) ]] [[ line.product_uom.name ]] </para>
683+ </td>
684+ <td>
685+ <para style="terp_default_Right_9">[[ formatLang(line.price_unit, digits=get_digits(dp='Account') ) ]]</para>
686+ </td>
687+ <td>
688+ <para style="terp_default_Right_9">[[ formatLang(line.discount, digits=get_digits(dp='Discount')) ]]</para>
689+ </td>
690+ <td>
691+ <para style="terp_default_Right_9">[[ formatLang(line.price_subtotal, digits=get_digits(dp='Account') ) ]] [[ o.pricelist_id.currency_id.symbol ]]</para>
692+ </td>
693+ </tr>
694+ <tr>
695+ <td>
696+ <para style="terp_default_8_Italic">[[ line.notes or removeParentNode('tr') ]]</para>
697+ </td>
698+ <td>
699+ <para style="terp_default_9">
700+ <font color="white"> </font>
701+ </para>
702+ </td>
703+ <td>
704+ <para style="terp_default_Centre_9">
705+ <font color="white"> </font>
706+ </para>
707+ </td>
708+ <td>
709+ <para style="terp_default_Right_9">
710+ <font color="white"> </font>
711+ </para>
712+ </td>
713+ <td>
714+ <para style="terp_default_Right_9">
715+ <font color="white"> </font>
716+ </para>
717+ </td>
718+ <td>
719+ <para style="terp_default_Right_9">
720+ <font color="white"> </font>
721+ </para>
722+ </td>
723+ <td>
724+ <para style="terp_default_Right_9">
725+ <font color="white"> </font>
726+ </para>
727+ </td>
728+ </tr>
729+ </blockTable>
730+ </section>
731+ <blockTable colWidths="394.0,55.0,85.0" style="Table_All_Total_Detail">
732+ <tr>
733+ <td>
734+ <para style="terp_default_9">
735+ <font color="white"> </font>
736+ </para>
737+ </td>
738+ <td>
739+ <para style="terp_default_9">Net Total :</para>
740+ </td>
741+ <td>
742+ <para style="terp_default_Right_9">[[ formatLang(o.amount_untaxed, digits=get_digits(dp='Account') ) ]] [[ o.pricelist_id.currency_id. symbol ]]</para>
743+ </td>
744+ </tr>
745+ <tr>
746+ <td>
747+ <para style="terp_default_9">
748+ <font color="white"> </font>
749+ </para>
750+ </td>
751+ <td>
752+ <para style="terp_default_9">Taxes :</para>
753+ </td>
754+ <td>
755+ <para style="terp_default_Right_9">[[ formatLang(o.amount_tax, digits=get_digits(dp='Account')) ]] [[ o.pricelist_id.currency_id. symbol ]]</para>
756+ </td>
757+ </tr>
758+ <tr>
759+ <td>
760+ <para style="terp_default_9">
761+ <font color="white"> </font>
762+ </para>
763+ </td>
764+ <td>
765+ <para style="terp_default_Bold_9">Total :</para>
766+ </td>
767+ <td>
768+ <para style="terp_default_Bold_9_Right">[[ formatLang(o.amount_total, digits=get_digits(dp='Account') ) ]] [[ o.pricelist_id.currency_id. symbol ]]</para>
769+ </td>
770+ </tr>
771+ </blockTable>
772+ <para style="terp_default_8">
773+ <font color="white"> </font>
774+ </para>
775+ <blockTable colWidths="535.0" style="Table_Outer_Notes">
776+ <tr>
777+ <td>
778+ <para style="terp_default_9">[[ format(o.notes or '') ]]</para>
779+ </td>
780+ </tr>
781+ </blockTable>
782+ <para style="terp_default_9">
783+ <font color="white"> </font>
784+ </para>
785+ </story>
786+</document>
787+
788
789=== added file 'purchase_discount/report/order.sxw'
790Binary files purchase_discount/report/order.sxw 1970-01-01 00:00:00 +0000 and purchase_discount/report/order.sxw 2014-06-20 10:14:35 +0000 differ
791=== added file 'purchase_discount/report/purchase_discount_report.xml'
792--- purchase_discount/report/purchase_discount_report.xml 1970-01-01 00:00:00 +0000
793+++ purchase_discount/report/purchase_discount_report.xml 2014-06-20 10:14:35 +0000
794@@ -0,0 +1,11 @@
795+<?xml version="1.0" encoding="utf-8"?>
796+<openerp>
797+ <data>
798+ <report id="purchase.report_purchase_order"
799+ name="purchase.order"
800+ string="Print Orders"
801+ model="purchase.order"
802+ rml="purchase_discount/report/order.rml"
803+ />
804+ </data>
805+</openerp>
806
807=== added directory 'purchase_discount/views'
808=== added file 'purchase_discount/views/account_invoice_view.xml'
809--- purchase_discount/views/account_invoice_view.xml 1970-01-01 00:00:00 +0000
810+++ purchase_discount/views/account_invoice_view.xml 2014-06-20 10:14:35 +0000
811@@ -0,0 +1,16 @@
812+<openerp>
813+<data>
814+
815+ <record id="invoice_supplier_form_discount" model="ir.ui.view">
816+ <field name="name">account.invoice.supplier.form.discount</field>
817+ <field name="model">account.invoice</field>
818+ <field name="inherit_id" ref="account.invoice_supplier_form"/>
819+ <field name="arch" type="xml">
820+ <field name="price_unit" position="after">
821+ <field name="discount"/>
822+ </field>
823+ </field>
824+ </record>
825+
826+</data>
827+</openerp>
828
829=== added file 'purchase_discount/views/purchase_discount_view.xml'
830--- purchase_discount/views/purchase_discount_view.xml 1970-01-01 00:00:00 +0000
831+++ purchase_discount/views/purchase_discount_view.xml 2014-06-20 10:14:35 +0000
832@@ -0,0 +1,35 @@
833+<openerp>
834+<data>
835+ <record model="ir.ui.view" id="purchase_discount_order_line_form">
836+ <field name="name">purchase_discount.order.line.form</field>
837+ <field name="model">purchase.order.line</field>
838+ <field name="inherit_id" ref="purchase.purchase_order_line_form"/>
839+ <field name="arch" type="xml">
840+ <field name="price_unit" position="after">
841+ <field name="discount"/>
842+ </field>
843+ </field>
844+ </record>
845+ <record model="ir.ui.view" id="purchase_discount_order_line_tree">
846+ <field name="name">purchase_discount.order.line.tree</field>
847+ <field name="model">purchase.order.line</field>
848+ <field name="inherit_id" ref="purchase.purchase_order_line_tree"/>
849+ <field name="arch" type="xml">
850+ <field name="price_unit" position="after">
851+ <field name="discount"/>
852+ </field>
853+ </field>
854+ </record>
855+
856+ <record model="ir.ui.view" id="purchase_discount_order_form">
857+ <field name="name">purchase.discount.order.form</field>
858+ <field name="model">purchase.order</field>
859+ <field name="inherit_id" ref="purchase.purchase_order_form"/>
860+ <field name="arch" type="xml">
861+ <xpath expr="//field[@name='order_line']/tree/field[@name='price_unit']" position="after">
862+ <field name="discount"/>
863+ </xpath>
864+ </field>
865+ </record>
866+</data>
867+</openerp>

Subscribers

People subscribed via source and target branches