Merge lp:~mikel-martin/purchase-wkfl/6.1-purchase_landed_costs into lp:~purchase-core-editors/purchase-wkfl/6.1

Proposed by mikel
Status: Merged
Merged at revision: 10
Proposed branch: lp:~mikel-martin/purchase-wkfl/6.1-purchase_landed_costs
Merge into: lp:~purchase-core-editors/purchase-wkfl/6.1
Diff against target: 1922 lines (+1863/-0)
11 files modified
purchase_landed_costs/__init__.py (+29/-0)
purchase_landed_costs/__openerp__.py (+53/-0)
purchase_landed_costs/i18n/de.po (+333/-0)
purchase_landed_costs/i18n/es.po (+337/-0)
purchase_landed_costs/i18n/purchase_landed_costs.pot (+320/-0)
purchase_landed_costs/product.py (+40/-0)
purchase_landed_costs/purchase.py (+298/-0)
purchase_landed_costs/purchase_view.xml (+104/-0)
purchase_landed_costs/security/ir.model.access.csv (+3/-0)
purchase_landed_costs/stock.py (+297/-0)
purchase_landed_costs/stock_view.xml (+49/-0)
To merge this branch: bzr merge lp:~mikel-martin/purchase-wkfl/6.1-purchase_landed_costs
Reviewer Review Type Date Requested Status
Joël Grand-Guillaume @ camptocamp code review, no tests Approve
Sandy Carter (http://www.savoirfairelinux.com) code review, no test Approve
Guewen Baconnier @ Camptocamp Needs Information
Review via email: mp+199587@code.launchpad.net

Description of the change

[ADD] purchase_landed_cost from c2c-rd-addons fixed

To post a comment you must log in.
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Hello, what do you mean by "purchase_landed_cost from c2c-rd-addons fixed"?
Is it an extraction of the module from c2c-rd-addons, with some fixes?
My concern is that there is only 1 revision, so we can't see what is part of the extraction and what are your fixes.

review: Needs Information
Revision history for this message
mikel (mikel-martin) wrote :

Yes, that is.

The costs were not properly calculated in the stock picking if there was more than one order line. This fix has already been done in the v7 of this module.

If you have a look at the MP in c2c-rd-addons https://code.launchpad.net/~mikel-martin/c2c-rd-addons/6.1/+merge/199583 you'll see the diff, it is quite clear what the problem was.

Revision history for this message
Sandy Carter (http://www.savoirfairelinux.com) (sandy-carter) wrote :

Lots of PEP8 issues to fix

osv.osv is depricated in 6.1, use orm.Model
functions that have context as a parameter need to start with:
    if context is None:
        context = dict()
Many browse calls should have context=context in their parameters, the same applies to other self calls which include context=None in their parameters

Code issues:
purchase_landed_costs/purchase.py:224:65: should be context=context

Minor code issues:
purchase_landed_costs/product.py:23:1: should be importing from openerp.osv
purchase_landed_costs/product.py:24:1: unused import
purchase_landed_costs/product.py:34:132: unnecessary backslash
purchase_landed_costs/product.py:41:131: unnecessary backslash
purchase_landed_costs/purchase.py:23:1: should be importing from openerp.osv
purchase_landed_costs/purchase.py:24:1: should be importing openerp.decimal_precision
purchase_landed_costs/purchase.py:25:1: unused import
purchase_landed_costs/purchase.py:229-236: could be a single statement (val = {'product_id': order_cost.product_id.id, ... }

Spelling:
purchase_landed_costs/stock.py 34:18: costss -> costs
purchase_landed_costs/stock.py 49:18: costss -> costs
purchase_landed_costs/stock.py:52:15: distrubution -> distribution
purchase_landed_costs/stock.py 65:18: costss -> costs
purchase_landed_costs/stock.py 124:18: costss -> costs
purchase_landed_costs/product.py:44:155: catgory -> category
purchase_landed_costs/purchase.py:68:18: costss -> costs
purchase_landed_costs/purchase.py:102:18: costss -> costs

review: Needs Fixing (code review, no test)
Revision history for this message
mikel (mikel-martin) wrote :

Thanks for your review.

Which tool do you use for the code review it would com in handy.

Revision history for this message
Sandy Carter (http://www.savoirfairelinux.com) (sandy-carter) wrote :

There isn't really a tool

pep8-python2 for pep8
pycharm for code inspection and spelling
the rest is by hand

11. By mikel <mikel@hide>

[FIX] Codign standards

12. By mikel <mikel@hide>

[FIX] Invoice unit price calculation from picking

Revision history for this message
mikel (mikel-martin) wrote :

Fixed the code issues

Revision history for this message
Sandy Carter (http://www.savoirfairelinux.com) (sandy-carter) wrote :

PEP8:
purchase_landed_costs/__init__.py:3:2: W291 trailing whitespace
purchase_landed_costs/__init__.py:19:75: W291 trailing whitespace

purchase_landed_costs/__openerp__.py:30:40: W291 trailing whitespace
purchase_landed_costs/__openerp__.py:42:27: E202 whitespace before ']'

purchase_landed_costs/product.py:19:13: E128 continuation line under-indented for visual indent
purchase_landed_costs/product.py:31:13: E128 continuation line under-indented for visual indent

purchase_landed_costs/purchase.py: 37 PEP8 errors
purchase_landed_costs/stock.py: 25 PEP8 errors

Code:
purchase_landed_costs/purchase.py 62:9: you have the same two lines twice
purchase_landed_costs/purchase.py 82:9: you have the same two lines twice
purchase_landed_costs/purchase.py 280:57: should be context=context
purchase_landed_costs/purchase.py 294:57: should be context=context

purchase_landed_costs/stock.py:20:21: missing context=context
purchase_landed_costs/stock.py:38:21: missing context=context
purchase_landed_costs/stock.py:40:15: distrubution -> distribution
purchase_landed_costs/stock.py:62:21: missing context=context
purchase_landed_costs/stock.py:73:21: missing context=context
purchase_landed_costs/stock.py:113:21: missing context=context
purchase_landed_costs/stock.py:128:21: missing context=context
purchase_landed_costs/stock.py 143:18: costss -> costs
purchase_landed_costs/stock.py:144:21: missing context=context
purchase_landed_costs/stock.py:159:21: missing context=context
purchase_landed_costs/stock.py:173:21: missing context=context
purchase_landed_costs/stock.py:188:21: missing context=context

review: Needs Fixing (code review, no test)
Revision history for this message
Graeme Gellatly (gdgellatly) wrote :

Hi sorry, I disagree with

> functions that have context as a parameter need to start with:
> if context is None:
> context = dict()

As per openerp coding guidelines this is not necessary if you are only passing context downstream and not accessing it anywhere in your function. Convention for some maybe, but not required and ultimately just adds unneeded LOC.

https://doc.openerp.com/6.0/contribute/15_guidelines/coding_guidelines_framework/#the-infamous-context

13. By mikel <mikel@hide>

[FIX] recalculate landed_cost in picking when landed_cost_line changes.
[FIX] unit_price_net calculation so that it takes into acount purchase_order_line discounts
[FIX] landed cost value distribution based
[FIX] Coding standard issues

Revision history for this message
mikel (mikel-martin) wrote :

Yet another try with some more fixes.

Revision history for this message
Sandy Carter (http://www.savoirfairelinux.com) (sandy-carter) wrote :

Still about 38 PEP8 errors, run the following command to see them all.
$ find purchase_landed_costs/ -name \*.py -exec pep8-python2 --show-source --ignore E501 {} \;
or
$ pep8-python2 --show-source --ignore E501 purchase_landed_costs/purchase.py
$ pep8-python2 --show-source --ignore E501 purchase_landed_costs/stock.py

review: Needs Fixing
14. By mikel <mikel@hide>

[FIX] landed costs per line calculation when the invoice method is picking

Revision history for this message
mikel (mikel-martin) wrote :

Yet another try.

Does anyone know why eclipse doesn't complain about E121 and E127?

I've configured eclipse to use pep8 in this way http://stackoverflow.com/questions/399956/how-to-integrate-pep8-py-in-eclipse/8532188#8532188

Revision history for this message
Sandy Carter (http://www.savoirfairelinux.com) (sandy-carter) wrote :

Your code passes my PEP8 check.

One more thing
purchase_landed_costs/stock.py:3:1: F401 'itemgetter' imported but unused

review: Approve (code review, no test)
Revision history for this message
Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c) wrote :

Hi,

Thanks for the contribution. I approve this MP's, but I'm also in-line with Guewen. You should have sued the extraction tools located here : https://launchpad.net/bazaar-extractor to replay the commit of this module in that branch. This way we don't lose all the commit. But well, as it is on a old 6.1 branch I think it's ok not to block this MP for that.

Note that I ported the same module and add some improvements for the 7.0 serie.

Regards,

Joël

review: Approve (code review, no tests)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added directory 'purchase_landed_costs'
=== added file 'purchase_landed_costs/__init__.py'
--- purchase_landed_costs/__init__.py 1970-01-01 00:00:00 +0000
+++ purchase_landed_costs/__init__.py 2014-01-08 21:27:15 +0000
@@ -0,0 +1,29 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
6# Copyright (C) 2010-2012 Camptocamp (<http://www.camptocamp.at>)
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as
10# published by the Free Software Foundation, either version 3 of the
11# License, or (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU Affero General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22
23
24import product
25import stock
26import purchase
27
28
29# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
030
=== added file 'purchase_landed_costs/__openerp__.py'
--- purchase_landed_costs/__openerp__.py 1970-01-01 00:00:00 +0000
+++ purchase_landed_costs/__openerp__.py 2014-01-08 21:27:15 +0000
@@ -0,0 +1,53 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# OpenERP, Open Source Management Solution
5# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
6# Copyright (C) 2010-2012 Camptocamp (<http://www.camptocamp.at>)
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU Affero General Public License as
10# published by the Free Software Foundation, either version 3 of the
11# License, or (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU Affero General Public License for more details.
17#
18# You should have received a copy of the GNU Affero General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20#
21##############################################################################
22
23
24{
25 'name': 'Landed Costs',
26 'version': '0.8',
27 'category': 'Warehouse Management',
28 'description': """
29 This module add the possibility to include landed costs in the average
30 price computation.
31 The landed costs can be defined for:
32 * purchase orders
33 * purchase order lines
34 * pickings
35 * picking lines (stock moves)
36 costs defined for purchase orders and pickings will be distributed
37 according to the distribution type
38 defined in landed cost category
39 * value - example custom fees
40 * quantity - example freight
41 """,
42 'author': 'Camptocamp',
43 'contributors': 'Mikel Martin <mikel@zhenit.com>',
44 'depends': ['purchase'],
45 'update_xml': ['security/ir.model.access.csv',
46 'purchase_view.xml',
47 'stock_view.xml',
48 ],
49 'demo_xml': [],
50 'installable': True,
51 'active': False,
52}
53# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
054
=== added directory 'purchase_landed_costs/i18n'
=== added file 'purchase_landed_costs/i18n/de.po'
--- purchase_landed_costs/i18n/de.po 1970-01-01 00:00:00 +0000
+++ purchase_landed_costs/i18n/de.po 2014-01-08 21:27:15 +0000
@@ -0,0 +1,333 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * purchase_landed_costs
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 6.1rc1\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2012-02-12 08:57+0000\n"
10"PO-Revision-Date: 2012-02-13 09:37+0000\n"
11"Last-Translator: Ferdinand @ Camptocamp <Unknown>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: 8bit\n"
16"X-Launchpad-Export-Date: 2013-08-18 04:56+0000\n"
17"X-Generator: Launchpad (build 16723)\n"
18
19#. module: purchase_landed_costs
20#: field:product.category,landed_cost:0 field:product.template,landed_cost:0
21msgid "Calculate Landed Costs"
22msgstr "Berechnete Einstandskosten"
23
24#. module: purchase_landed_costs
25#: sql_constraint:purchase.order:0
26msgid "Order Reference must be unique per Company!"
27msgstr "Bestellbezug muss je Unternehmen eindeutig sein!"
28
29#. module: purchase_landed_costs
30#: model:ir.model,name:purchase_landed_costs.model_purchase_order_line
31#: field:landed.cost.position,purchase_order_line_id:0
32msgid "Purchase Order Line"
33msgstr "Einkaufspositionen"
34
35#. module: purchase_landed_costs
36#: field:landed.cost.position,move_line_id:0
37msgid "Picking Line"
38msgstr "Lieferscheinzeile"
39
40#. module: purchase_landed_costs
41#: field:stock.move,sub_total:0
42msgid "Line Sub Total"
43msgstr "Zeile Teilsumme"
44
45#. module: purchase_landed_costs
46#: help:landed.cost.position,partner_id:0
47msgid "The supplier of this cost component ."
48msgstr "Der Lieferant dieser Kostenkomponente"
49
50#. module: purchase_landed_costs
51#: constraint:product.template:0
52msgid ""
53"Error: The default UOM and the purchase UOM must be in the same category."
54msgstr ""
55"Fehler: Die Standard Mengeneinheit (ME) sowie die Mengeneinheit (ME) bei der "
56"Beschaffung muss in derselben Kategorie sein."
57
58#. module: purchase_landed_costs
59#: constraint:stock.move:0
60msgid "You must assign a production lot for this product"
61msgstr "Sie müssen zwingend eine Losnummer für dieses Produkt angeben"
62
63#. module: purchase_landed_costs
64#: help:landed.cost.position,amount_currency:0
65msgid "The amount expressed in an optional other currency."
66msgstr "optionaler Betrag in anderer Währung"
67
68#. module: purchase_landed_costs
69#: help:product.template,landed_cost_type:0
70msgid ""
71"Used if this product is landed costs: If landed costs are defined for "
72"purchase orders or pickings, this indicates how the costs are distributed to "
73"the lines"
74msgstr ""
75"Aktivieren, wenn dieses Produkt als Bestellnebenkosten für die "
76"Durschnittspreisberechung verfügbar sein soll. Wenn die Nebenkosten für den "
77"Lieferschein definiert sind, gibt dies an, welcher Schüssel (Mengen, Wert) "
78"für die Verteilung verwendet werden soll."
79
80#. module: purchase_landed_costs
81#: selection:landed.cost.position,price_type:0
82msgid "Per Unit"
83msgstr "Je Einheit"
84
85#. module: purchase_landed_costs
86#: model:ir.model,name:purchase_landed_costs.model_stock_picking
87msgid "Picking List"
88msgstr "Lieferschein"
89
90#. module: purchase_landed_costs
91#: model:ir.model,name:purchase_landed_costs.model_landed_cost_position
92msgid "landed.cost.position"
93msgstr "landed.cost.position"
94
95#. module: purchase_landed_costs
96#: field:stock.move,landing_costs_picking:0
97msgid "Landing Costs from Picking"
98msgstr "Einstandsnebenkosten vom Lieferschien"
99
100#. module: purchase_landed_costs
101#: selection:landed.cost.position,price_type:0
102msgid "Absolute Value"
103msgstr "Absoluter Wert"
104
105#. module: purchase_landed_costs
106#: help:product.template,landed_cost:0
107msgid ""
108"Checck this if you want to use landed cost calculation for average price for "
109"this product"
110msgstr ""
111
112#. module: purchase_landed_costs
113#: field:purchase.order,landed_cost_line_ids:0
114#: field:purchase.order.line,landed_costs:0 field:stock.move,landed_cost:0
115msgid "Landed Costs"
116msgstr "Einstandskosten"
117
118#. module: purchase_landed_costs
119#: constraint:stock.move:0
120msgid "You try to assign a lot which is not from the same product"
121msgstr ""
122"Sie versuchen eine Losnummer ohne Bezug zu diesem Produkt zuzuweisen."
123
124#. module: purchase_landed_costs
125#: constraint:stock.move:0
126msgid "You can not move products from or to a location of the type view."
127msgstr "Sie können keine Buchungen auf Sichten machen"
128
129#. module: purchase_landed_costs
130#: view:landed.cost.position:0 view:purchase.order:0
131#: view:purchase.order.line:0 field:purchase.order.line,landing_costs:0
132#: view:stock.picking:0
133msgid "Landing Costs"
134msgstr "Einstandsnebenkosten"
135
136#. module: purchase_landed_costs
137#: model:ir.model,name:purchase_landed_costs.model_stock_partial_picking_line
138msgid "stock.partial.picking.line"
139msgstr "pstock.partial.picking.line"
140
141#. module: purchase_landed_costs
142#: field:purchase.order,quantity_total:0 field:stock.picking,quantity_total:0
143msgid "Total Quantity"
144msgstr "Gesamtmenge"
145
146#. module: purchase_landed_costs
147#: help:landed.cost.position,currency_id:0
148msgid "Optional other currency."
149msgstr "Optional andere Währung"
150
151#. module: purchase_landed_costs
152#: field:purchase.order,landed_cost_base_value:0
153#: field:stock.picking,landed_cost_base_value:0
154msgid "Landed Costs Base Value"
155msgstr "Einstandskosten Basis Wert"
156
157#. module: purchase_landed_costs
158#: field:landed.cost.position,picking_id:0
159msgid "Picking"
160msgstr "Lieferschein"
161
162#. module: purchase_landed_costs
163#: field:stock.picking,total_amount:0
164msgid "Total Product Price"
165msgstr "Gesamter Produktpreis"
166
167#. module: purchase_landed_costs
168#: field:stock.move,price_unit_net:0
169msgid "Purchase Price"
170msgstr "Kaufpreis"
171
172#. module: purchase_landed_costs
173#: field:purchase.order,landing_cost_lines:0
174#: field:stock.picking,landing_cost_lines:0
175msgid "Landing Cost Lines"
176msgstr "Einstandsnebenkostenzeilen"
177
178#. module: purchase_landed_costs
179#: constraint:stock.move:0
180msgid ""
181"Error: Negative quantities for location and/or lots are not allowed for this "
182"product or product category"
183msgstr "Fehler: negative Mengen sind für diesen Lagerort / Los nicht erlaubt"
184
185#. module: purchase_landed_costs
186#: selection:product.template,landed_cost_type:0
187msgid "None"
188msgstr "Keine"
189
190#. module: purchase_landed_costs
191#: field:product.template,landed_cost_type:0
192msgid "Distribution Type"
193msgstr "Verteilungsart"
194
195#. module: purchase_landed_costs
196#: model:ir.model,name:purchase_landed_costs.model_stock_partial_move
197msgid "Partial Move Processing Wizard"
198msgstr "Assistent für Teillieferungen"
199
200#. module: purchase_landed_costs
201#: view:stock.picking:0
202msgid "Notes"
203msgstr "Notizen"
204
205#. module: purchase_landed_costs
206#: field:landed.cost.position,currency_id:0
207msgid "Secondary Currency"
208msgstr "Alternative Währung"
209
210#. module: purchase_landed_costs
211#: selection:product.template,landed_cost_type:0
212msgid "Value"
213msgstr "Betrag"
214
215#. module: purchase_landed_costs
216#: model:ir.model,name:purchase_landed_costs.model_purchase_order
217#: field:landed.cost.position,purchase_order_id:0
218msgid "Purchase Order"
219msgstr "Einkaufsauftrag"
220
221#. module: purchase_landed_costs
222#: field:purchase.order.line,landed_cost_line_ids:0
223#: field:stock.move,landed_cost_line_ids:0
224#: field:stock.picking,landed_cost_line_ids:0
225msgid "Landed Costs Positions"
226msgstr "Nebenkostenpositionen"
227
228#. module: purchase_landed_costs
229#: field:purchase.order.line,landing_costs_order:0
230msgid "Landing Costs from Order"
231msgstr "Nebenkosten vom Einkaufsauftrag"
232
233#. module: purchase_landed_costs
234#: field:landed.cost.position,amount:0
235msgid "Amount"
236msgstr "Betrag"
237
238#. module: purchase_landed_costs
239#: model:ir.model,name:purchase_landed_costs.model_product_category
240msgid "Product Category"
241msgstr "Produktkategorie"
242
243#. module: purchase_landed_costs
244#: sql_constraint:stock.picking:0
245msgid "Reference must be unique per Company!"
246msgstr "Referenz muss je Unternehmen eindeutig sein"
247
248#. module: purchase_landed_costs
249#: model:ir.model,name:purchase_landed_costs.model_stock_partial_picking
250msgid "Partial Picking Processing Wizard"
251msgstr "Teillieferungsassistent"
252
253#. module: purchase_landed_costs
254#: help:landed.cost.position,price_type:0
255msgid ""
256"Defines if the amount is to be calculated for each quantity or an absolute "
257"value"
258msgstr ""
259"Definiert, ob der Wert je Mengeneinheit oder absolut gerechnet werden muss"
260
261#. module: purchase_landed_costs
262#: selection:product.template,landed_cost_type:0
263msgid "Quantity"
264msgstr "Menge"
265
266#. module: purchase_landed_costs
267#: field:landed.cost.position,product_id:0
268msgid "Landed Cost Name"
269msgstr "Nebenkosten Bezeichnung"
270
271#. module: purchase_landed_costs
272#: field:purchase.order,landed_cost_base_quantity:0
273#: field:stock.picking,landed_cost_base_quantity:0
274msgid "Landed Costs Base Quantity"
275msgstr "Nebenkosten - Megnenbasis"
276
277#. module: purchase_landed_costs
278#: help:product.category,landed_cost:0
279msgid ""
280"Checck this if you want to use landed cost calculation for average price for "
281"this catgory"
282msgstr ""
283"Aktivieren, wenn für diese Produktkategorie Einstandsnebenkosten berechnet "
284"werden sollen"
285
286#. module: purchase_landed_costs
287#: model:ir.model,name:purchase_landed_costs.model_product_template
288msgid "Product Template"
289msgstr "Produktvorlage"
290
291#. module: purchase_landed_costs
292#: model:ir.model,name:purchase_landed_costs.model_stock_move
293msgid "Stock Move"
294msgstr "Lagerbuchung"
295
296#. module: purchase_landed_costs
297#: constraint:product.category:0
298msgid "Error ! You cannot create recursive categories."
299msgstr "Fehler ! Sie dürfen keine rekurisven Kategorien anlegen."
300
301#. module: purchase_landed_costs
302#: field:landed.cost.position,amount_currency:0
303msgid "Amount Currency"
304msgstr "Währungsbetrag"
305
306#. module: purchase_landed_costs
307#: field:stock.move,landing_costs:0
308msgid "Line Landing Costs"
309msgstr "Nebenkosten Zeilen"
310
311#. module: purchase_landed_costs
312#: help:landed.cost.position,amount:0
313msgid ""
314"Landed cost for stock valuation. It will be added to the price of the "
315"supplier price."
316msgstr ""
317"Einstandskosten für die Produktbewertung. Diese werden zu dem Produktpreis "
318"hinzugerechnet."
319
320#. module: purchase_landed_costs
321#: field:landed.cost.position,partner_id:0
322msgid "Partner"
323msgstr "Partner"
324
325#. module: purchase_landed_costs
326#: field:purchase.order,landed_cost:0 field:stock.picking,landed_cost:0
327msgid "Landed Costs Total Untaxed"
328msgstr "EInstandspreise ohne Umsatzsteuer"
329
330#. module: purchase_landed_costs
331#: field:landed.cost.position,price_type:0
332msgid "Amount Type"
333msgstr "Berechnungsart"
0334
=== added file 'purchase_landed_costs/i18n/es.po'
--- purchase_landed_costs/i18n/es.po 1970-01-01 00:00:00 +0000
+++ purchase_landed_costs/i18n/es.po 2014-01-08 21:27:15 +0000
@@ -0,0 +1,337 @@
1# Spanish translation for c2c-rd-addons
2# Copyright (c) 2013 Rosetta Contributors and Canonical Ltd 2013
3# This file is distributed under the same license as the c2c-rd-addons package.
4# FIRST AUTHOR <EMAIL@ADDRESS>, 2013.
5#
6msgid ""
7msgstr ""
8"Project-Id-Version: c2c-rd-addons\n"
9"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
10"POT-Creation-Date: 2012-02-12 08:57+0000\n"
11"PO-Revision-Date: 2013-12-30 01:40+0100\n"
12"Last-Translator: Mikel Martin <mikel@ZhenIT.com>\n"
13"Language-Team: Spanish <es@li.org>\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
17"X-Launchpad-Export-Date: 2013-12-16 05:26+0000\n"
18"X-Generator: Poedit 1.5.4\n"
19
20#. module: purchase_landed_costs
21#: field:product.category,landed_cost:0 field:product.template,landed_cost:0
22msgid "Calculate Landed Costs"
23msgstr "Costos de importación"
24
25#. module: purchase_landed_costs
26#: sql_constraint:purchase.order:0
27msgid "Order Reference must be unique per Company!"
28msgstr "Orden de referencia debe ser única por Empresa!"
29
30#. module: purchase_landed_costs
31#: model:ir.model,name:purchase_landed_costs.model_purchase_order_line
32#: field:landed.cost.position,purchase_order_line_id:0
33msgid "Purchase Order Line"
34msgstr "Líneas de pedido de compra"
35
36#. module: purchase_landed_costs
37#: field:landed.cost.position,move_line_id:0
38msgid "Picking Line"
39msgstr "Línea de movimiento"
40
41#. module: purchase_landed_costs
42#: field:stock.move,sub_total:0
43msgid "Line Sub Total"
44msgstr "Subtotal de línea"
45
46#. module: purchase_landed_costs
47#: help:landed.cost.position,partner_id:0
48msgid "The supplier of this cost component ."
49msgstr "Proveedor de componente de costos"
50
51#. module: purchase_landed_costs
52#: constraint:product.template:0
53msgid ""
54"Error: The default UOM and the purchase UOM must be in the same category."
55msgstr ""
56"Error: La UdM por defecto y la UdM de compra deben estar en la misma "
57"categoría."
58
59#. module: purchase_landed_costs
60#: constraint:stock.move:0
61msgid "You must assign a production lot for this product"
62msgstr "Debe asignar un lote de producción para este producto"
63
64#. module: purchase_landed_costs
65#: help:landed.cost.position,amount_currency:0
66msgid "The amount expressed in an optional other currency."
67msgstr "Importe expresado en otra divisa. Opcional."
68
69#. module: purchase_landed_costs
70#: help:product.template,landed_cost_type:0
71msgid ""
72"Used if this product is landed costs: If landed costs are defined for "
73"purchase orders or pickings, this indicates how the costs are distributed to "
74"the lines"
75msgstr ""
76"Usado si el producto es un costo de importación. Indica como se distribuye "
77"el costo de importación en la orden de compra o de movimiento interno."
78
79#. module: purchase_landed_costs
80#: selection:landed.cost.position,price_type:0
81msgid "Per Unit"
82msgstr "Unidad"
83
84#. module: purchase_landed_costs
85#: model:ir.model,name:purchase_landed_costs.model_stock_picking
86msgid "Picking List"
87msgstr "Lista de Envios"
88
89#. module: purchase_landed_costs
90#: model:ir.model,name:purchase_landed_costs.model_landed_cost_position
91msgid "landed.cost.position"
92msgstr "landed.cost.position"
93
94#. module: purchase_landed_costs
95#: field:stock.move,landing_costs_picking:0
96msgid "Landing Costs from Picking"
97msgstr "Costos de entrega de Envios"
98
99#. module: purchase_landed_costs
100#: selection:landed.cost.position,price_type:0
101msgid "Absolute Value"
102msgstr "Valor absoluto"
103
104#. module: purchase_landed_costs
105#: help:product.template,landed_cost:0
106msgid ""
107"Checck this if you want to use landed cost calculation for average price for "
108"this product"
109msgstr ""
110"Marcar para definir el precio promedio del producto/servicio en el cálculo "
111"del costo de importación."
112
113#. module: purchase_landed_costs
114#: field:purchase.order,landed_cost_line_ids:0
115#: field:purchase.order.line,landed_costs:0 field:stock.move,landed_cost:0
116msgid "Landed Costs"
117msgstr "Costos de importación"
118
119#. module: purchase_landed_costs
120#: constraint:stock.move:0
121msgid "You try to assign a lot which is not from the same product"
122msgstr "Está intentando asignar un lote que no es del mismo producto"
123
124#. module: purchase_landed_costs
125#: constraint:stock.move:0
126msgid "You can not move products from or to a location of the type view."
127msgstr "No puede mover producto desde o hacia una localización de tipo vista."
128
129#. module: purchase_landed_costs
130#: view:landed.cost.position:0 view:purchase.order:0
131#: view:purchase.order.line:0 field:purchase.order.line,landing_costs:0
132#: view:stock.picking:0
133msgid "Landing Costs"
134msgstr "Costos de importación"
135
136#. module: purchase_landed_costs
137#: model:ir.model,name:purchase_landed_costs.model_stock_partial_picking_line
138msgid "stock.partial.picking.line"
139msgstr "Línea de entrega parcial"
140
141#. module: purchase_landed_costs
142#: field:purchase.order,quantity_total:0 field:stock.picking,quantity_total:0
143msgid "Total Quantity"
144msgstr "Cantidad total"
145
146#. module: purchase_landed_costs
147#: help:landed.cost.position,currency_id:0
148msgid "Optional other currency."
149msgstr "Otra divisa opcional"
150
151#. module: purchase_landed_costs
152#: field:purchase.order,landed_cost_base_value:0
153#: field:stock.picking,landed_cost_base_value:0
154msgid "Landed Costs Base Value"
155msgstr "Valor base de costo de Importación"
156
157#. module: purchase_landed_costs
158#: field:landed.cost.position,picking_id:0
159msgid "Picking"
160msgstr "Albarán"
161
162#. module: purchase_landed_costs
163#: field:stock.picking,total_amount:0
164msgid "Total Product Price"
165msgstr "Precio total de productos"
166
167#. module: purchase_landed_costs
168#: field:stock.move,price_unit_net:0
169msgid "Purchase Price"
170msgstr "Precio de compra"
171
172#. module: purchase_landed_costs
173#: field:purchase.order,landing_cost_lines:0
174#: field:stock.picking,landing_cost_lines:0
175msgid "Landing Cost Lines"
176msgstr "Lineas de costos de importación"
177
178#. module: purchase_landed_costs
179#: constraint:stock.move:0
180msgid ""
181"Error: Negative quantities for location and/or lots are not allowed for this "
182"product or product category"
183msgstr ""
184"Error: No se permiten cantidades negativas para la ubicación y/o lotes no "
185"están permitidas para este producto o categoría de producto."
186
187#. module: purchase_landed_costs
188#: selection:product.template,landed_cost_type:0
189msgid "None"
190msgstr "Ninguno"
191
192#. module: purchase_landed_costs
193#: field:product.template,landed_cost_type:0
194msgid "Distribution Type"
195msgstr "Tipo de distribución"
196
197#. module: purchase_landed_costs
198#: model:ir.model,name:purchase_landed_costs.model_stock_partial_move
199msgid "Partial Move Processing Wizard"
200msgstr "Asistente para procesado de movimientos parciales"
201
202#. module: purchase_landed_costs
203#: view:stock.picking:0
204msgid "Notes"
205msgstr "Notas:"
206
207#. module: purchase_landed_costs
208#: field:landed.cost.position,currency_id:0
209msgid "Secondary Currency"
210msgstr "Divisa secundaria"
211
212#. module: purchase_landed_costs
213#: selection:product.template,landed_cost_type:0
214msgid "Value"
215msgstr "Valor"
216
217#. module: purchase_landed_costs
218#: model:ir.model,name:purchase_landed_costs.model_purchase_order
219#: field:landed.cost.position,purchase_order_id:0
220msgid "Purchase Order"
221msgstr "Orden de Compra"
222
223#. module: purchase_landed_costs
224#: field:purchase.order.line,landed_cost_line_ids:0
225#: field:stock.move,landed_cost_line_ids:0
226#: field:stock.picking,landed_cost_line_ids:0
227msgid "Landed Costs Positions"
228msgstr "Posicion de costos de importación"
229
230#. module: purchase_landed_costs
231#: field:purchase.order.line,landing_costs_order:0
232msgid "Landing Costs from Order"
233msgstr "Costos de importación desde la orden"
234
235#. module: purchase_landed_costs
236#: field:landed.cost.position,amount:0
237msgid "Amount"
238msgstr "Monto"
239
240#. module: purchase_landed_costs
241#: model:ir.model,name:purchase_landed_costs.model_product_category
242msgid "Product Category"
243msgstr "Categoría de producto"
244
245#. module: purchase_landed_costs
246#: sql_constraint:stock.picking:0
247msgid "Reference must be unique per Company!"
248msgstr "Referencia debe ser única por compañía!"
249
250#. module: purchase_landed_costs
251#: model:ir.model,name:purchase_landed_costs.model_stock_partial_picking
252msgid "Partial Picking Processing Wizard"
253msgstr "Asistente Procesamiento Parcial de un Albaran"
254
255#. module: purchase_landed_costs
256#: help:landed.cost.position,price_type:0
257msgid ""
258"Defines if the amount is to be calculated for each quantity or an absolute "
259"value"
260msgstr ""
261"Defines if the amount is to be calculated for each quantity or an absolute "
262"value\r\n"
263"Define si el monto debe calcularse para cada cantidad o un valor absoluto"
264
265#. module: purchase_landed_costs
266#: selection:product.template,landed_cost_type:0
267msgid "Quantity"
268msgstr "Cantidad"
269
270#. module: purchase_landed_costs
271#: field:landed.cost.position,product_id:0
272msgid "Landed Cost Name"
273msgstr "Nombre del costo de importación"
274
275#. module: purchase_landed_costs
276#: field:purchase.order,landed_cost_base_quantity:0
277#: field:stock.picking,landed_cost_base_quantity:0
278msgid "Landed Costs Base Quantity"
279msgstr "Cantidad básica par el costo de importación"
280
281#. module: purchase_landed_costs
282#: help:product.category,landed_cost:0
283msgid ""
284"Checck this if you want to use landed cost calculation for average price for "
285"this catgory"
286msgstr ""
287"Marcar para calcular el costo de importación por precio promedio para la "
288"categoría"
289
290#. module: purchase_landed_costs
291#: model:ir.model,name:purchase_landed_costs.model_product_template
292msgid "Product Template"
293msgstr "Plantilla de producto"
294
295#. module: purchase_landed_costs
296#: model:ir.model,name:purchase_landed_costs.model_stock_move
297msgid "Stock Move"
298msgstr "Movimiento stock"
299
300#. module: purchase_landed_costs
301#: constraint:product.category:0
302msgid "Error ! You cannot create recursive categories."
303msgstr "¡Error! No puede crear categorías recursivas"
304
305#. module: purchase_landed_costs
306#: field:landed.cost.position,amount_currency:0
307msgid "Amount Currency"
308msgstr "Importe divisa"
309
310#. module: purchase_landed_costs
311#: field:stock.move,landing_costs:0
312msgid "Line Landing Costs"
313msgstr "Línea de costos de importación"
314
315#. module: purchase_landed_costs
316#: help:landed.cost.position,amount:0
317msgid ""
318"Landed cost for stock valuation. It will be added to the price of the "
319"supplier price."
320msgstr ""
321"Costos de importación para stock valorado. Será agregado al precio del "
322"proveedor."
323
324#. module: purchase_landed_costs
325#: field:landed.cost.position,partner_id:0
326msgid "Partner"
327msgstr "Partner"
328
329#. module: purchase_landed_costs
330#: field:purchase.order,landed_cost:0 field:stock.picking,landed_cost:0
331msgid "Landed Costs Total Untaxed"
332msgstr "Costos de importación sin impuestos"
333
334#. module: purchase_landed_costs
335#: field:landed.cost.position,price_type:0
336msgid "Amount Type"
337msgstr "Tipo de importe"
0338
=== added file 'purchase_landed_costs/i18n/purchase_landed_costs.pot'
--- purchase_landed_costs/i18n/purchase_landed_costs.pot 1970-01-01 00:00:00 +0000
+++ purchase_landed_costs/i18n/purchase_landed_costs.pot 2014-01-08 21:27:15 +0000
@@ -0,0 +1,320 @@
1# Translation of OpenERP Server.
2# This file contains the translation of the following modules:
3# * purchase_landed_costs
4#
5msgid ""
6msgstr ""
7"Project-Id-Version: OpenERP Server 6.1rc1\n"
8"Report-Msgid-Bugs-To: \n"
9"POT-Creation-Date: 2012-02-12 08:57+0000\n"
10"PO-Revision-Date: 2012-02-12 08:57+0000\n"
11"Last-Translator: <>\n"
12"Language-Team: \n"
13"MIME-Version: 1.0\n"
14"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Transfer-Encoding: \n"
16"Plural-Forms: \n"
17
18#. module: purchase_landed_costs
19#: field:product.category,landed_cost:0 field:product.template,landed_cost:0
20msgid "Calculate Landed Costs"
21msgstr ""
22
23#. module: purchase_landed_costs
24#: sql_constraint:purchase.order:0
25msgid "Order Reference must be unique per Company!"
26msgstr ""
27
28#. module: purchase_landed_costs
29#: model:ir.model,name:purchase_landed_costs.model_purchase_order_line
30#: field:landed.cost.position,purchase_order_line_id:0
31msgid "Purchase Order Line"
32msgstr ""
33
34#. module: purchase_landed_costs
35#: field:landed.cost.position,move_line_id:0
36msgid "Picking Line"
37msgstr ""
38
39#. module: purchase_landed_costs
40#: field:stock.move,sub_total:0
41msgid "Line Sub Total"
42msgstr ""
43
44#. module: purchase_landed_costs
45#: help:landed.cost.position,partner_id:0
46msgid "The supplier of this cost component ."
47msgstr ""
48
49#. module: purchase_landed_costs
50#: constraint:product.template:0
51msgid ""
52"Error: The default UOM and the purchase UOM must be in the same category."
53msgstr ""
54
55#. module: purchase_landed_costs
56#: constraint:stock.move:0
57msgid "You must assign a production lot for this product"
58msgstr ""
59
60#. module: purchase_landed_costs
61#: help:landed.cost.position,amount_currency:0
62msgid "The amount expressed in an optional other currency."
63msgstr ""
64
65#. module: purchase_landed_costs
66#: help:product.template,landed_cost_type:0
67msgid ""
68"Used if this product is landed costs: If landed costs are defined for "
69"purchase orders or pickings, this indicates how the costs are distributed to "
70"the lines"
71msgstr ""
72
73#. module: purchase_landed_costs
74#: selection:landed.cost.position,price_type:0
75msgid "Per Unit"
76msgstr ""
77
78#. module: purchase_landed_costs
79#: model:ir.model,name:purchase_landed_costs.model_stock_picking
80msgid "Picking List"
81msgstr ""
82
83#. module: purchase_landed_costs
84#: model:ir.model,name:purchase_landed_costs.model_landed_cost_position
85msgid "landed.cost.position"
86msgstr ""
87
88#. module: purchase_landed_costs
89#: field:stock.move,landing_costs_picking:0
90msgid "Landing Costs from Picking"
91msgstr ""
92
93#. module: purchase_landed_costs
94#: selection:landed.cost.position,price_type:0
95msgid "Absolute Value"
96msgstr ""
97
98#. module: purchase_landed_costs
99#: help:product.template,landed_cost:0
100msgid ""
101"Checck this if you want to use landed cost calculation for average price for "
102"this product"
103msgstr ""
104
105#. module: purchase_landed_costs
106#: field:purchase.order,landed_cost_line_ids:0
107#: field:purchase.order.line,landed_costs:0 field:stock.move,landed_cost:0
108msgid "Landed Costs"
109msgstr ""
110
111#. module: purchase_landed_costs
112#: constraint:stock.move:0
113msgid "You try to assign a lot which is not from the same product"
114msgstr ""
115
116#. module: purchase_landed_costs
117#: constraint:stock.move:0
118msgid "You can not move products from or to a location of the type view."
119msgstr ""
120
121#. module: purchase_landed_costs
122#: view:landed.cost.position:0 view:purchase.order:0
123#: view:purchase.order.line:0 field:purchase.order.line,landing_costs:0
124#: view:stock.picking:0
125msgid "Landing Costs"
126msgstr ""
127
128#. module: purchase_landed_costs
129#: model:ir.model,name:purchase_landed_costs.model_stock_partial_picking_line
130msgid "stock.partial.picking.line"
131msgstr ""
132
133#. module: purchase_landed_costs
134#: field:purchase.order,quantity_total:0 field:stock.picking,quantity_total:0
135msgid "Total Quantity"
136msgstr ""
137
138#. module: purchase_landed_costs
139#: help:landed.cost.position,currency_id:0
140msgid "Optional other currency."
141msgstr ""
142
143#. module: purchase_landed_costs
144#: field:purchase.order,landed_cost_base_value:0
145#: field:stock.picking,landed_cost_base_value:0
146msgid "Landed Costs Base Value"
147msgstr ""
148
149#. module: purchase_landed_costs
150#: field:landed.cost.position,picking_id:0
151msgid "Picking"
152msgstr ""
153
154#. module: purchase_landed_costs
155#: field:stock.picking,total_amount:0
156msgid "Total Product Price"
157msgstr ""
158
159#. module: purchase_landed_costs
160#: field:stock.move,price_unit_net:0
161msgid "Purchase Price"
162msgstr ""
163
164#. module: purchase_landed_costs
165#: field:purchase.order,landing_cost_lines:0
166#: field:stock.picking,landing_cost_lines:0
167msgid "Landing Cost Lines"
168msgstr ""
169
170#. module: purchase_landed_costs
171#: constraint:stock.move:0
172msgid ""
173"Error: Negative quantities for location and/or lots are not allowed for this "
174"product or product category"
175msgstr ""
176
177#. module: purchase_landed_costs
178#: selection:product.template,landed_cost_type:0
179msgid "None"
180msgstr ""
181
182#. module: purchase_landed_costs
183#: field:product.template,landed_cost_type:0
184msgid "Distribution Type"
185msgstr ""
186
187#. module: purchase_landed_costs
188#: model:ir.model,name:purchase_landed_costs.model_stock_partial_move
189msgid "Partial Move Processing Wizard"
190msgstr ""
191
192#. module: purchase_landed_costs
193#: view:stock.picking:0
194msgid "Notes"
195msgstr ""
196
197#. module: purchase_landed_costs
198#: field:landed.cost.position,currency_id:0
199msgid "Secondary Currency"
200msgstr ""
201
202#. module: purchase_landed_costs
203#: selection:product.template,landed_cost_type:0
204msgid "Value"
205msgstr ""
206
207#. module: purchase_landed_costs
208#: model:ir.model,name:purchase_landed_costs.model_purchase_order
209#: field:landed.cost.position,purchase_order_id:0
210msgid "Purchase Order"
211msgstr ""
212
213#. module: purchase_landed_costs
214#: field:purchase.order.line,landed_cost_line_ids:0
215#: field:stock.move,landed_cost_line_ids:0
216#: field:stock.picking,landed_cost_line_ids:0
217msgid "Landed Costs Positions"
218msgstr ""
219
220#. module: purchase_landed_costs
221#: field:purchase.order.line,landing_costs_order:0
222msgid "Landing Costs from Order"
223msgstr ""
224
225#. module: purchase_landed_costs
226#: field:landed.cost.position,amount:0
227msgid "Amount"
228msgstr ""
229
230#. module: purchase_landed_costs
231#: model:ir.model,name:purchase_landed_costs.model_product_category
232msgid "Product Category"
233msgstr ""
234
235#. module: purchase_landed_costs
236#: sql_constraint:stock.picking:0
237msgid "Reference must be unique per Company!"
238msgstr ""
239
240#. module: purchase_landed_costs
241#: model:ir.model,name:purchase_landed_costs.model_stock_partial_picking
242msgid "Partial Picking Processing Wizard"
243msgstr ""
244
245#. module: purchase_landed_costs
246#: help:landed.cost.position,price_type:0
247msgid ""
248"Defines if the amount is to be calculated for each quantity or an absolute "
249"value"
250msgstr ""
251
252#. module: purchase_landed_costs
253#: selection:product.template,landed_cost_type:0
254msgid "Quantity"
255msgstr ""
256
257#. module: purchase_landed_costs
258#: field:landed.cost.position,product_id:0
259msgid "Landed Cost Name"
260msgstr ""
261
262#. module: purchase_landed_costs
263#: field:purchase.order,landed_cost_base_quantity:0
264#: field:stock.picking,landed_cost_base_quantity:0
265msgid "Landed Costs Base Quantity"
266msgstr ""
267
268#. module: purchase_landed_costs
269#: help:product.category,landed_cost:0
270msgid ""
271"Checck this if you want to use landed cost calculation for average price for "
272"this catgory"
273msgstr ""
274
275#. module: purchase_landed_costs
276#: model:ir.model,name:purchase_landed_costs.model_product_template
277msgid "Product Template"
278msgstr ""
279
280#. module: purchase_landed_costs
281#: model:ir.model,name:purchase_landed_costs.model_stock_move
282msgid "Stock Move"
283msgstr ""
284
285#. module: purchase_landed_costs
286#: constraint:product.category:0
287msgid "Error ! You cannot create recursive categories."
288msgstr ""
289
290#. module: purchase_landed_costs
291#: field:landed.cost.position,amount_currency:0
292msgid "Amount Currency"
293msgstr ""
294
295#. module: purchase_landed_costs
296#: field:stock.move,landing_costs:0
297msgid "Line Landing Costs"
298msgstr ""
299
300#. module: purchase_landed_costs
301#: help:landed.cost.position,amount:0
302msgid ""
303"Landed cost for stock valuation. It will be added to the price of the "
304"supplier price."
305msgstr ""
306
307#. module: purchase_landed_costs
308#: field:landed.cost.position,partner_id:0
309msgid "Partner"
310msgstr ""
311
312#. module: purchase_landed_costs
313#: field:purchase.order,landed_cost:0 field:stock.picking,landed_cost:0
314msgid "Landed Costs Total Untaxed"
315msgstr ""
316
317#. module: purchase_landed_costs
318#: field:landed.cost.position,price_type:0
319msgid "Amount Type"
320msgstr ""
0321
=== added file 'purchase_landed_costs/product.py'
--- purchase_landed_costs/product.py 1970-01-01 00:00:00 +0000
+++ purchase_landed_costs/product.py 2014-01-08 21:27:15 +0000
@@ -0,0 +1,40 @@
1# -*- coding: utf-8 -*-
2from osv import orm, fields
3#----------------------------------------------------------
4# Product INHERIT
5#----------------------------------------------------------
6
7
8class product_template(orm.Model):
9 _inherit = "product.template"
10
11 _columns = {
12 'landed_cost_type': fields.selection(
13 [('value', 'Value'), ('per_unit', 'Quantity'), ('none', 'None')],
14 'Distribution Type',
15 help="Used if this product is landed costs: If landed costs are \
16 defined for purchase orders or pickings, this indicates how the \
17 costs are distributed to the lines"
18 ),
19 'landed_cost': fields.boolean(
20 'Calculate Landed Costs',
21 help="Check this if you want to use landed cost calculation for \
22 average price for this product"
23 )
24 }
25
26product_template()
27
28
29class product_category(orm.Model):
30
31 _inherit = 'product.category'
32 _columns = {
33 'landed_cost': fields.boolean(
34 'Calculate Landed Costs',
35 help="Check this if you want to use landed cost calculation for \
36 average price for this category"
37 )
38 }
39
40product_category()
041
=== added file 'purchase_landed_costs/purchase.py'
--- purchase_landed_costs/purchase.py 1970-01-01 00:00:00 +0000
+++ purchase_landed_costs/purchase.py 2014-01-08 21:27:15 +0000
@@ -0,0 +1,298 @@
1# -*- coding: utf-8 -*-
2from osv import orm, fields
3import decimal_precision as dp
4import logging
5
6
7class landed_cost_position(orm.Model):
8 _name = "landed.cost.position"
9 _columns = {
10 'product_id': fields.many2one(
11 'product.product',
12 'Landed Cost Name',
13 required=True,
14 domain=[('landed_cost_type', '!=', False)]
15 ),
16 'amount': fields.float(
17 'Amount',
18 required=True,
19 digits_compute=dp.get_precision('Purchase Price'),
20 help="Landed cost for stock valuation. It will be added to the \
21 price of the supplier price."
22 ),
23 'amount_currency': fields.float(
24 'Amount Currency',
25 help="The amount expressed in an optional other currency."
26 ),
27 'currency_id': fields.many2one('res.currency', 'Secondary Currency',
28 help="Optional other currency."),
29 'partner_id': fields.many2one(
30 'res.partner',
31 'Partner',
32 help="The supplier of this cost component."
33 ),
34 'price_type': fields.selection(
35 [('per_unit', 'Per Quantity'), ('value', 'Absolute Value')],
36 'Amount Type',
37 required=True,
38 help="Defines if the amount is to be calculated for each quantity \
39 or an absolute value"
40 ),
41 'purchase_order_line_id': fields.many2one('purchase.order.line',
42 'Purchase Order Line'),
43 'purchase_order_id': fields.many2one('purchase.order',
44 'Purchase Order'),
45 'move_line_id': fields.many2one('stock.move', 'Picking Line'),
46 'picking_id': fields.many2one('stock.picking', 'Picking')
47 }
48
49 def onchange_product_id(self, cr, uid, ids, product_id, context=None):
50 if product_id:
51 prod_obj = self.pool.get('product.product')
52 prod = prod_obj.browse(cr, uid, [product_id], context=context)[0]
53 v = {'price_type': prod.landed_cost_type}
54 return {'value': v}
55 return {}
56
57
58landed_cost_position()
59
60#----------------------------------------------------------
61# Purchase Line INHERIT
62#----------------------------------------------------------
63
64
65class purchase_order_line(orm.Model):
66 _inherit = "purchase.order.line"
67
68 def _landing_cost(self, cr, uid, ids, name, args, context=None):
69 if not ids:
70 return {}
71 result = {}
72 # landed costs for the line
73 for line in self.browse(cr, uid, ids, context=context):
74 landed_costs = 0.0
75 if line.landed_cost_line_ids:
76 for costs in line.landed_cost_line_ids:
77 if costs.price_type == 'value':
78 landed_costs += costs.amount
79 else:
80 landed_costs += costs.amount * line.product_qty
81 result[line.id] = landed_costs
82 return result
83
84 def _landing_cost_order(self, cr, uid, ids, name, args, context=None):
85 if not ids:
86 return {}
87 result = {}
88 lines = self.browse(cr, uid, ids, context=context)
89 # Landed costs line by line
90 for line in lines:
91 landed_costs = 0.0
92 # distribution of landed costs of PO
93 if line.order_id.landed_cost_line_ids:
94 # Base value (Absolute Value)
95 landed_costs += line.order_id.landed_cost_base_value \
96 / line.order_id.amount_untaxed * line.price_subtotal
97
98 # Base quantity (Per Quantity)
99 landed_costs += line.order_id.landed_cost_base_quantity \
100 / line.order_id.quantity_total * line.product_qty
101 result[line.id] = landed_costs
102
103 return result
104
105 def _landed_cost(self, cr, uid, ids, name, args, context=None):
106 if not ids:
107 return {}
108 result = {}
109 # landed costs for the line
110 for line in self.browse(cr, uid, ids, context=context):
111 result[line.id] = line.price_subtotal + line.landing_costs + \
112 line.landing_costs_order
113
114 return result
115
116 _columns = {
117 'landed_cost_line_ids': fields.one2many('landed.cost.position',
118 'purchase_order_line_id',
119 'Landed Costs Positions'),
120 'landing_costs': fields.function(
121 _landing_cost,
122 digits_compute=dp.get_precision('Account'),
123 string='Landing Costs'
124 ),
125 'landing_costs_order': fields.function(
126 _landing_cost_order,
127 digits_compute=dp.get_precision('Account'),
128 string='Landing Costs from Order'
129 ),
130 'landed_costs': fields.function(
131 _landed_cost,
132 digits_compute=dp.get_precision('Account'),
133 string='Landed Costs'
134 )
135 }
136
137
138purchase_order_line()
139
140
141class purchase_order(orm.Model):
142 _inherit = "purchase.order"
143 _logger = logging.getLogger(__name__)
144
145 def _landed_cost_base_value(self, cr, uid, ids, name, args, context=None):
146 if not ids:
147 return {}
148 result = {}
149
150 for line in self.browse(cr, uid, ids, context=context):
151 landed_costs_base_value = 0.0
152 if line.landed_cost_line_ids:
153 for costs in line.landed_cost_line_ids:
154 if costs.product_id.landed_cost_type == 'value':
155 landed_costs_base_value += costs.amount
156 result[line.id] = landed_costs_base_value
157 return result
158
159 def _landed_cost_base_quantity(self, cr, uid, ids, name, args,
160 context=None):
161 if not ids:
162 return {}
163 result = {}
164
165 for line in self.browse(cr, uid, ids, context=context):
166 landed_costs_base_quantity = 0.0
167 if line.landed_cost_line_ids:
168 for costs in line.landed_cost_line_ids:
169 if costs.product_id.landed_cost_type == 'quantity':
170 landed_costs_base_quantity += costs.amount
171 result[line.id] = landed_costs_base_quantity
172 return result
173
174 def _quantity_total(self, cr, uid, ids, name, args, context):
175 if not ids:
176 return {}
177 result = {}
178
179 for line in self.browse(cr, uid, ids, context=context):
180 quantity_total = 0.0
181 if line.order_line:
182 for pol in line.order_line:
183 if pol.product_qty > 0.0:
184 quantity_total += pol.product_qty
185 result[line.id] = quantity_total
186 return result
187
188 def _landed_cost(self, cr, uid, ids, name, args, context=None):
189 if not ids:
190 return {}
191 result = {}
192 # landed costs for the line
193 for line in self.browse(cr, uid, ids,
194 context=context):
195 result[line.id] = line.landing_cost_lines + line.amount_untaxed
196
197 return result
198
199 def _landing_cost_lines(self, cr, uid, ids, name, args, context=None):
200 if not ids:
201 return {}
202 result = {}
203 landed_cost_lines = 0.0
204 for line in self.browse(cr, uid, ids, context=context):
205 if line.order_line:
206 for pol in line.order_line:
207 if pol.product_qty > 0.0:
208 landed_cost_lines += pol.landing_costs
209 result[line.id] = landed_cost_lines
210 return result
211
212 _columns = {
213 'landed_cost_line_ids': fields.one2many('landed.cost.position',
214 'purchase_order_id',
215 'Landed Costs'),
216 'landed_cost_base_value': fields.function(
217 _landed_cost_base_value,
218 digits_compute=dp.get_precision('Account'),
219 string='Landed Costs Base Value'
220 ),
221 'landed_cost_base_quantity': fields.function(
222 _landed_cost_base_quantity,
223 digits_compute=dp.get_precision('Account'),
224 string='Landed Costs Base Quantity'
225 ),
226 'landing_cost_lines': fields.function(
227 _landing_cost_lines,
228 digits_compute=dp.get_precision('Account'),
229 string='Landing Cost Lines'
230 ),
231 'landed_cost': fields.function(
232 _landed_cost,
233 digits_compute=dp.get_precision('Account'),
234 string='Landed Costs Total Untaxed'
235 ),
236 'quantity_total': fields.function(
237 _quantity_total,
238 digits_compute=dp.get_precision('Product UoM'),
239 string='Total Quantity')
240 }
241
242 def _prepare_order_line_move(self, cr, uid, order, order_line, picking_id,
243 context=None):
244 res = super(purchase_order, self)._prepare_order_line_move(
245 cr, uid, order, order_line, picking_id, context
246 )
247 res['price_unit_net'] = order_line.price_subtotal / order_line.product_qty
248 res['price_unit'] = order_line.landed_costs / order_line.product_qty
249 return res
250
251 def _prepare_order_picking(self, cr, uid, order, context=None):
252 res = super(purchase_order, self)._prepare_order_picking(
253 cr, uid, order, context
254 )
255 return res
256
257 def _create_pickings(self, cr, uid, order, order_lines, picking_id=False,
258 context=None):
259 res = super(purchase_order, self)._create_pickings(
260 cr, uid, order, order_lines, picking_id, context)
261 pick_id = int(res[0])
262 # landing costs for PICK from PO
263 cost_obj = self.pool.get('landed.cost.position')
264 for order_cost in order.landed_cost_line_ids:
265 vals = {}
266 vals['product_id'] = order_cost.product_id.id
267 vals['partner_id'] = order_cost.partner_id.id
268 vals['amount'] = order_cost.amount
269 vals['amount_currency'] = order_cost.amount_currency
270 vals['currency_id'] = order_cost.currency_id.id
271 vals['price_type'] = order_cost.price_type
272 vals['picking_id'] = pick_id
273 self._logger.debug('vals `%s`', vals)
274 cost_obj.create(cr, uid, vals, context=context)
275
276 # landing costs for PICK Lines from PO
277 pick_obj = self.pool.get('stock.picking')
278 for pick in pick_obj.browse(cr, uid, [pick_id], context=context):
279 self._logger.debug('pick `%s`', pick)
280 for line in pick.move_lines:
281 self._logger.debug('line `%s`', line)
282 for order_cost in line.purchase_line_id.landed_cost_line_ids:
283 vals = {}
284 vals['product_id'] = order_cost.product_id.id
285 vals['partner_id'] = order_cost.partner_id.id
286 vals['amount'] = order_cost.amount
287 vals['amount_currency'] = order_cost.amount_currency
288 vals['currency_id'] = order_cost.currency_id.id
289 vals['price_type'] = order_cost.price_type
290 vals['move_line_id'] = line.id
291 self._logger.debug('vals `%s`', vals)
292 cost_obj.create(cr, uid, vals, context=context)
293 self._logger.debug('cost created')
294
295 return res
296
297
298purchase_order()
0299
=== added file 'purchase_landed_costs/purchase_view.xml'
--- purchase_landed_costs/purchase_view.xml 1970-01-01 00:00:00 +0000
+++ purchase_landed_costs/purchase_view.xml 2014-01-08 21:27:15 +0000
@@ -0,0 +1,104 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<openerp>
3 <data>
4
5 <record model="ir.ui.view" id="c2c_landed_cost_tree">
6 <field name="name">c2clanded.cost.tree</field>
7 <field name="model">landed.cost.position</field>
8 <field name="priority">1</field>
9 <field name="type">tree</field>
10 <field name="arch" type="xml">
11 <tree string="Landing Costs" editable="bottom">
12 <field name="product_id" on_change="onchange_product_id(product_id)"/>
13 <field name="partner_id"/>
14 <field name="amount"/>
15 <field name="price_type"/>
16 <field name="amount_currency"/>
17 <field name="currency_id"/>
18 </tree>
19 </field>
20 </record>
21
22 <record model="ir.ui.view" id="c2c_landed_cost_form">
23 <field name="name">c2clanded.cost.form</field>
24 <field name="model">landed.cost.position</field>
25 <field name="priority">1</field>
26 <field name="type">form</field>
27 <field name="arch" type="xml">
28 <form string="Landing Costs">
29 <field name="product_id" on_change="onchange_product_id(product_id)"/>
30 <field name="partner_id"/>
31 <field name="amount"/>
32 <field name="price_type"/>
33 <field name="amount_currency"/>
34 <field name="currency_id"/>
35 </form>
36 </field>
37 </record>
38
39
40
41 <!-- ******************
42 Landed cost definition in product form
43 ******************-->
44 <record model="ir.ui.view" id="c2c_product_landed_cost_view">
45 <field name="name">c2c_product.landed.cost.view</field>
46 <field name="model">product.product</field>
47 <field name="inherit_id" ref="product.product_normal_form_view"/>
48 <field name="type">form</field>
49 <field name="arch" type="xml">
50 <field name="active" position="after">
51 <field name="landed_cost_type"/>
52 <field name="landed_cost"/>
53 </field>
54 </field>
55 </record>
56
57 <!-- Landed costs Purchase Form-->
58 <record model="ir.ui.view" id="c2c_purchase_order_landed_cost_view">
59 <field name="name">c2c_purchase.order.landed.cost.form.view</field>
60 <field name="model">purchase.order</field>
61 <field name="inherit_id" ref="purchase.purchase_order_form"/>
62 <field name="type">form</field>
63 <field name="arch" type="xml">
64 <notebook position="inside">
65 <page string="Landing Costs" attrs="{'readonly':[('state','=','done')]}">
66 <group colspan="2" col="2">
67 <field name="quantity_total"/>
68 <field name="landed_cost_base_quantity"/>
69 <field name="landed_cost_base_value"/>
70 </group>
71 <group colspan="2" col="2">
72
73 <field name="landing_cost_lines"/>
74 <field name="landed_cost"/>
75 </group>
76 <field name="landed_cost_line_ids" colspan="4" nolabel="1" widget="one2many_list"/>
77
78 </page>
79 </notebook>
80 </field>
81 </record>
82
83 <!-- Landed costs Purchase Line Form-->
84 <record model="ir.ui.view" id="purchase_oder_line_landed_cost_view">
85 <field name="name">purchase.oder.line.landed.cost.view</field>
86 <field name="model">purchase.order.line</field>
87 <field name="inherit_id" ref="purchase.purchase_order_line_form"/>
88 <field name="type">form</field>
89 <field name="arch" type="xml">
90 <notebook position="inside">
91 <page string="Landing Costs" >
92 <group colspan="2" col="2">
93 <field name="landing_costs"/>
94 <field name="landing_costs_order"/>
95 <field name="landed_costs"/>
96 <field name="landed_cost_line_ids" colspan="4" nolabel="1" widget="one2many_list"/>
97 </group>
98 </page>
99 </notebook>
100 </field>
101 </record>
102
103 </data>
104</openerp>
0105
=== added directory 'purchase_landed_costs/security'
=== added file 'purchase_landed_costs/security/ir.model.access.csv'
--- purchase_landed_costs/security/ir.model.access.csv 1970-01-01 00:00:00 +0000
+++ purchase_landed_costs/security/ir.model.access.csv 2014-01-08 21:27:15 +0000
@@ -0,0 +1,3 @@
1"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
2access_landed_cost,landed.cost.position,model_landed_cost_position,purchase.group_purchase_user,1,1,1,1
3access_landed_cost_manager,landed.cost.position,model_landed_cost_position,purchase.group_purchase_manager,1,1,1,1
04
=== added file 'purchase_landed_costs/stock.py'
--- purchase_landed_costs/stock.py 1970-01-01 00:00:00 +0000
+++ purchase_landed_costs/stock.py 2014-01-08 21:27:15 +0000
@@ -0,0 +1,297 @@
1# -*- coding: utf-8 -*-
2from osv import orm, fields
3from operator import itemgetter
4import decimal_precision as dp
5import logging
6#----------------------------------------------------------
7# Stock Move
8#----------------------------------------------------------
9
10
11class stock_move(orm.Model):
12 _inherit = "stock.move"
13
14 def _landing_cost(self, cr, uid, ids, name, args, context=None):
15 if not ids:
16 return {}
17 result = {}
18 # landed costs for the line
19 for line in self.browse(cr, uid, ids, context=context):
20 landed_costs = 0.0
21 if line.landed_cost_line_ids:
22 for costs in line.landed_cost_line_ids:
23 if costs.price_type == 'value':
24 landed_costs += costs.amount
25 else:
26 landed_costs += costs.amount * line.product_qty
27 result[line.id] = landed_costs
28 return result
29
30 def _landing_cost_order(self, cr, uid, ids, name, args, context=None):
31 if not ids:
32 return {}
33 result = {}
34 # landed costs for the line
35 for line in self.browse(cr, uid, ids, context=context):
36 landed_costs = 0.0
37 # distribution of landed costs of PO
38 if line.picking_id.landed_cost_line_ids:
39 if line.picking_id.total_amount \
40 and line.picking_id.total_amount > 0.0:
41 landed_costs += line.picking_id.landed_cost_base_value \
42 / line.picking_id.total_amount \
43 * line.sub_total
44 if line.picking_id.quantity_total \
45 and line.picking_id.quantity_total > 0.0:
46 landed_costs += line.picking_id.landed_cost_base_quantity \
47 / line.picking_id.quantity_total * line.product_qty
48 result[line.id] = landed_costs
49
50 return result
51
52 def _landed_cost(self, cr, uid, ids, name, args, context=None):
53 if not ids:
54 return {}
55 result = {}
56 # landed costs for the line
57 for line in self.browse(cr, uid, ids, context=context):
58 result[line.id] = line.product_qty * line.price_unit
59
60 return result
61
62 def _sub_total(self, cr, uid, ids, name, args, context=None):
63 if not ids:
64 return {}
65 result = {}
66 for line in self.browse(cr, uid, ids, context=context):
67 result[line.id] = line.product_qty * line.price_unit_net or 0.0
68
69 return result
70
71 _columns = {
72 'landed_cost_line_ids': fields.one2many('landed.cost.position',
73 'move_line_id',
74 'Landed Costs Positions'),
75 'landing_costs': fields.function(
76 _landing_cost,
77 digits_compute=dp.get_precision('Account'),
78 string='Line Landing Costs'
79 ),
80 'landing_costs_picking': fields.function(
81 _landing_cost_order,
82 digits_compute=dp.get_precision('Account'),
83 string='Landing Costs from Picking'
84 ),
85 'landed_cost': fields.function(
86 _landed_cost,
87 digits_compute=dp.get_precision('Account'),
88 string='Landed Costs'
89 ),
90 'sub_total': fields.function(
91 _sub_total,
92 digits_compute=dp.get_precision('Account'),
93 string='Line Sub Total'
94 ),
95 'price_unit_net': fields.float(
96 'Purchase Price',
97 digits_compute=dp.get_precision('Account')
98 )
99 }
100
101stock_move()
102
103#----------------------------------------------------------
104# Stock Picking
105#----------------------------------------------------------
106
107
108class stock_picking(orm.Model):
109 _inherit = "stock.picking"
110
111 def _landed_cost_base_value(self, cr, uid, ids, name, args, context=None):
112 if not ids:
113 return {}
114 result = {}
115 for line in self.browse(cr, uid, ids, context=context):
116 landed_costs_base_value = 0.0
117 if line.landed_cost_line_ids:
118 for costs in line.landed_cost_line_ids:
119 if costs.product_id.landed_cost_type == 'value':
120 landed_costs_base_value += costs.amount
121 result[line.id] = landed_costs_base_value
122 return result
123
124 def _landed_cost_base_quantity(self, cr, uid, ids,
125 name, args, context=None):
126 if not ids:
127 return {}
128 result = {}
129 for line in self.browse(cr, uid, ids, context=context):
130 landed_costs_base_quantity = 0.0
131 if line.landed_cost_line_ids:
132 for costs in line.landed_cost_line_ids:
133 if costs.product_id.landed_cost_type == 'quantity':
134 landed_costs_base_quantity += costs.amount
135 result[line.id] = landed_costs_base_quantity
136 return result
137
138 def _landed_cost(self, cr, uid, ids, name, args, context=None):
139 if not ids:
140 return {}
141 result = {}
142 # landed costs for the line
143 for line in self.browse(cr, uid, ids, context=context):
144 landed_costs = 0.0
145 if line.move_lines:
146 for ml in line.move_lines:
147 landed_costs += ml.landed_cost
148 result[line.id] = landed_costs
149
150 return result
151
152 def _landing_cost_lines(self, cr, uid, ids, name, args, context=None):
153 if not ids:
154 return {}
155 result = {}
156 for picking in self.browse(cr, uid, ids, context=context):
157 landed_cost_lines = 0.0
158 if picking.move_lines:
159 for ml in picking.move_lines:
160 if ml.product_qty > 0.0:
161 landed_cost_lines += ml.landing_costs + \
162 ml.landing_costs_picking
163 result[picking.id] = landed_cost_lines
164 return result
165
166 def _quantity_total(self, cr, uid, ids, name, args, context=None):
167 if not ids:
168 return {}
169 result = {}
170 for line in self.browse(cr, uid, ids, context=context):
171 quantity_total = 0.0
172 if line.move_lines:
173 for ml in line.move_lines:
174 if ml.product_qty > 0.0:
175 quantity_total += ml.product_qty
176 result[line.id] = quantity_total
177 return result
178
179 def _amount_total(self, cr, uid, ids, name, args, context=None):
180 if not ids:
181 return {}
182 result = {}
183 stock_pickings = self.browse(cr, uid, ids, context=context)
184 for picking in stock_pickings:
185 amount_total = 0.0
186 if picking.move_lines:
187 for ml in picking.move_lines:
188 if ml.product_qty > 0.0 and ml.price_unit:
189 amount_total += ml.sub_total
190 result[picking.id] = amount_total
191 return result
192
193 def _get_price_unit_invoice(self, cursor, user, move_line,
194 type):
195 if move_line.purchase_line_id:
196 return move_line.purchase_line_id.price_unit
197 return super(stock_picking, self)._get_price_unit_invoice(
198 cursor, user, move_line, type
199 )
200
201 def write(self, cr, uid, ids, values, context=None):
202 if 'landed_cost_line_ids' in values:
203 sps = self.browse(cr, uid, ids, context=context)
204 old_picking = {}
205 for picking in sps:
206 old_picking[picking.id] = {
207 'landed_cost_base_value':
208 picking.landed_cost_base_value or 0.0,
209 'landed_cost_base_quantity':
210 picking.landed_cost_base_quantity or 0.0
211 }
212
213 ml_obj = self.pool.get('stock.move')
214 res = super(stock_picking, self).write(
215 cr, uid, ids, values, context=context
216 )
217 if res and 'landed_cost_line_ids' in values:
218 for picking in sps:
219 nsp = self.browse(cr, uid, [picking.id], context=context)
220 new_picking = nsp[0]
221 prev = old_picking[picking.id]
222 chg_landed_cost_base_quantity = \
223 new_picking.landed_cost_base_quantity - \
224 prev['landed_cost_base_quantity']
225 chg_landed_cost_base_value = \
226 new_picking.landed_cost_base_value - \
227 prev['landed_cost_base_value']
228 if picking.move_lines:
229 for ml in picking.move_lines:
230 qty_ratio = ml.product_qty / \
231 new_picking.quantity_total
232 value_ratio = ml.sub_total / \
233 new_picking.total_amount
234 price_unit = (
235 ml.landed_cost +
236 qty_ratio * chg_landed_cost_base_quantity +
237 value_ratio * chg_landed_cost_base_value
238 ) / ml.product_qty
239 ml_obj.write(
240 cr, uid, [ml.id],
241 {'price_unit': price_unit},
242 context=context
243 )
244 return res
245
246 _columns = {
247 'landed_cost_line_ids': fields.one2many('landed.cost.position',
248 'picking_id',
249 'Landed Costs Positions'),
250 'landed_cost_base_value': fields.function(
251 _landed_cost_base_value,
252 digits_compute=dp.get_precision('Account'),
253 string='Landed Costs Base Value'
254 ),
255 'landed_cost_base_quantity': fields.function(
256 _landed_cost_base_quantity,
257 digits_compute=dp.get_precision('Account'),
258 string='Landed Costs Base Quantity'
259 ),
260 'landing_cost_lines': fields.function(
261 _landing_cost_lines,
262 digits_compute=dp.get_precision('Account'),
263 string='Landing Cost Lines'
264 ),
265 'landed_cost': fields.function(
266 _landed_cost,
267 digits_compute=dp.get_precision('Account'),
268 string='Landed Costs Total Untaxed'
269 ),
270 'total_amount': fields.function(
271 _amount_total,
272 digits_compute=dp.get_precision('Account'),
273 string='Total Product Price'
274 ),
275 'quantity_total': fields.function(
276 _quantity_total,
277 digits_compute=dp.get_precision('Product UoM'),
278 string='Total Quantity'
279 )
280 }
281
282stock_picking()
283
284
285class stock_partial_picking(orm.TransientModel):
286 _inherit = "stock.partial.picking"
287 _logger = logging.getLogger(__name__)
288
289 def _product_cost_for_average_update(self, cr, uid, move):
290 res = super(stock_partial_picking, self).\
291 _product_cost_for_average_update(cr, uid, move)
292 self._logger.debug('res stock_partial_picking `%s`', res)
293 res['cost'] = move.landed_cost / move.product_qty
294 self._logger.debug('res stock_partial_picking `%s`', res)
295 return res
296
297stock_partial_picking()
0298
=== added file 'purchase_landed_costs/stock_view.xml'
--- purchase_landed_costs/stock_view.xml 1970-01-01 00:00:00 +0000
+++ purchase_landed_costs/stock_view.xml 2014-01-08 21:27:15 +0000
@@ -0,0 +1,49 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<openerp>
3 <data>
4
5 <!-- Landed costs Picking In Form-->
6 <record model="ir.ui.view" id="c2c_stock_picking_landed_cost_view">
7 <field name="name">c2c_stock.picking.landed.cost.form.view</field>
8 <field name="model">stock.picking</field>
9 <field name="inherit_id" ref="stock.view_picking_in_form"/>
10 <field name="type">form</field>
11 <field name="arch" type="xml">
12 <page string="Notes" position="after">
13 <page string="Landing Costs" attrs="{'readonly':[('state','=','done')]}">
14 <group colspan="2" col="2">
15 <field name="quantity_total"/>
16 <field name="landed_cost_base_quantity"/>
17 <field name="landed_cost_base_value"/>
18 </group>
19 <group colspan="2" col="2">
20 <field name="total_amount"/>
21 <field name="landing_cost_lines"/>
22 <field name="landed_cost"/>
23 </group>
24 <field name="landed_cost_line_ids" colspan="4" nolabel="1" widget="one2many_list"/>
25 </page>
26 </page>
27 </field>
28 </record>
29
30 <!-- Landed costs Picking In Line Form-->
31 <record model="ir.ui.view" id="ic2c_stock_picking_landed_cost_line_view">
32 <field name="name">move.line.landed.cost.line.view</field>
33 <field name="model">stock.picking</field>
34 <field name="inherit_id" ref="stock.view_picking_in_form"/>
35 <field name="type">form</field>
36 <field name="arch" type="xml">
37 <xpath expr="/form/notebook/page[@string='General Information']/field/form/label" position="before">
38 <group string="Landing Costs" colspan="4">
39 <field name="landing_costs"/>
40 <field name="landing_costs_picking"/>
41 <field name="sub_total"/>
42 <field name="landed_cost"/>
43 <field name="landed_cost_line_ids" colspan="4" nolabel="1" widget="one2many_list"/>
44 </group>
45 </xpath>
46 </field>
47 </record>
48 </data>
49</openerp>
050
=== added directory 'purchase_landed_costs/wizard'

Subscribers

People subscribed via source and target branches

to all changes: