Merge lp:~gs.clearcorp/openerp-ccorp-addons/7.0_purchase_import into lp:openerp-ccorp-addons/7.0

Proposed by Glen Sojo
Status: Merged
Merged at revision: 853
Proposed branch: lp:~gs.clearcorp/openerp-ccorp-addons/7.0_purchase_import
Merge into: lp:openerp-ccorp-addons/7.0
Diff against target: 2616 lines (+2546/-0)
11 files modified
purchase_import/__init__.py (+23/-0)
purchase_import/__openerp__.py (+51/-0)
purchase_import/i18n/es.po (+618/-0)
purchase_import/i18n/purchase_import.pot (+614/-0)
purchase_import/product.py (+33/-0)
purchase_import/purchase_import.py (+633/-0)
purchase_import/purchase_import_sequence.xml (+38/-0)
purchase_import/purchase_import_workflow.xml (+64/-0)
purchase_import/security/ir.model.access.csv (+17/-0)
purchase_import/view/purchase_import_menu.xml (+39/-0)
purchase_import/view/purchase_import_view.xml (+416/-0)
To merge this branch: bzr merge lp:~gs.clearcorp/openerp-ccorp-addons/7.0_purchase_import
Reviewer Review Type Date Requested Status
ClearCorp drivers Pending
Review via email: mp+219426@code.launchpad.net

Description of the change

[ADD] - purchase_import: new module to manage import costs from products.

To post a comment you must log in.
851. By Ronald Rubi

[MRG] Add account_bank_balance_report module, this module create bank balance report

852. By Ronald Rubi

[FIX] Fix traslations in account_bank_balance_report

853. By Ronald Rubi

[MRG] - purchase_import: new module to manage import costs from products.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'purchase_import'
2=== added file 'purchase_import/__init__.py'
3--- purchase_import/__init__.py 1970-01-01 00:00:00 +0000
4+++ purchase_import/__init__.py 2014-05-15 14:59:21 +0000
5@@ -0,0 +1,23 @@
6+# -*- coding: utf-8 -*-
7+##############################################################################
8+#
9+# OpenERP, Open Source Management Solution
10+# Original Module by SIESA (<http://www.siesacr.com>)
11+# Refactored by CLEARCORP S.A. (<http://clearcorp.co.cr>)
12+#
13+# This program is free software: you can redistribute it and/or modify
14+# it under the terms of the GNU Affero General Public License as
15+# published by the Free Software Foundation, either version 3 of the
16+# license, or (at your option) any later version.
17+#
18+# This program is distributed in the hope that it will be useful,
19+# but WITHOUT ANY WARRANTY; without even the implied warranty of
20+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21+# GNU Affero General Public License for more details.
22+#
23+# You should have received a copy of the GNU Affero General Public License
24+# along with this program. If not, see <http://www.gnu.org/licenses/>.
25+##############################################################################
26+
27+import purchase_import
28+import product
29\ No newline at end of file
30
31=== added file 'purchase_import/__openerp__.py'
32--- purchase_import/__openerp__.py 1970-01-01 00:00:00 +0000
33+++ purchase_import/__openerp__.py 2014-05-15 14:59:21 +0000
34@@ -0,0 +1,51 @@
35+# -*- coding: utf-8 -*-
36+##############################################################################
37+#
38+# OpenERP, Open Source Management Solution
39+# Original Module by SIESA (<http://www.siesacr.com>)
40+# Refactored by CLEARCORP S.A. (<http://clearcorp.co.cr>)
41+#
42+# This program is free software: you can redistribute it and/or modify
43+# it under the terms of the GNU Affero General Public License as
44+# published by the Free Software Foundation, either version 3 of the
45+# license, or (at your option) any later version.
46+#
47+# This program is distributed in the hope that it will be useful,
48+# but WITHOUT ANY WARRANTY; without even the implied warranty of
49+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
50+# GNU Affero General Public License for more details.
51+#
52+# You should have received a copy of the GNU Affero General Public License
53+# along with this program. If not, see <http://www.gnu.org/licenses/>.
54+##############################################################################
55+
56+{
57+ 'name': 'Purchase Import',
58+ 'version': '1.0',
59+ 'category': 'Purchase Management',
60+ 'sequence': 20,
61+ 'summary': 'Import Purchase, Tax Charges, And Cost Calculation',
62+ 'description': """
63+Manage Taxes on Import Purchases
64+================================
65+
66+Purchase Import facilitates the handling of Imports, adding tax charges and calculates the total product's cost""",
67+ 'author': 'CLEARCORP S.A.',
68+ 'website': 'http://clearcorp.co.cr',
69+ 'complexity': 'normal',
70+ 'images' : [],
71+ 'depends': ['purchase','res_currency_sequence', 'stock'],
72+ 'data': [
73+ 'view/purchase_import_view.xml',
74+ 'view/purchase_import_menu.xml',
75+ 'purchase_import_sequence.xml',
76+ 'purchase_import_workflow.xml',
77+ 'security/ir.model.access.csv',
78+ ],
79+ 'test' : [],
80+ 'demo': [],
81+ 'installable': True,
82+ 'auto_install': False,
83+ 'application': False,
84+ 'license': 'AGPL-3',
85+}
86\ No newline at end of file
87
88=== added directory 'purchase_import/i18n'
89=== added file 'purchase_import/i18n/es.po'
90--- purchase_import/i18n/es.po 1970-01-01 00:00:00 +0000
91+++ purchase_import/i18n/es.po 2014-05-15 14:59:21 +0000
92@@ -0,0 +1,618 @@
93+# Translation of OpenERP Server.
94+# This file contains the translation of the following modules:
95+# * purchase_import
96+#
97+msgid ""
98+msgstr ""
99+"Project-Id-Version: OpenERP Server 7.0\n"
100+"Report-Msgid-Bugs-To: \n"
101+"POT-Creation-Date: 2014-05-13 20:42+0000\n"
102+"PO-Revision-Date: 2014-05-13 14:44-0600\n"
103+"Last-Translator: <>\n"
104+"Language-Team: \n"
105+"MIME-Version: 1.0\n"
106+"Content-Type: text/plain; charset=UTF-8\n"
107+"Content-Transfer-Encoding: 8bit\n"
108+"Plural-Forms: \n"
109+"X-Generator: Poedit 1.5.4\n"
110+
111+#. module: purchase_import
112+#: view:purchase.import.import.order:0
113+#: field:purchase.import.import.order,voucher_ids:0
114+msgid "Vouchers"
115+msgstr "Comprobantes"
116+
117+#. module: purchase_import
118+#: help:purchase.import.import.voucher,cif_dolars:0
119+#: help:purchase.import.import.voucher,cif_real:0
120+msgid "Cost, insurance and freight"
121+msgstr "Costo, seguro y flete"
122+
123+#. module: purchase_import
124+#: view:purchase.import.import.order:0 view:purchase.import.import.voucher:0
125+msgid "Group By..."
126+msgstr "Agrupar por..."
127+
128+#. module: purchase_import
129+#: field:purchase.import.import.order,freight_currency_id:0
130+msgid "Freight Currency"
131+msgstr "Divisa Flete"
132+
133+#. module: purchase_import
134+#: field:purchase.import.import.voucher,agent_number:0
135+msgid "Agent Number"
136+msgstr "Numero de agente"
137+
138+#. module: purchase_import
139+#: code:addons/purchase_import/purchase_import.py:300
140+#, python-format
141+msgid "The product %s does not have an Import Tariff"
142+msgstr "El producto %s no posee un arancel de importación"
143+
144+#. module: purchase_import
145+#: field:purchase.import.tariff,name:0
146+msgid "Tariff Name"
147+msgstr "Nombre de arancel"
148+
149+#. module: purchase_import
150+#: help:purchase.import.tariff,tariff_total:0
151+msgid "Total Taxes from import"
152+msgstr "Impuestos total de la importación"
153+
154+#. module: purchase_import
155+#: field:purchase.import.import.order,freight_total:0
156+msgid "Total Freight"
157+msgstr "Total de flete"
158+
159+#. module: purchase_import
160+#: field:purchase.import.import.voucher,number:0
161+msgid "Voucher Number"
162+msgstr "Número de comprobante"
163+
164+#. module: purchase_import
165+#: field:purchase.import.import.order.line,subtotal:0
166+msgid "Subtotal"
167+msgstr "Subtotal"
168+
169+#. module: purchase_import
170+#: model:ir.model,name:purchase_import.model_purchase_import_import_order
171+msgid " Import Orders "
172+msgstr "Ordenes de importación"
173+
174+#. module: purchase_import
175+#: field:purchase.import.product.import.history,last_price:0
176+msgid "Last Price"
177+msgstr "Último precio"
178+
179+#. module: purchase_import
180+#: field:purchase.import.import.order,notes:0
181+msgid "Notes"
182+msgstr "Notas"
183+
184+#. module: purchase_import
185+#: view:purchase.import.import.order:0
186+msgid "Import Orders which are in draft state"
187+msgstr "Ordenes de importación que se encuentran en estado borrador"
188+
189+#. module: purchase_import
190+#: model:ir.model,name:purchase_import.model_purchase_import_tax
191+#: field:product.product,tax_ids:0
192+msgid "Taxes"
193+msgstr "Impuestos"
194+
195+#. module: purchase_import
196+#: field:purchase.import.import.order,tax_currency_id:0
197+msgid "Tax Currency"
198+msgstr "Divisa de impuesto"
199+
200+#. module: purchase_import
201+#: field:purchase.import.import.order,tax_ids:0
202+#: field:purchase.import.import.order,tax_order_id:0
203+msgid "Taxes Invoice"
204+msgstr "Factura de impuestos"
205+
206+#. module: purchase_import
207+#: field:purchase.import.import.order,line_ids:0
208+msgid "Products"
209+msgstr "Productos"
210+
211+#. module: purchase_import
212+#: view:purchase.import.import.order:0
213+msgid "Import Orders which are in processed state"
214+msgstr "Ordenes de importación que se encuentran en estado procesado"
215+
216+#. module: purchase_import
217+#: view:purchase.import.import.order:0
218+#: selection:purchase.import.import.order,state:0
219+msgid "Cancelled"
220+msgstr "Cancelada"
221+
222+#. module: purchase_import
223+#: field:purchase.import.import.order,purchase_total:0
224+msgid "Purchase Total"
225+msgstr "Total de compra"
226+
227+#. module: purchase_import
228+#: view:purchase.import.import.order:0
229+#: field:purchase.import.import.order,origin_id:0
230+msgid "Origin"
231+msgstr "Origen"
232+
233+#. module: purchase_import
234+#: field:purchase.import.tax,name:0
235+msgid "Tax Name"
236+msgstr "Nombre del impuesto"
237+
238+#. module: purchase_import
239+#: view:purchase.import.product.import.history:0
240+msgid "Purchase Import History"
241+msgstr "Historial de compras de importación"
242+
243+#. module: purchase_import
244+#: field:purchase.import.tariff,tax_ids:0
245+msgid "Tax"
246+msgstr "Impuesto"
247+
248+#. module: purchase_import
249+#: field:purchase.import.import.voucher,net_weight:0
250+msgid "Net Weight"
251+msgstr "Peso neto"
252+
253+#. module: purchase_import
254+#: view:purchase.import.import.order:0
255+msgid "Purchase Information"
256+msgstr "Información de compra"
257+
258+#. module: purchase_import
259+#: view:purchase.import.import.order:0
260+msgid "Import Invoices"
261+msgstr "Facturas de importación"
262+
263+#. module: purchase_import
264+#: field:purchase.import.import.order.line,freight_percentage:0
265+#: field:purchase.import.product.import.history,freight_percentage:0
266+msgid "Freight (%)"
267+msgstr "Flete (%)"
268+
269+#. module: purchase_import
270+#: view:purchase.import.import.order:0
271+#: selection:purchase.import.import.order,state:0
272+msgid "Confirmed"
273+msgstr "Confirmada"
274+
275+#. module: purchase_import
276+#: view:purchase.import.import.order:0
277+msgid "Add a note..."
278+msgstr "Agregar una nota..."
279+
280+#. module: purchase_import
281+#: view:purchase.import.import.order:0
282+msgid "Confirm"
283+msgstr "Confirmar"
284+
285+#. module: purchase_import
286+#: field:purchase.import.import.order,sum_tax_value:0
287+msgid "Product Registered Taxes"
288+msgstr "Impuestos registrados del producto"
289+
290+#. module: purchase_import
291+#: view:purchase.import.import.order:0
292+#: field:purchase.import.import.order,state:0
293+msgid "State"
294+msgstr "Estado"
295+
296+#. module: purchase_import
297+#: field:purchase.import.import.order.line,product_uom_id:0
298+msgid "Units"
299+msgstr "Unidades"
300+
301+#. module: purchase_import
302+#: field:purchase.import.import.order,paid_total:0
303+msgid "Import Total"
304+msgstr "Total importación"
305+
306+#. module: purchase_import
307+#: view:purchase.import.import.order:0
308+msgid "Order Lines"
309+msgstr "Líneas de orden"
310+
311+#. module: purchase_import
312+#: view:purchase.import.import.voucher:0
313+#: field:purchase.import.import.voucher,type:0
314+msgid "Type"
315+msgstr "Tipo"
316+
317+#. module: purchase_import
318+#: view:product.product:0
319+msgid "Import History"
320+msgstr "Historial de importación"
321+
322+#. module: purchase_import
323+#: model:ir.actions.act_window,name:purchase_import.action_tariff_category
324+msgid "Tariff Category"
325+msgstr "Categoría de arancel"
326+
327+#. module: purchase_import
328+#: model:ir.actions.act_window,name:purchase_import.action_tariff
329+#: view:product.product:0 field:product.product,tariff_id:0
330+#: field:purchase.import.tax,tariff_id:0
331+msgid "Tariff"
332+msgstr "Arancel"
333+
334+#. module: purchase_import
335+#: field:purchase.import.product.import.history,import_total:0
336+msgid "Import Cost"
337+msgstr "Costo importación"
338+
339+#. module: purchase_import
340+#: field:purchase.import.product.import.history,freight_total:0
341+msgid "Freight Total"
342+msgstr "Total de flete"
343+
344+#. module: purchase_import
345+#: view:purchase.import.import.order:0
346+#: field:purchase.import.import.order,date_due:0
347+msgid "Date Limit"
348+msgstr "Fecha límite"
349+
350+#. module: purchase_import
351+#: view:purchase.import.tariff:0
352+msgid "Add a description..."
353+msgstr "Agregar una descripción"
354+
355+#. module: purchase_import
356+#: field:purchase.import.import.order.line,fob_cost:0
357+msgid "FoB Cost"
358+msgstr "Costo FoB"
359+
360+#. module: purchase_import
361+#: model:ir.ui.menu,name:purchase_import.menu_purchase_import_config
362+#: model:ir.ui.menu,name:purchase_import.menu_tariff
363+#: view:purchase.import.tariff:0
364+msgid "Tariffs"
365+msgstr "Aranceles"
366+
367+#. module: purchase_import
368+#: field:purchase.import.import.voucher,number_packages:0
369+msgid "Number of Packages"
370+msgstr "Numero de paquetes"
371+
372+#. module: purchase_import
373+#: field:purchase.import.import.voucher,bidder_id:0
374+msgid "Bidder"
375+msgstr "Declarante"
376+
377+#. module: purchase_import
378+#: field:purchase.import.import.voucher,weight:0
379+msgid "Weight"
380+msgstr "Peso"
381+
382+#. module: purchase_import
383+#: model:ir.model,name:purchase_import.model_purchase_import_product_import_history
384+#: field:product.product,import_history_ids:0
385+msgid "Product Import History"
386+msgstr "Historial de importación de producto"
387+
388+#. module: purchase_import
389+#: view:purchase.import.import.order:0
390+msgid ""
391+"Are you sure you want to process this order? You must be sure that all "
392+"products are already in stock"
393+msgstr ""
394+"¿Estás seguro que deseas procesar esta orden? Debes estar seguro que todos "
395+"los productos ya están en stock"
396+
397+#. module: purchase_import
398+#: field:purchase.import.import.order,freight_ids:0
399+msgid "Freight"
400+msgstr "Flete"
401+
402+#. module: purchase_import
403+#: field:purchase.import.import.order,freight_order_id:0
404+msgid "Freight Invoice"
405+msgstr "Factura de flete"
406+
407+#. module: purchase_import
408+#: field:purchase.import.import.voucher,cif_paid:0
409+msgid "CIF Paid"
410+msgstr "CIF pagado"
411+
412+#. module: purchase_import
413+#: view:purchase.import.import.order:0
414+msgid "Import Orders which are in confirmed state"
415+msgstr "Ordenes de importación que se encuetran en estado confirmado"
416+
417+#. module: purchase_import
418+#: view:purchase.import.import.voucher:0
419+msgid "Search Import Vouchers"
420+msgstr "Buscar comprobantes de importación"
421+
422+#. module: purchase_import
423+#: field:purchase.import.tariff,category_id:0
424+msgid "Category"
425+msgstr "Categoría"
426+
427+#. module: purchase_import
428+#: field:purchase.import.tax,value:0
429+msgid "Tax Percentage"
430+msgstr "Porcentaje de impuesto"
431+
432+#. module: purchase_import
433+#: field:purchase.import.import.voucher,cif_dolars:0
434+msgid "CIF Dolars"
435+msgstr "CIF dólares"
436+
437+#. module: purchase_import
438+#: view:purchase.import.import.order:0
439+#: selection:purchase.import.import.order,state:0
440+msgid "Draft"
441+msgstr "Borrador"
442+
443+#. module: purchase_import
444+#: field:product.product,tariff_total:0
445+#: field:purchase.import.import.order,tax_total:0
446+#: field:purchase.import.product.import.history,tax_total:0
447+#: view:purchase.import.tariff:0 field:purchase.import.tariff,tariff_total:0
448+msgid "Total Taxes"
449+msgstr "Total de impuestos"
450+
451+#. module: purchase_import
452+#: view:purchase.import.import.voucher:0
453+#: selection:purchase.import.import.voucher,type:0
454+msgid "Import"
455+msgstr "Importación"
456+
457+#. module: purchase_import
458+#: code:addons/purchase_import/purchase_import.py:439
459+#, python-format
460+msgid ""
461+"The order could not be processed. The product %s has a weight of 0 or the "
462+"product quantity equals to 0"
463+msgstr ""
464+"La orden no puede ser procesada. El producto %s tiene un peso de 0 o la "
465+"cantidad del producto equivale a 0"
466+
467+#. module: purchase_import
468+#: field:purchase.import.import.voucher,type_audit:0
469+msgid "Audit Type"
470+msgstr "Tipo de auditoría"
471+
472+#. module: purchase_import
473+#: field:purchase.import.import.order,total_weight:0
474+msgid "Total Weight (Kg)"
475+msgstr "Peso total (Kg)"
476+
477+#. module: purchase_import
478+#: field:purchase.import.import.order.line,import_taxes:0
479+msgid "Import Taxes"
480+msgstr "Impuestos de importación"
481+
482+#. module: purchase_import
483+#: field:purchase.import.import.order,company_id:0
484+msgid "Company"
485+msgstr "Compañía"
486+
487+#. module: purchase_import
488+#: view:purchase.import.import.voucher:0
489+#: field:purchase.import.import.voucher,date:0
490+#: field:purchase.import.product.import.history,date:0
491+msgid "Date"
492+msgstr "Fecha"
493+
494+#. module: purchase_import
495+#: field:purchase.import.import.order.line,tax_assigned:0
496+msgid "Assigned Taxes"
497+msgstr "Impuestos asignados"
498+
499+#. module: purchase_import
500+#: view:purchase.import.import.order:0
501+#: selection:purchase.import.import.order,state:0
502+msgid "Processed"
503+msgstr "Procesada"
504+
505+#. module: purchase_import
506+#: code:addons/purchase_import/purchase_import.py:299
507+#: code:addons/purchase_import/purchase_import.py:438
508+#, python-format
509+msgid "Error"
510+msgstr "Error"
511+
512+#. module: purchase_import
513+#: field:purchase.import.import.order.line,quantity:0
514+msgid "Quantity"
515+msgstr "Cantidad"
516+
517+#. module: purchase_import
518+#: field:purchase.import.import.order.line,code:0
519+#: field:purchase.import.tariff.category,code:0
520+#: field:purchase.import.tax,code:0
521+msgid "Code"
522+msgstr "Código"
523+
524+#. module: purchase_import
525+#: model:ir.model,name:purchase_import.model_purchase_import_tariff_category
526+#: model:ir.ui.menu,name:purchase_import.menu_tariff_category
527+#: view:purchase.import.tariff.category:0
528+msgid "Tariff Categories"
529+msgstr "Categoría de arancel"
530+
531+#. module: purchase_import
532+#: view:purchase.import.import.order:0
533+msgid "Process"
534+msgstr "Procesar"
535+
536+#. module: purchase_import
537+#: field:purchase.import.product.import.history,name:0
538+msgid "Number"
539+msgstr "Número"
540+
541+#. module: purchase_import
542+#: model:ir.model,name:purchase_import.model_purchase_import_import_order_line
543+#: view:purchase.import.import.order.line:0
544+msgid "Import Order Lines"
545+msgstr "Líneas de orden de importación"
546+
547+#. module: purchase_import
548+#: view:purchase.import.import.order:0
549+msgid "Cancel"
550+msgstr "Cancelar"
551+
552+#. module: purchase_import
553+#: model:ir.actions.act_window,name:purchase_import.action_import_voucher
554+msgid "Import Voucher"
555+msgstr "Comprobante de importación"
556+
557+#. module: purchase_import
558+#: field:purchase.import.import.voucher,currency_rate:0
559+msgid "Currency Rate"
560+msgstr "Tasa de cambio"
561+
562+#. module: purchase_import
563+#: field:purchase.import.import.order.line,tariff:0
564+msgid "Tariff (%)"
565+msgstr "Arancel (%)"
566+
567+#. module: purchase_import
568+#: model:ir.model,name:purchase_import.model_purchase_import_tariff
569+msgid "Import Tariffs"
570+msgstr "Aranceles de importación"
571+
572+#. module: purchase_import
573+#: field:purchase.import.import.order.line,unit_price:0
574+msgid "Unit Price"
575+msgstr "Precio unitario"
576+
577+#. module: purchase_import
578+#: view:purchase.import.import.order:0
579+msgid "Freight and Taxes"
580+msgstr "Flete e impuestos"
581+
582+#. module: purchase_import
583+#: field:purchase.import.import.order,imports_order_ids:0
584+msgid "Products Invoice"
585+msgstr "Factura de Productos"
586+
587+#. module: purchase_import
588+#: model:ir.model,name:purchase_import.model_product_product
589+#: field:purchase.import.import.order.line,product_id:0
590+#: view:purchase.import.import.voucher:0
591+#: field:purchase.import.product.import.history,product_id:0
592+msgid "Product"
593+msgstr "Producto"
594+
595+#. module: purchase_import
596+#: view:purchase.import.tariff:0 field:purchase.import.tariff,description:0
597+#: field:purchase.import.tariff.category,description:0
598+msgid "Description"
599+msgstr "Descripción"
600+
601+#. module: purchase_import
602+#: model:ir.actions.act_window,name:purchase_import.action_import_order
603+#: field:purchase.import.import.order.line,order_id:0
604+#: view:purchase.import.import.voucher:0
605+#: field:purchase.import.import.voucher,order_id:0
606+msgid "Import Order"
607+msgstr "Orden de importación"
608+
609+#. module: purchase_import
610+#: view:purchase.import.import.order:0
611+#: field:purchase.import.import.order,date_arrive:0
612+msgid "Arrive Date"
613+msgstr "Fecha de llegada"
614+
615+#. module: purchase_import
616+#: view:purchase.import.import.order:0
617+msgid "Search Import Orders"
618+msgstr "Buscar ordenes de importación"
619+
620+#. module: purchase_import
621+#: view:purchase.import.import.voucher:0
622+msgid "Payment"
623+msgstr "Pago"
624+
625+#. module: purchase_import
626+#: field:purchase.import.import.order,name:0
627+msgid "Order Number"
628+msgstr "Número de orden"
629+
630+#. module: purchase_import
631+#: field:purchase.import.tariff.category,name:0
632+msgid "Name"
633+msgstr "Nombre"
634+
635+#. module: purchase_import
636+#: code:addons/purchase_import/purchase_import.py:577
637+#, python-format
638+msgid "Draft Import Order"
639+msgstr "Orden de importación borrador"
640+
641+#. module: purchase_import
642+#: field:purchase.import.import.voucher,mode:0
643+msgid "Mode"
644+msgstr "Modo"
645+
646+#. module: purchase_import
647+#: field:purchase.import.import.order.line,tax_percentage:0
648+#: field:purchase.import.product.import.history,tax_percentage:0
649+msgid "Tax (%)"
650+msgstr "Impuesto (%)"
651+
652+#. module: purchase_import
653+#: model:ir.ui.menu,name:purchase_import.menu_import_order
654+#: view:purchase.import.import.order:0
655+msgid "Import Orders"
656+msgstr "Ordenes de importación"
657+
658+#. module: purchase_import
659+#: view:purchase.import.import.order:0
660+msgid "Import Orders which are in Cancelled state"
661+msgstr "Ordenes de importación que se encuentran en estado cancelado"
662+
663+#. module: purchase_import
664+#: field:purchase.import.import.order.line,freight_assigned:0
665+msgid "Assigned Freight"
666+msgstr "Flete asignado"
667+
668+#. module: purchase_import
669+#: model:ir.model,name:purchase_import.model_purchase_import_import_voucher
670+#: model:ir.ui.menu,name:purchase_import.menu_import_voucher
671+#: view:purchase.import.import.voucher:0
672+msgid "Import Vouchers"
673+msgstr "Comprobantes de importación"
674+
675+#. module: purchase_import
676+#: field:purchase.import.import.voucher,cif_real:0
677+msgid "CIF Real"
678+msgstr "CIF real"
679+
680+#. module: purchase_import
681+#: field:purchase.import.product.import.history,import_number:0
682+msgid "Import Number"
683+msgstr "Número de importación"
684+
685+#. module: purchase_import
686+#: view:purchase.import.import.order:0
687+#: field:purchase.import.import.order,date:0
688+msgid "Create Date"
689+msgstr "Fecha de creación"
690+
691+#. module: purchase_import
692+#: view:purchase.import.import.voucher:0
693+#: selection:purchase.import.import.voucher,type:0
694+msgid "Export"
695+msgstr "Exportación"
696+
697+#. module: purchase_import
698+#: model:ir.ui.menu,name:purchase_import.menu_purchase_import
699+msgid "Purchase Import"
700+msgstr "Compras de importación"
701+
702+#. module: purchase_import
703+#: view:product.product:0
704+msgid "Total"
705+msgstr "Total"
706+
707+#. module: purchase_import
708+#: field:purchase.import.import.voucher,regime:0
709+msgid "Regime"
710+msgstr "Régimen"
711
712=== added file 'purchase_import/i18n/purchase_import.pot'
713--- purchase_import/i18n/purchase_import.pot 1970-01-01 00:00:00 +0000
714+++ purchase_import/i18n/purchase_import.pot 2014-05-15 14:59:21 +0000
715@@ -0,0 +1,614 @@
716+# Translation of OpenERP Server.
717+# This file contains the translation of the following modules:
718+# * purchase_import
719+#
720+msgid ""
721+msgstr ""
722+"Project-Id-Version: OpenERP Server 7.0\n"
723+"Report-Msgid-Bugs-To: \n"
724+"POT-Creation-Date: 2014-05-13 17:40+0000\n"
725+"PO-Revision-Date: 2014-05-13 17:40+0000\n"
726+"Last-Translator: <>\n"
727+"Language-Team: \n"
728+"MIME-Version: 1.0\n"
729+"Content-Type: text/plain; charset=UTF-8\n"
730+"Content-Transfer-Encoding: \n"
731+"Plural-Forms: \n"
732+
733+#. module: purchase_import
734+#: view:purchase.import.import.order:0
735+#: field:purchase.import.import.order,voucher_ids:0
736+msgid "Vouchers"
737+msgstr ""
738+
739+#. module: purchase_import
740+#: help:purchase.import.import.voucher,cif_dolars:0
741+#: help:purchase.import.import.voucher,cif_real:0
742+msgid "Cost, insurance and freight"
743+msgstr ""
744+
745+#. module: purchase_import
746+#: view:purchase.import.import.order:0
747+#: view:purchase.import.import.voucher:0
748+msgid "Group By..."
749+msgstr ""
750+
751+#. module: purchase_import
752+#: field:purchase.import.import.order,freight_currency_id:0
753+msgid "Freight Currency"
754+msgstr ""
755+
756+#. module: purchase_import
757+#: field:purchase.import.import.voucher,agent_number:0
758+msgid "Agent Number"
759+msgstr ""
760+
761+#. module: purchase_import
762+#: code:addons/purchase_import/purchase_import.py:300
763+#, python-format
764+msgid "The product %s does not have an Import Tariff"
765+msgstr ""
766+
767+#. module: purchase_import
768+#: field:purchase.import.tariff,name:0
769+msgid "Tariff Name"
770+msgstr ""
771+
772+#. module: purchase_import
773+#: help:purchase.import.tariff,tariff_total:0
774+msgid "Total Taxes from import"
775+msgstr ""
776+
777+#. module: purchase_import
778+#: field:purchase.import.import.order,freight_total:0
779+msgid "Total Freight"
780+msgstr ""
781+
782+#. module: purchase_import
783+#: field:purchase.import.import.voucher,number:0
784+msgid "Voucher Number"
785+msgstr ""
786+
787+#. module: purchase_import
788+#: field:purchase.import.import.order.line,subtotal:0
789+msgid "Subtotal"
790+msgstr ""
791+
792+#. module: purchase_import
793+#: model:ir.model,name:purchase_import.model_purchase_import_import_order
794+msgid " Import Orders "
795+msgstr ""
796+
797+#. module: purchase_import
798+#: field:purchase.import.product.import.history,last_price:0
799+msgid "Last Price"
800+msgstr ""
801+
802+#. module: purchase_import
803+#: field:purchase.import.import.order,notes:0
804+msgid "Notes"
805+msgstr ""
806+
807+#. module: purchase_import
808+#: view:purchase.import.import.order:0
809+msgid "Import Orders which are in draft state"
810+msgstr ""
811+
812+#. module: purchase_import
813+#: model:ir.model,name:purchase_import.model_purchase_import_tax
814+#: field:product.product,tax_ids:0
815+msgid "Taxes"
816+msgstr ""
817+
818+#. module: purchase_import
819+#: field:purchase.import.import.order,tax_currency_id:0
820+msgid "Tax Currency"
821+msgstr ""
822+
823+#. module: purchase_import
824+#: field:purchase.import.import.order,tax_ids:0
825+#: field:purchase.import.import.order,tax_order_id:0
826+msgid "Taxes Invoice"
827+msgstr ""
828+
829+#. module: purchase_import
830+#: field:purchase.import.import.order,line_ids:0
831+msgid "Products"
832+msgstr ""
833+
834+#. module: purchase_import
835+#: view:purchase.import.import.order:0
836+msgid "Import Orders which are in processed state"
837+msgstr ""
838+
839+#. module: purchase_import
840+#: view:purchase.import.import.order:0
841+#: selection:purchase.import.import.order,state:0
842+msgid "Cancelled"
843+msgstr ""
844+
845+#. module: purchase_import
846+#: view:product.product:0
847+msgid "Total"
848+msgstr ""
849+
850+#. module: purchase_import
851+#: view:purchase.import.import.order:0
852+#: field:purchase.import.import.order,origin_id:0
853+msgid "Origin"
854+msgstr ""
855+
856+#. module: purchase_import
857+#: field:purchase.import.tax,name:0
858+msgid "Tax Name"
859+msgstr ""
860+
861+#. module: purchase_import
862+#: model:ir.model,name:purchase_import.model_purchase_import_tariff_category
863+#: model:ir.ui.menu,name:purchase_import.menu_tariff_category
864+#: view:purchase.import.tariff.category:0
865+msgid "Tariff Categories"
866+msgstr ""
867+
868+#. module: purchase_import
869+#: field:purchase.import.tariff,tax_ids:0
870+msgid "Tax"
871+msgstr ""
872+
873+#. module: purchase_import
874+#: field:purchase.import.import.voucher,net_weight:0
875+msgid "Net Weight"
876+msgstr ""
877+
878+#. module: purchase_import
879+#: view:purchase.import.import.order:0
880+msgid "Purchase Information"
881+msgstr ""
882+
883+#. module: purchase_import
884+#: view:purchase.import.import.order:0
885+msgid "Import Invoices"
886+msgstr ""
887+
888+#. module: purchase_import
889+#: field:purchase.import.import.order.line,freight_percentage:0
890+#: field:purchase.import.product.import.history,freight_percentage:0
891+msgid "Freight (%)"
892+msgstr ""
893+
894+#. module: purchase_import
895+#: view:purchase.import.import.order:0
896+#: selection:purchase.import.import.order,state:0
897+msgid "Confirmed"
898+msgstr ""
899+
900+#. module: purchase_import
901+#: view:purchase.import.import.order:0
902+msgid "Add a note..."
903+msgstr ""
904+
905+#. module: purchase_import
906+#: view:purchase.import.import.order:0
907+msgid "Confirm"
908+msgstr ""
909+
910+#. module: purchase_import
911+#: field:purchase.import.import.order,sum_tax_value:0
912+msgid "Product Registered Taxes"
913+msgstr ""
914+
915+#. module: purchase_import
916+#: view:purchase.import.import.order:0
917+#: field:purchase.import.import.order,state:0
918+msgid "State"
919+msgstr ""
920+
921+#. module: purchase_import
922+#: field:purchase.import.import.order.line,product_uom_id:0
923+msgid "Units"
924+msgstr ""
925+
926+#. module: purchase_import
927+#: field:purchase.import.import.order,paid_total:0
928+msgid "Import Total"
929+msgstr ""
930+
931+#. module: purchase_import
932+#: view:purchase.import.import.order:0
933+msgid "Order Lines"
934+msgstr ""
935+
936+#. module: purchase_import
937+#: view:purchase.import.import.voucher:0
938+#: field:purchase.import.import.voucher,type:0
939+msgid "Type"
940+msgstr ""
941+
942+#. module: purchase_import
943+#: code:addons/purchase_import/purchase_import.py:439
944+#, python-format
945+msgid "The order could not be processed. The product %s has a weight of 0 or the product quantity equals to 0"
946+msgstr ""
947+
948+#. module: purchase_import
949+#: view:product.product:0
950+msgid "Import History"
951+msgstr ""
952+
953+#. module: purchase_import
954+#: model:ir.actions.act_window,name:purchase_import.action_tariff_category
955+msgid "Tariff Category"
956+msgstr ""
957+
958+#. module: purchase_import
959+#: model:ir.actions.act_window,name:purchase_import.action_tariff
960+#: view:product.product:0
961+#: field:product.product,tariff_id:0
962+#: field:purchase.import.tax,tariff_id:0
963+msgid "Tariff"
964+msgstr ""
965+
966+#. module: purchase_import
967+#: field:purchase.import.product.import.history,import_total:0
968+msgid "Import Cost"
969+msgstr ""
970+
971+
972+#. module: purchase_import
973+#: field:purchase.import.product.import.history,freight_total:0
974+msgid "Freight Total"
975+msgstr ""
976+
977+#. module: purchase_import
978+#: view:purchase.import.import.order:0
979+#: field:purchase.import.import.order,date_due:0
980+msgid "Date Limit"
981+msgstr ""
982+
983+#. module: purchase_import
984+#: view:purchase.import.tariff:0
985+msgid "Add a description..."
986+msgstr ""
987+
988+#. module: purchase_import
989+#: field:purchase.import.import.order.line,fob_cost:0
990+msgid "FoB Cost"
991+msgstr ""
992+
993+#. module: purchase_import
994+#: model:ir.ui.menu,name:purchase_import.menu_purchase_import_config
995+#: model:ir.ui.menu,name:purchase_import.menu_tariff
996+#: view:purchase.import.tariff:0
997+msgid "Tariffs"
998+msgstr ""
999+
1000+#. module: purchase_import
1001+#: field:purchase.import.import.voucher,number_packages:0
1002+msgid "Number of Packages"
1003+msgstr ""
1004+
1005+#. module: purchase_import
1006+#: field:purchase.import.import.voucher,bidder_id:0
1007+msgid "Bidder"
1008+msgstr ""
1009+
1010+#. module: purchase_import
1011+#: field:purchase.import.import.voucher,weight:0
1012+msgid "Weight"
1013+msgstr ""
1014+
1015+#. module: purchase_import
1016+#: model:ir.model,name:purchase_import.model_purchase_import_product_import_history
1017+#: field:product.product,import_history_ids:0
1018+msgid "Product Import History"
1019+msgstr ""
1020+
1021+#. module: purchase_import
1022+#: view:purchase.import.import.order:0
1023+msgid "Are you sure you want to process this order? You must be sure that all products are already in stock"
1024+msgstr ""
1025+
1026+#. module: purchase_import
1027+#: field:purchase.import.import.order,freight_ids:0
1028+msgid "Freight"
1029+msgstr ""
1030+
1031+#. module: purchase_import
1032+#: field:purchase.import.import.order,freight_order_id:0
1033+msgid "Freight Invoice"
1034+msgstr ""
1035+
1036+#. module: purchase_import
1037+#: field:purchase.import.import.voucher,cif_paid:0
1038+msgid "CIF Paid"
1039+msgstr ""
1040+
1041+#. module: purchase_import
1042+#: view:purchase.import.import.order:0
1043+msgid "Import Orders which are in confirmed state"
1044+msgstr ""
1045+
1046+#. module: purchase_import
1047+#: view:purchase.import.import.voucher:0
1048+msgid "Search Import Vouchers"
1049+msgstr ""
1050+
1051+#. module: purchase_import
1052+#: field:purchase.import.tariff,category_id:0
1053+msgid "Category"
1054+msgstr ""
1055+
1056+#. module: purchase_import
1057+#: field:purchase.import.tax,value:0
1058+msgid "Tax Percentage"
1059+msgstr ""
1060+
1061+#. module: purchase_import
1062+#: field:purchase.import.import.voucher,cif_dolars:0
1063+msgid "CIF Dolars"
1064+msgstr ""
1065+
1066+#. module: purchase_import
1067+#: view:purchase.import.import.order:0
1068+#: selection:purchase.import.import.order,state:0
1069+msgid "Draft"
1070+msgstr ""
1071+
1072+#. module: purchase_import
1073+#: field:product.product,tariff_total:0
1074+#: field:purchase.import.import.order,tax_total:0
1075+#: field:purchase.import.product.import.history,tax_total:0
1076+#: view:purchase.import.tariff:0
1077+#: field:purchase.import.tariff,tariff_total:0
1078+msgid "Total Taxes"
1079+msgstr ""
1080+
1081+#. module: purchase_import
1082+#: view:purchase.import.import.voucher:0
1083+#: selection:purchase.import.import.voucher,type:0
1084+msgid "Import"
1085+msgstr ""
1086+
1087+#. module: purchase_import
1088+#: field:purchase.import.import.voucher,type_audit:0
1089+msgid "Audit Type"
1090+msgstr ""
1091+
1092+#. module: purchase_import
1093+#: field:purchase.import.import.order,total_weight:0
1094+msgid "Total Weight (Kg)"
1095+msgstr ""
1096+
1097+#. module: purchase_import
1098+#: field:purchase.import.import.order.line,import_taxes:0
1099+msgid "Import Taxes"
1100+msgstr ""
1101+
1102+#. module: purchase_import
1103+#: field:purchase.import.import.order,company_id:0
1104+msgid "Company"
1105+msgstr ""
1106+
1107+#. module: purchase_import
1108+#: view:purchase.import.import.voucher:0
1109+#: field:purchase.import.import.voucher,date:0
1110+#: field:purchase.import.product.import.history,date:0
1111+msgid "Date"
1112+msgstr ""
1113+
1114+#. module: purchase_import
1115+#: field:purchase.import.import.order.line,tax_assigned:0
1116+msgid "Assigned Taxes"
1117+msgstr ""
1118+
1119+#. module: purchase_import
1120+#: view:purchase.import.import.order:0
1121+#: selection:purchase.import.import.order,state:0
1122+msgid "Processed"
1123+msgstr ""
1124+
1125+#. module: purchase_import
1126+#: code:addons/purchase_import/purchase_import.py:299
1127+#: code:addons/purchase_import/purchase_import.py:438
1128+#, python-format
1129+msgid "Error"
1130+msgstr ""
1131+
1132+#. module: purchase_import
1133+#: field:purchase.import.import.order.line,quantity:0
1134+msgid "Quantity"
1135+msgstr ""
1136+
1137+#. module: purchase_import
1138+#: field:purchase.import.import.order.line,code:0
1139+#: field:purchase.import.tariff.category,code:0
1140+#: field:purchase.import.tax,code:0
1141+msgid "Code"
1142+msgstr ""
1143+
1144+#. module: purchase_import
1145+#: view:purchase.import.product.import.history:0
1146+msgid "Purchase Import History"
1147+msgstr ""
1148+
1149+#. module: purchase_import
1150+#: view:purchase.import.import.order:0
1151+msgid "Process"
1152+msgstr ""
1153+
1154+#. module: purchase_import
1155+#: field:purchase.import.product.import.history,name:0
1156+msgid "Number"
1157+msgstr ""
1158+
1159+#. module: purchase_import
1160+#: model:ir.model,name:purchase_import.model_purchase_import_import_order_line
1161+#: view:purchase.import.import.order.line:0
1162+msgid "Import Order Lines"
1163+msgstr ""
1164+
1165+#. module: purchase_import
1166+#: view:purchase.import.import.order:0
1167+msgid "Cancel"
1168+msgstr ""
1169+
1170+#. module: purchase_import
1171+#: model:ir.actions.act_window,name:purchase_import.action_import_voucher
1172+msgid "Import Voucher"
1173+msgstr ""
1174+
1175+#. module: purchase_import
1176+#: field:purchase.import.import.voucher,currency_rate:0
1177+msgid "Currency Rate"
1178+msgstr ""
1179+
1180+#. module: purchase_import
1181+#: field:purchase.import.import.order.line,tariff:0
1182+msgid "Tariff (%)"
1183+msgstr ""
1184+
1185+#. module: purchase_import
1186+#: model:ir.model,name:purchase_import.model_purchase_import_tariff
1187+msgid "Import Tariffs"
1188+msgstr ""
1189+
1190+#. module: purchase_import
1191+#: field:purchase.import.import.order.line,unit_price:0
1192+msgid "Unit Price"
1193+msgstr ""
1194+
1195+#. module: purchase_import
1196+#: view:purchase.import.import.order:0
1197+msgid "Freight and Taxes"
1198+msgstr ""
1199+
1200+#. module: purchase_import
1201+#: field:purchase.import.import.order,imports_order_ids:0
1202+msgid "Products Invoice"
1203+msgstr ""
1204+
1205+#. module: purchase_import
1206+#: model:ir.model,name:purchase_import.model_product_product
1207+#: field:purchase.import.import.order.line,product_id:0
1208+#: view:purchase.import.import.voucher:0
1209+#: field:purchase.import.product.import.history,product_id:0
1210+msgid "Product"
1211+msgstr ""
1212+
1213+#. module: purchase_import
1214+#: view:purchase.import.tariff:0
1215+#: field:purchase.import.tariff,description:0
1216+#: field:purchase.import.tariff.category,description:0
1217+msgid "Description"
1218+msgstr ""
1219+
1220+#. module: purchase_import
1221+#: model:ir.actions.act_window,name:purchase_import.action_import_order
1222+#: field:purchase.import.import.order.line,order_id:0
1223+#: view:purchase.import.import.voucher:0
1224+#: field:purchase.import.import.voucher,order_id:0
1225+msgid "Import Order"
1226+msgstr ""
1227+
1228+#. module: purchase_import
1229+#: view:purchase.import.import.order:0
1230+#: field:purchase.import.import.order,date_arrive:0
1231+msgid "Arrive Date"
1232+msgstr ""
1233+
1234+#. module: purchase_import
1235+#: view:purchase.import.import.order:0
1236+msgid "Search Import Orders"
1237+msgstr ""
1238+
1239+#. module: purchase_import
1240+#: view:purchase.import.import.voucher:0
1241+msgid "Payment"
1242+msgstr ""
1243+
1244+#. module: purchase_import
1245+#: field:purchase.import.import.order,name:0
1246+msgid "Order Number"
1247+msgstr ""
1248+
1249+#. module: purchase_import
1250+#: field:purchase.import.tariff.category,name:0
1251+msgid "Name"
1252+msgstr ""
1253+
1254+#. module: purchase_import
1255+#: code:addons/purchase_import/purchase_import.py:577
1256+#, python-format
1257+msgid "Draft Import Order"
1258+msgstr ""
1259+
1260+#. module: purchase_import
1261+#: field:purchase.import.import.voucher,mode:0
1262+msgid "Mode"
1263+msgstr ""
1264+
1265+#. module: purchase_import
1266+#: field:purchase.import.import.order.line,tax_percentage:0
1267+#: field:purchase.import.product.import.history,tax_percentage:0
1268+msgid "Tax (%)"
1269+msgstr ""
1270+
1271+#. module: purchase_import
1272+#: model:ir.ui.menu,name:purchase_import.menu_import_order
1273+#: view:purchase.import.import.order:0
1274+msgid "Import Orders"
1275+msgstr ""
1276+
1277+#. module: purchase_import
1278+#: view:purchase.import.import.order:0
1279+msgid "Import Orders which are in Cancelled state"
1280+msgstr ""
1281+
1282+#. module: purchase_import
1283+#: field:purchase.import.import.order.line,freight_assigned:0
1284+msgid "Assigned Freight"
1285+msgstr ""
1286+
1287+#. module: purchase_import
1288+#: model:ir.model,name:purchase_import.model_purchase_import_import_voucher
1289+#: model:ir.ui.menu,name:purchase_import.menu_import_voucher
1290+#: view:purchase.import.import.voucher:0
1291+msgid "Import Vouchers"
1292+msgstr ""
1293+
1294+#. module: purchase_import
1295+#: field:purchase.import.import.voucher,cif_real:0
1296+msgid "CIF Real"
1297+msgstr ""
1298+
1299+#. module: purchase_import
1300+#: field:purchase.import.product.import.history,import_number:0
1301+msgid "Import Number"
1302+msgstr ""
1303+
1304+#. module: purchase_import
1305+#: view:purchase.import.import.order:0
1306+#: field:purchase.import.import.order,date:0
1307+msgid "Create Date"
1308+msgstr ""
1309+
1310+#. module: purchase_import
1311+#: view:purchase.import.import.voucher:0
1312+#: selection:purchase.import.import.voucher,type:0
1313+msgid "Export"
1314+msgstr ""
1315+
1316+#. module: purchase_import
1317+#: model:ir.ui.menu,name:purchase_import.menu_purchase_import
1318+msgid "Purchase Import"
1319+msgstr ""
1320+
1321+#. module: purchase_import
1322+#: field:purchase.import.import.voucher,regime:0
1323+msgid "Regime"
1324+msgstr ""
1325+
1326+#. module: purchase_import
1327+#: field:purchase.import.import.order,purchase_total:0
1328+msgid "Purchase Total"
1329+msgstr ""
1330
1331=== added file 'purchase_import/product.py'
1332--- purchase_import/product.py 1970-01-01 00:00:00 +0000
1333+++ purchase_import/product.py 2014-05-15 14:59:21 +0000
1334@@ -0,0 +1,33 @@
1335+# -*- coding: utf-8 -*-
1336+##############################################################################
1337+#
1338+# OpenERP, Open Source Management Solution
1339+# Original Module by SIESA (<http://www.siesacr.com>)
1340+# Refactored by CLEARCORP S.A. (<http://clearcorp.co.cr>)
1341+#
1342+# This program is free software: you can redistribute it and/or modify
1343+# it under the terms of the GNU Affero General Public License as
1344+# published by the Free Software Foundation, either version 3 of the
1345+# license, or (at your option) any later version.
1346+#
1347+# This program is distributed in the hope that it will be useful,
1348+# but WITHOUT ANY WARRANTY; without even the implied warranty of
1349+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1350+# GNU Affero General Public License for more details.
1351+#
1352+# You should have received a copy of the GNU Affero General Public License
1353+# along with this program. If not, see <http://www.gnu.org/licenses/>.
1354+##############################################################################
1355+
1356+from openerp.osv import osv, fields
1357+
1358+class Product(osv.Model):
1359+
1360+ _inherit = 'product.product'
1361+
1362+ _columns = {
1363+ 'tariff_id' : fields.many2one('purchase.import.tariff', 'Tariff'),
1364+ 'tariff_total': fields.related('tariff_id','tariff_total',type='float',string='Total Taxes', readonly=True),
1365+ 'tax_ids': fields.related('tariff_id','tax_ids',type='one2many',relation='purchase.import.tax',string='Taxes', readonly=True),
1366+ 'import_history_ids': fields.one2many('purchase.import.product.import.history', 'product_id', 'Product Import History'),
1367+ }
1368\ No newline at end of file
1369
1370=== added file 'purchase_import/purchase_import.py'
1371--- purchase_import/purchase_import.py 1970-01-01 00:00:00 +0000
1372+++ purchase_import/purchase_import.py 2014-05-15 14:59:21 +0000
1373@@ -0,0 +1,633 @@
1374+# -*- coding: utf-8 -*-
1375+##############################################################################
1376+#
1377+# OpenERP, Open Source Management Solution
1378+# Original Module by SIESA (<http://www.siesacr.com>)
1379+# Refactored by CLEARCORP S.A. (<http://clearcorp.co.cr>)
1380+#
1381+# This program is free software: you can redistribute it and/or modify
1382+# it under the terms of the GNU Affero General Public License as
1383+# published by the Free Software Foundation, either version 3 of the
1384+# license, or (at your option) any later version.
1385+#
1386+# This program is distributed in the hope that it will be useful,
1387+# but WITHOUT ANY WARRANTY; without even the implied warranty of
1388+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1389+# GNU Affero General Public License for more details.
1390+#
1391+# You should have received a copy of the GNU Affero General Public License
1392+# along with this program. If not, see <http://www.gnu.org/licenses/>.
1393+##############################################################################
1394+
1395+from datetime import date, datetime
1396+from openerp.osv import osv, fields
1397+from openerp.tools.translate import _
1398+import openerp.addons.decimal_precision as dp
1399+
1400+class ProductImportHistory(osv.Model):
1401+ """Product Import History"""
1402+
1403+ _name = 'purchase.import.product.import.history'
1404+
1405+ _description = __doc__
1406+
1407+ _columns = {
1408+ 'name': fields.char('Number', size=128, readonly=True),
1409+ 'import_number': fields.char('Import Number', size=128, readonly=True),
1410+ 'date' : fields.datetime('Date', readonly=True),
1411+ 'product_id':fields.many2one('product.product', 'Product', readonly=True),
1412+ 'last_price': fields.float('Last Price', readonly=True),
1413+ 'tax_percentage': fields.float('Tax (%)', readonly=True),
1414+ 'tax_total': fields.float('Total Taxes', readonly=True),
1415+ 'freight_percentage': fields.float('Freight (%)', readonly=True),
1416+ 'freight_total': fields.float('Freight Total', readonly=True),
1417+ 'import_total': fields.float('Import Cost', readonly=True),
1418+ }
1419+
1420+class TariffCategory(osv.Model):
1421+ """Tariff Categories"""
1422+
1423+ _name = 'purchase.import.tariff.category'
1424+
1425+ _description = __doc__
1426+
1427+ _order = 'code asc'
1428+
1429+ _columns = {
1430+ 'code': fields.char('Code', size=32, required=True),
1431+ 'name': fields.char('Name', size=128, required=True),
1432+ 'description': fields.text('Description'),
1433+ }
1434+
1435+class Tax(osv.Model):
1436+ """Taxes"""
1437+
1438+ _name = 'purchase.import.tax'
1439+
1440+ _description = __doc__
1441+
1442+ _order = 'code asc'
1443+
1444+ _columns = {
1445+ 'code': fields.char('Code', size=32, required=True),
1446+ 'name': fields.char('Tax Name', size=128, required=True),
1447+ 'value': fields.float('Tax Percentage', required=True),
1448+ 'tariff_id' : fields.many2one('purchase.import.tariff', string='Tariff'),
1449+ }
1450+
1451+class Tariff(osv.Model):
1452+ """Import Tariffs"""
1453+
1454+ _name = 'purchase.import.tariff'
1455+
1456+ _description = __doc__
1457+
1458+ def _compute_tariff_total(self, cr, uid, ids, field_name, arg, context=None):
1459+ """Compute total taxes
1460+ @param self: The object pointer.
1461+ @param cr: A database cursor
1462+ @param uid: ID of the user currently logged in
1463+ @param ids: List of IDs selected
1464+ @param field_name: The name of the field to be calculated
1465+ @param arg: A standard dictionary
1466+ @param context: A standard dictionary
1467+ @return: A dictionary with the form id: value
1468+ """
1469+ res = {}
1470+ for tariff in self.browse(cr, uid, ids):
1471+ total_tax = 0.0
1472+ # Sum value from all related taxes
1473+ for tax in tariff.tax_ids:
1474+ total_tax += tax.value
1475+ res[tariff.id] = total_tax
1476+ return res
1477+
1478+ _columns = {
1479+ 'name': fields.char('Tariff Name', size=128, required=True),
1480+ 'description': fields.text('Description'),
1481+ 'category_id' : fields.many2one('purchase.import.tariff.category', 'Category'),
1482+ 'tax_ids': fields.one2many('purchase.import.tax', 'tariff_id', 'Tax'),
1483+ 'tariff_total': fields.function(_compute_tariff_total, string='Total Taxes', type='float',help='Total Taxes from import'),
1484+ }
1485+
1486+class ImportOrderLine(osv.Model):
1487+ """Import Order Lines"""
1488+
1489+ _name = 'purchase.import.import.order.line'
1490+
1491+ _description = __doc__
1492+
1493+ def _compute_import_taxes(self, cr, uid, ids, field_name, arg, context=None):
1494+ """Compute import taxes
1495+ @param self: The object pointer.
1496+ @param cr: A database cursor
1497+ @param uid: ID of the user currently logged in
1498+ @param ids: List of IDs selected
1499+ @param field_name: The name of the field to be calculated
1500+ @param arg: A standard dictionary
1501+ @param context: A standard dictionary
1502+ @return: A dictionary with the form id: value
1503+ """
1504+ res = {}
1505+ for line in self.browse(cr, uid, ids, context=context):
1506+ res[line.id] = line.subtotal * (line.tariff / 100)
1507+ return res
1508+
1509+ def _compute_tax_percentage(self, cr, uid, ids, field_name, arg, context=None):
1510+ """Compute tax percentage
1511+ @param self: The object pointer.
1512+ @param cr: A database cursor
1513+ @param uid: ID of the user currently logged in
1514+ @param ids: List of IDs selected
1515+ @param field_name: The name of the field to be calculated
1516+ @param arg: A standard dictionary
1517+ @param context: A standard dictionary
1518+ @return: A dictionary with the form id: value
1519+ """
1520+ res = {}
1521+ for line in self.browse(cr, uid, ids, context=context):
1522+ res[line.id] = (line.import_taxes / line.order_id.sum_tax_value) * 100
1523+ return res
1524+
1525+ def _compute_tax_assigned(self, cr, uid, ids, field_name, arg, context=None):
1526+ """Compute tax assigned
1527+ @param self: The object pointer.
1528+ @param cr: A database cursor
1529+ @param uid: ID of the user currently logged in
1530+ @param ids: List of IDs selected
1531+ @param field_name: The name of the field to be calculated
1532+ @param arg: A standard dictionary
1533+ @param context: A standard dictionary
1534+ @return: A dictionary with the form id: value
1535+ """
1536+ res = {}
1537+ for line in self.browse(cr, uid, ids, context=context):
1538+ res[line.id] = (line.order_id.tax_total * line.tax_percentage) / 100
1539+ return res
1540+
1541+ def _compute_freight_percentage(self, cr, uid, ids, field_name, arg, context=None):
1542+ """Compute freight percentage
1543+ @param self: The object pointer.
1544+ @param cr: A database cursor
1545+ @param uid: ID of the user currently logged in
1546+ @param ids: List of IDs selected
1547+ @param field_name: The name of the field to be calculated
1548+ @param arg: A standard dictionary
1549+ @param context: A standard dictionary
1550+ @return: A dictionary with the form id: value
1551+ """
1552+ res = {}
1553+ for line in self.browse(cr, uid, ids, context=context):
1554+ uom = 1.0
1555+ if line.product_uom_id.uom_type =='reference':
1556+ uom = 1.0
1557+ else:
1558+ if line.product_uom_id.uom_type =='bigger':
1559+ uom = line.product_uom_id.factor_inv
1560+ else:
1561+ uom = line.product_uom_id.factor
1562+ res[line.id] = ((line.product_id.weight * uom * line.quantity) / line.order_id.total_weight) * 100
1563+ return res
1564+
1565+ def _compute_freight_assigned(self, cr, uid, ids, field_name, arg, context=None):
1566+ """Compute freight assigned
1567+ @param self: The object pointer.
1568+ @param cr: A database cursor
1569+ @param uid: ID of the user currently logged in
1570+ @param ids: List of IDs selected
1571+ @param field_name: The name of the field to be calculated
1572+ @param arg: A standard dictionary
1573+ @param context: A standard dictionary
1574+ @return: A dictionary with the form id: value
1575+ """
1576+ res = {}
1577+ for line in self.browse(cr, uid, ids, context=context):
1578+ res[line.id] = (line.order_id.freight_total * line.freight_percentage) / 100
1579+ return res
1580+
1581+ def _compute_product_tariff(self, cr, uid, ids, field_name, arg, context=None):
1582+ """Compute the product tariff
1583+ @param self: The object pointer.
1584+ @param cr: A database cursor
1585+ @param uid: ID of the user currently logged in
1586+ @param ids: List of IDs selected
1587+ @param field_name: The name of the field to be calculated
1588+ @param arg: A standard dictionary
1589+ @param context: A standard dictionary
1590+ @return: A dictionary with the form id: value
1591+ """
1592+ res = {}
1593+ for line in self.browse(cr, uid, ids, context=context):
1594+ res[line.id] = line.product_id.tariff_total
1595+ return res
1596+
1597+ _rec_name = 'code'
1598+
1599+ _columns = {
1600+ 'code': fields.char('Code',size=128),
1601+ 'quantity': fields.float('Quantity',digits_compute= dp.get_precision('Product UoM')),
1602+ 'unit_price': fields.float('Unit Price',digits_compute= dp.get_precision('Purchase Price')),
1603+ 'subtotal': fields.float('Subtotal',digits_compute= dp.get_precision('Purchase Price')),
1604+ 'fob_cost': fields.float('FoB Cost',digits_compute= dp.get_precision('Purchase Price')),
1605+ 'product_id':fields.many2one('product.product', 'Product'),
1606+ 'product_uom_id':fields.many2one('product.uom', 'Units'),
1607+ 'order_id':fields.many2one('purchase.import.import.order', 'Import Order'),
1608+ 'import_taxes': fields.function(_compute_import_taxes, type='float', digits_compute= dp.get_precision('Purchase Price'), string='Import Taxes'),
1609+ 'tax_percentage': fields.function(_compute_tax_percentage, type='float', digits_compute= dp.get_precision('Purchase Price'), string='Tax (%)'),
1610+ 'tax_assigned': fields.function(_compute_tax_assigned, type='float',digits_compute= dp.get_precision('Purchase Price'), string='Assigned Taxes'),
1611+ 'freight_percentage': fields.function(_compute_freight_percentage, type='float',digits_compute= dp.get_precision('Purchase Price'), string='Freight (%)'),
1612+ 'freight_assigned': fields.function(_compute_freight_assigned, type='float',digits_compute= dp.get_precision('Purchase Price'), string='Assigned Freight'),
1613+ 'tariff': fields.function(_compute_product_tariff, type='float',digits_compute= dp.get_precision('Purchase Price'), string='Tariff (%)'),
1614+ }
1615+
1616+class ImportOrder(osv.Model):
1617+ """ Import Orders """
1618+
1619+ _name = 'purchase.import.import.order'
1620+
1621+ _description = __doc__
1622+
1623+ def _compute_total_weight(self, cr, uid, ids, field_name, arg, context=None):
1624+ """Compute total weight
1625+ @param self: The object pointer.
1626+ @param cr: A database cursor
1627+ @param uid: ID of the user currently logged in
1628+ @param ids: List of IDs selected
1629+ @param field_name: The name of the field to be calculated
1630+ @param arg: A standard dictionary
1631+ @param context: A standard dictionary
1632+ @return: A dictionary with the form id: value
1633+ """
1634+ res = {}
1635+ for order in self.browse(cr, uid, ids, context=context):
1636+ total_weight = 0.0
1637+ line_qty = 0
1638+ uom = 1.0
1639+ for line in order.line_ids:
1640+ # Get the product unit of measure
1641+ if line.product_uom_id.uom_type =='reference':
1642+ uom = 1.0
1643+ else:
1644+ if line.product_uom_id.uom_type =='bigger':
1645+ uom = line.product_uom_id.factor_inv
1646+ else:
1647+ if line.product_uom_id.factor:
1648+ uom = line.product_uom_id.factor
1649+ line_qty = line.quantity * uom
1650+ product = self.pool.get('product.product').browse(cr, uid, line.product_id.id, context=context)
1651+ total_weight = total_weight + (line_qty * product.weight)
1652+ res[order.id] = total_weight
1653+ return res
1654+
1655+ def _compute_tax_sum(self, cr, uid, ids, field_name, arg, context=None):
1656+ """Compute total tax sum
1657+ @param self: The object pointer.
1658+ @param cr: A database cursor
1659+ @param uid: ID of the user currently logged in
1660+ @param ids: List of IDs selected
1661+ @param field_name: The name of the field to be calculated
1662+ @param arg: A standard dictionary
1663+ @param context: A standard dictionary
1664+ @return: A dictionary with the form id: value
1665+ """
1666+ res = {}
1667+ total_tax_value = 0.0
1668+ for order in self.browse(cr, uid, ids, context=context):
1669+ for line in order.line_ids:
1670+ product = self.pool.get('product.product').browse(cr, uid, line.product_id.id, context=context)
1671+ if not product.tariff_id:
1672+ raise osv.except_osv(_('Error'),
1673+ _('The product %s does not have an Import Tariff') % (product.name))
1674+ total_tax_value = total_tax_value + line.import_taxes
1675+ res[order.id] = total_tax_value
1676+ return res
1677+
1678+ def _compute_purchase_total(self, cr, uid, ids, field_name, arg, context=None):
1679+ """Compute purchase total
1680+ @param self: The object pointer.
1681+ @param cr: A database cursor
1682+ @param uid: ID of the user currently logged in
1683+ @param ids: List of IDs selected
1684+ @param field_name: The name of the field to be calculated
1685+ @param arg: A standard dictionary
1686+ @param context: A standard dictionary
1687+ @return: A dictionary with the form id: value
1688+ """
1689+ res = {}
1690+ total = 0.0
1691+ for imports in self.browse(cr, uid, ids, context=context):
1692+ # Get the currency from company
1693+ currency = imports.company_id.currency_id
1694+ for order in imports.imports_order_ids:
1695+ # Get base the exchange rate
1696+ if order.currency_id.id != currency.id:
1697+ currency_obj = self.pool.get('res.currency')
1698+ import_currency_rate = currency_obj.get_exchange_rate(cr, uid, order.currency_id,
1699+ currency, order.date_invoice, context=context)
1700+ else:
1701+ import_currency_rate = 1
1702+ total = total + (order.amount_untaxed * import_currency_rate)
1703+ res[imports.id] = total
1704+ return res
1705+
1706+ def _compute_tax_total(self, cr, uid, ids, field_name, arg, context=None):
1707+ """Compute tax total
1708+ @param self: The object pointer.
1709+ @param cr: A database cursor
1710+ @param uid: ID of the user currently logged in
1711+ @param ids: List of IDs selected
1712+ @param field_name: The name of the field to be calculated
1713+ @param arg: A standard dictionary
1714+ @param context: A standard dictionary
1715+ @return: A dictionary with the form id: value
1716+ """
1717+ res = {}
1718+ currency = 1
1719+ total_tax = 0.0
1720+ for order in self.browse(cr, uid, ids, context=context):
1721+ # Get the currency from company
1722+ currency = order.company_id.currency_id
1723+ if order.tax_order_id:
1724+ if order.tax_order_id.currency_id.id != currency.id:
1725+ currency_obj = self.pool.get('res.currency')
1726+ import_currency_rate = currency_obj.get_exchange_rate(cr, uid, order.tax_order_id.currency_id,
1727+ currency, order.tax_order_id.date_invoice, context=context)
1728+ else:
1729+ import_currency_rate = 1
1730+ for line in order.tax_ids:
1731+ total_tax = total_tax + line.price_subtotal * import_currency_rate
1732+ else:
1733+ total_tax = 0.0
1734+ res[order.id]= total_tax
1735+ return res
1736+
1737+ def _compute_freight_total(self, cr, uid, ids, field_name, arg, context=None):
1738+ """Compute freight total
1739+ @param self: The object pointer.
1740+ @param cr: A database cursor
1741+ @param uid: ID of the user currently logged in
1742+ @param ids: List of IDs selected
1743+ @param field_name: The name of the field to be calculated
1744+ @param arg: A standard dictionary
1745+ @param context: A standard dictionary
1746+ @return: A dictionary with the form id: value
1747+ """
1748+ res = {}
1749+ for order in self.browse(cr, uid, ids, context=context):
1750+ # Get the currency from company
1751+ currency = order.company_id.currency_id
1752+ if order.freight_order_id:
1753+ # Get base the exchange rate
1754+ if order.freight_order_id.currency_id.id != currency.id:
1755+ currency_obj = self.pool.get('res.currency')
1756+ import_currency_rate = currency_obj.get_exchange_rate(cr, uid, order.freight_order_id.currency_id,
1757+ currency, order.freight_order_id.date_invoice, context=context)
1758+ else:
1759+ import_currency_rate = 1
1760+ res[order.id] = (order.freight_order_id.amount_untaxed) * import_currency_rate
1761+ else:
1762+ res[order.id] = 0.0
1763+ return res
1764+
1765+ def _compute_paid_total(self, cr, uid, ids, field_name, arg, context=None):
1766+ """Compute paid total
1767+ @param self: The object pointer.
1768+ @param cr: A database cursor
1769+ @param uid: ID of the user currently logged in
1770+ @param ids: List of IDs selected
1771+ @param field_name: The name of the field to be calculated
1772+ @param arg: A standard dictionary
1773+ @param context: A standard dictionary
1774+ @return: A dictionary with the form id: value
1775+ """
1776+ res = {}
1777+ for order in self.browse(cr, uid, ids, context=context):
1778+ res[order.id] = order.tax_total+ order.freight_total
1779+ return res
1780+
1781+ def onchange_freight_order(self, cr, uid, ids, freight_order_id, context=None):
1782+ vals = {}
1783+ if freight_order_id:
1784+ print "wasdasd"
1785+ invoice_obj = self.pool.get('account.invoice')
1786+ invoice = invoice_obj.browse(cr, uid, freight_order_id, context=context)
1787+ vals['freight_currency_id'] = invoice.currency_id.id
1788+ else:
1789+ vals['freight_currency_id'] = False
1790+ return {'value': vals}
1791+
1792+ def onchange_tax_order(self, cr, uid, ids, tax_order_id, context=None):
1793+ vals = {}
1794+ if tax_order_id:
1795+ invoice_obj = self.pool.get('account.invoice')
1796+ invoice = invoice_obj.browse(cr, uid, tax_order_id, context=context)
1797+ vals['tax_currency_id'] = invoice.currency_id.id
1798+ else:
1799+ vals['tax_currency_id'] = False
1800+ return {'value': vals}
1801+
1802+ def action_set_average_price(self, cr, uid, ids, context=None):
1803+ res = {}
1804+ for imports in self.browse(cr, uid, ids, context=context):
1805+ total_weight = 0
1806+ order_tax = 0
1807+ product_freight = 0
1808+ product_tax = 0
1809+ for line in imports.line_ids:
1810+ if line.quantity == 0 or line.product_id.weight == 0.0:
1811+ raise osv.except_osv(_('Error'),
1812+ _('The order could not be processed. The product %s has a '
1813+ 'weight of 0 or the product quantity equals to 0') % (product.name))
1814+ #Update price per weight
1815+ if imports.freight_order_id:
1816+ product_freight = line.freight_assigned
1817+ #Update price per taxes
1818+ if imports.tax_order_id:
1819+ product_tax= line.tax_assigned
1820+ add_cost = (product_tax + product_freight) / line.product_id.qty_available
1821+ cost = add_cost + line.product_id.standard_price
1822+
1823+ self.pool.get('purchase.import.product.import.history').create(cr, uid, {
1824+ 'name': self.pool.get('ir.sequence').get(cr, uid, 'purchase.import.proimphis'),
1825+ 'import_number': imports.name,
1826+ 'product_id': line.product_id.id,
1827+ 'last_price': line.product_id.standard_price,
1828+ 'tax_percentage': line.tax_percentage,
1829+ 'tax_total': line.tax_assigned / line.quantity,
1830+ 'freight_percentage': line.freight_percentage,
1831+ 'freight_total': line.freight_assigned / line.quantity,
1832+ 'import_total': add_cost,
1833+ }, context=context)
1834+ if line.product_id.cost_method == 'average':
1835+ line.product_id.write({
1836+ 'standard_price': cost
1837+ }, context=context)
1838+ self.write(cr, uid, ids, {'state': 'done'}, context=context)
1839+ return True
1840+
1841+ def create(self, cr, uid, values, context=None):
1842+ res = []
1843+ tax_ids = []
1844+ inv_obj = self.pool.get('account.invoice')
1845+ values['name'] = self.pool.get('ir.sequence').get(cr, uid, 'purchase.import.impord')
1846+ invoices = values['imports_order_ids']
1847+ taxes = values['tax_order_id']
1848+ if taxes:
1849+ for inv in inv_obj.browse(cr, uid, [taxes] , context=context):
1850+ for line in inv.invoice_line:
1851+ tax_ids.append(line.id)
1852+ values['tax_ids'] = [[6,False,tax_ids]]
1853+ res= super(ImportOrder, self).create(cr, uid, values, context=context)
1854+ # Get the currency from company
1855+ company_obj = self.pool.get('res.company')
1856+ currency = company_obj.browse(cr, uid, values['company_id'], context=context).currency_id
1857+ for inv in inv_obj.browse(cr, uid, invoices[0][2]):
1858+ # Get base the exchange rate
1859+ if inv.currency_id.id != currency.id:
1860+ currency_obj = self.pool.get('res.currency')
1861+ import_currency_rate = currency_obj.get_exchange_rate(cr, uid, inv.currency_id,
1862+ currency, inv.date_invoice, context=context)
1863+ else:
1864+ import_currency_rate = 1
1865+ for line in inv.invoice_line:
1866+ self.pool.get('purchase.import.import.order.line').create(cr, uid, {
1867+ 'code': self.pool.get('ir.sequence').get(cr, uid, 'purchase.import.impordlin'),
1868+ 'quantity': line.quantity,
1869+ 'product_id': line.product_id.id,
1870+ 'product_uom_id': line.uos_id.id,
1871+ 'fob_cost': line.price_unit,
1872+ 'unit_price': line.price_unit * import_currency_rate,
1873+ 'subtotal': line.price_subtotal * import_currency_rate,
1874+ 'order_id': res,
1875+ }, context=context)
1876+ return res
1877+
1878+ def write(self, cr, uid, ids, values, context=None):
1879+ for order in self.browse(cr, uid, ids, context=context):
1880+ tax_ids = []
1881+ import_currency_rate = 1
1882+ inv_obj = self.pool.get('account.invoice')
1883+ line_obj = self.pool.get('purchase.import.import.order.line')
1884+ if 'tax_order_id' in values:
1885+ taxes = values['tax_order_id']
1886+ if taxes:
1887+ for inv in inv_obj.browse(cr, uid, [taxes], context=context):
1888+ for line in inv.invoice_line:
1889+ tax_ids.append(line.id)
1890+ values['tax_ids'] = [[6,False,tax_ids]]
1891+ else:
1892+ values['tax_id'] = [[6,False,[]]]
1893+ super(ImportOrder, self).write(cr, uid, ids, values, context=context)
1894+ for line in order.line_ids:
1895+ line_obj.unlink(cr, uid, line.id)
1896+ order = self.browse(cr, uid, order.id, context=context)
1897+ # Get the company currency
1898+ currency = order.company_id.currency_id
1899+ for inv in order.imports_order_ids:
1900+ # Get base the exchange rate
1901+ if inv.currency_id.id != currency.id:
1902+ currency_obj = self.pool.get('res.currency')
1903+ import_currency_rate = currency_obj.get_exchange_rate(cr, uid, inv.currency_id,
1904+ currency, inv.date_invoice, context=context)
1905+ else:
1906+ import_currency_rate = 1
1907+ for line in inv.invoice_line:
1908+ self.pool.get('purchase.import.import.order.line').create(cr, uid, {
1909+ 'code': self.pool.get('ir.sequence').get(cr, uid, 'purchase.import.impordlin'),
1910+ 'quantity': line.quantity,
1911+ 'product_id': line.product_id.id,
1912+ 'product_uom_id': line.uos_id.id,
1913+ 'fob_cost': line.price_unit,
1914+ 'unit_price': line.price_unit * import_currency_rate,
1915+ 'subtotal': line.price_subtotal * import_currency_rate,
1916+ 'order_id': order.id,
1917+ }, context=context)
1918+ return True
1919+
1920+ _order = 'date desc'
1921+
1922+ _columns = {
1923+ 'name': fields.char('Order Number', size=128, readonly=True),
1924+ 'company_id': fields.many2one('res.company', 'Company', required=True,),
1925+ 'voucher_ids': fields.one2many('purchase.import.import.voucher', 'order_id', 'Vouchers'),
1926+ 'origin_id' : fields.many2one('res.country', 'Origin', required=True),
1927+ 'freight_order_id':fields.many2one('account.invoice', 'Freight Invoice'),
1928+ 'tax_order_id':fields.many2one('account.invoice', 'Taxes Invoice'),
1929+ 'date_arrive' : fields.date('Arrive Date'),
1930+ 'date_due' : fields.date('Date Limit'),
1931+ 'total_weight': fields.function(_compute_total_weight, type='float', string='Total Weight (Kg)'),
1932+ 'sum_tax_value': fields.function(_compute_tax_sum, type='float', string='Product Registered Taxes'),
1933+ 'purchase_total': fields.function(_compute_purchase_total, type='float', string='Purchase Total'),
1934+ 'tax_total': fields.function(_compute_tax_total, type='float', string='Total Taxes'),
1935+ 'freight_total': fields.function(_compute_freight_total, type='float', string='Total Freight'),
1936+ 'paid_total': fields.function(_compute_paid_total, type='float', string='Import Total'),
1937+ 'line_ids': fields.one2many('purchase.import.import.order.line', 'order_id', string='Products', readonly=True),
1938+ 'tax_ids': fields.many2many('account.invoice.line', 'import_tax_id', 'imports_id', 'line_id', string='Taxes Invoice'),
1939+ 'imports_order_ids': fields.many2many('account.invoice', 'import_invoice_id', 'imports_id', 'invoice_id', string='Products Invoice'),
1940+ 'freight_ids': fields.related('freight_order_id', 'invoice_line', type='one2many', relation='account.invoice.line', string='Freight'),
1941+ 'freight_currency_id': fields.related('freight_order_id', 'currency_id', type='many2one', relation='res.currency', string='Freight Currency', readonly=True),
1942+ 'tax_currency_id': fields.related('tax_order_id', 'currency_id', type='many2one', relation='res.currency', string='Tax Currency', readonly=True),
1943+ 'notes': fields.text('Notes'),
1944+ 'date' : fields.datetime('Create Date', readonly=True),
1945+ 'state': fields.selection([('draft', 'Draft'), ('confirmed', 'Confirmed'), ('done', 'Processed'), ('cancel', 'Cancelled')], string='State')
1946+ }
1947+
1948+ _defaults = {
1949+ 'state': 'draft',
1950+ 'company_id': lambda slf,cr,uid,ctx: slf.pool.get('res.company')._company_default_get(cr, uid, 'purchase.import.order', context=ctx),
1951+ 'name': _('Draft Import Order'),
1952+ 'date': lambda *a: datetime.strftime(datetime.now(),'%Y-%m-%d %H:%M:%S'),
1953+ }
1954+
1955+class Voucher(osv.Model):
1956+ """Import Vouchers"""
1957+
1958+ _name = 'purchase.import.import.voucher'
1959+
1960+ _description = __doc__
1961+
1962+ def _compute_cif_real(self, cr, uid, ids, field_name, arg, context=None):
1963+ res = {}
1964+ for voucher in self.browse(cr, uid, ids, context=context):
1965+ if voucher.order_id:
1966+ res[voucher.id] = voucher.order_id.purchase_total + voucher.order_id.freight_total
1967+ else:
1968+ res[voucher.id] = 0.0
1969+ return res
1970+
1971+ def _compute_cif_dolars(self, cr, uid, ids, field_name, arg, context=None):
1972+ res = {}
1973+ for voucher in self.browse(cr, uid, ids, context=context):
1974+ if voucher.currency_rate != 0.0:
1975+ res[voucher.id] = voucher.cif_real / voucher.currency_rate
1976+ else:
1977+ res[voucher.id] = 0.0
1978+ return res
1979+
1980+ _rec_name = 'number'
1981+
1982+ _order = 'date desc'
1983+
1984+ _columns = {
1985+ 'number': fields.char('Voucher Number', size=128, required=True),
1986+ 'date' : fields.date('Date'),
1987+ 'bidder_id' : fields.many2one('res.partner', string='Bidder'),
1988+ 'agent_number': fields.char('Agent Number', size=64),
1989+ 'regime': fields.char('Regime', size=64),
1990+ 'type': fields.selection([('import','Import'),('export','Export')], string='Type'),
1991+ 'mode': fields.char('Mode', size=64),
1992+ 'type_audit': fields.char('Audit Type', size=64),
1993+ 'number_packages': fields.float('Number of Packages'),
1994+ 'weight': fields.float('Weight'),
1995+ 'net_weight': fields.float('Net Weight'),
1996+ 'cif_real': fields.function(_compute_cif_real, type='float', string='CIF Real', help='Cost, insurance and freight'),
1997+ 'cif_paid': fields.float('CIF Paid', required=True),
1998+ 'cif_dolars': fields.function(_compute_cif_dolars, type='float', string='CIF Dolars', help='Cost, insurance and freight'),
1999+ 'currency_rate': fields.float('Currency Rate', required=True),
2000+ 'order_id': fields.many2one('purchase.import.import.order', string='Import Order', ondelete='set null', select=True),
2001+ }
2002+
2003+ _defaults = {
2004+ 'date': lambda slf, cr, uid, ctx: date.strftime(date.today(), "%Y-%m-%d"),
2005+ 'type': 'import',
2006+ }
2007\ No newline at end of file
2008
2009=== added file 'purchase_import/purchase_import_sequence.xml'
2010--- purchase_import/purchase_import_sequence.xml 1970-01-01 00:00:00 +0000
2011+++ purchase_import/purchase_import_sequence.xml 2014-05-15 14:59:21 +0000
2012@@ -0,0 +1,38 @@
2013+<?xml version="1.0" encoding="UTF-8"?>
2014+<openerp>
2015+ <data noupdate="1">
2016+ <!-- purchase.import.import.order -->
2017+ <record id="seq_type_import_order" model="ir.sequence.type">
2018+ <field name="name">Import Order</field>
2019+ <field name="code">purchase.import.impord</field>
2020+ </record>
2021+ <record id="seq_import_order" model="ir.sequence">
2022+ <field name="name">Import Order</field>
2023+ <field name="code">purchase.import.impord</field>
2024+ <field name="prefix">ImpOrd-</field>
2025+ <field name="padding">4</field>
2026+ </record>
2027+ <!-- purchase.import.import.order.line -->
2028+ <record id="seq_type_import_order_line" model="ir.sequence.type">
2029+ <field name="name">Import Order Line</field>
2030+ <field name="code">purchase.import.impordlin</field>
2031+ </record>
2032+ <record id="seq_import_order_line" model="ir.sequence">
2033+ <field name="name">Import Order Line</field>
2034+ <field name="code">purchase.import.impordlin</field>
2035+ <field name="prefix">ImpOrdLine-</field>
2036+ <field name="padding">3</field>
2037+ </record>
2038+ <!-- purchase.import.import.history -->
2039+ <record id="seq_type_product_import_history" model="ir.sequence.type">
2040+ <field name="name">Product Import History</field>
2041+ <field name="code">purchase.import.proimphis</field>
2042+ </record>
2043+ <record id="seq_product_import_history" model="ir.sequence">
2044+ <field name="name">Product Import History</field>
2045+ <field name="code">purchase.import.proimphis</field>
2046+ <field name="prefix">ImpHis-</field>
2047+ <field name="padding">3</field>
2048+ </record>
2049+ </data>
2050+</openerp>
2051\ No newline at end of file
2052
2053=== added file 'purchase_import/purchase_import_workflow.xml'
2054--- purchase_import/purchase_import_workflow.xml 1970-01-01 00:00:00 +0000
2055+++ purchase_import/purchase_import_workflow.xml 2014-05-15 14:59:21 +0000
2056@@ -0,0 +1,64 @@
2057+<?xml version="1.0" encoding="UTF-8"?>
2058+<openerp>
2059+ <data>
2060+ <record id="wkf_import_order" model="workflow">
2061+ <field name="name">purchase.import.import.order.basic</field>
2062+ <field name="osv">purchase.import.import.order</field>
2063+ <field name="on_create">True</field>
2064+ </record>
2065+
2066+ <record id="act_draft" model="workflow.activity">
2067+ <field name="wkf_id" ref="wkf_import_order"/>
2068+ <field name="flow_start">True</field>
2069+ <field name="name">draft</field>
2070+ <field name="action">write({'state':'draft'})</field>
2071+ <field name="kind">function</field>
2072+ </record>
2073+
2074+ <record id="act_confirmed" model="workflow.activity">
2075+ <field name="wkf_id" ref="wkf_import_order"/>
2076+ <field name="name">confirm</field>
2077+ <field name="action">write({'state':'confirmed'})</field>
2078+ <field name="kind">function</field>
2079+ </record>
2080+
2081+ <record id="act_cancel" model="workflow.activity">
2082+ <field name="wkf_id" ref="wkf_import_order"/>
2083+ <field name="name">cancel</field>
2084+ <field name="action">write({'state':'cancel'})</field>
2085+ <field name="kind">function</field>
2086+ </record>
2087+
2088+ <record id="act_done" model="workflow.activity">
2089+ <field name="wkf_id" ref="wkf_import_order"/>
2090+ <field name="name">done</field>
2091+ <field name="action">action_set_average_price()</field>
2092+ <field name="kind">function</field>
2093+ <field name="flow_stop">True</field>
2094+ </record>
2095+
2096+ <record id="trans_draft_confirmed" model="workflow.transition">
2097+ <field name="act_from" ref="act_draft"/>
2098+ <field name="act_to" ref="act_confirmed"/>
2099+ <field name="signal">import_confirmed</field>
2100+ </record>
2101+
2102+ <record id="trans_confirmed_done" model="workflow.transition">
2103+ <field name="act_from" ref="act_confirmed"/>
2104+ <field name="act_to" ref="act_done"/>
2105+ <field name="signal">import_processed</field>
2106+ </record>
2107+
2108+ <record id="trans_confirmed_cancel" model="workflow.transition">
2109+ <field name="act_from" ref="act_confirmed"/>
2110+ <field name="act_to" ref="act_cancel"/>
2111+ <field name="signal">import_cancel</field>
2112+ </record>
2113+
2114+ <record id="trans_cancel_draft" model="workflow.transition">
2115+ <field name="act_from" ref="act_cancel"/>
2116+ <field name="act_to" ref="act_draft"/>
2117+ <field name="signal">import_draft</field>
2118+ </record>
2119+ </data>
2120+</openerp>
2121
2122=== added directory 'purchase_import/security'
2123=== added file 'purchase_import/security/ir.model.access.csv'
2124--- purchase_import/security/ir.model.access.csv 1970-01-01 00:00:00 +0000
2125+++ purchase_import/security/ir.model.access.csv 2014-05-15 14:59:21 +0000
2126@@ -0,0 +1,17 @@
2127+id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
2128+access_import_order_purchase_user,access.import.order.purchase.user,model_purchase_import_import_order,purchase.group_purchase_user,1,1,1,1
2129+access_import_order_purchase_manager,access.import.order.purchase.manager,model_purchase_import_import_order,purchase.group_purchase_manager,1,1,1,1
2130+access_import_order_line_purchase_user,access.import.order.line.purchase.user,model_purchase_import_import_order_line,purchase.group_purchase_user,1,1,1,1
2131+access_import_order_line_purchase_manager,access.import.order.line.purchase.manager,model_purchase_import_import_order_line,purchase.group_purchase_manager,1,1,1,1
2132+access_import_voucher_purchase_user,access.import.voucher.purchase.user,model_purchase_import_import_voucher,purchase.group_purchase_user,1,1,1,1
2133+access_import_voucher_purchase_manager,access.import.voucher.purchase.manager,model_purchase_import_import_voucher,purchase.group_purchase_manager,1,1,1,1
2134+access_product_import_history_purchase_user,access.product.import.history.purchase.user,model_purchase_import_product_import_history,purchase.group_purchase_user,1,1,1,0
2135+access_product_import_history_purchase_manager,access.product.import.history.purchase.manager,model_purchase_import_product_import_history,purchase.group_purchase_manager,1,1,1,0
2136+access_product_import_history_sales_user,access.product.import.history.sales.user,model_purchase_import_product_import_history,base.group_user,1,0,0,0
2137+access_product_import_history_sales_manager,access.product.import.history.sales.manager,model_purchase_import_product_import_history,base.group_sale_manager,1,1,1,1
2138+access_tariff_category_purchase_user,access.tariff.category.purchase.user,model_purchase_import_tariff_category,purchase.group_purchase_user,1,0,0,0
2139+access_tariff_category_purchase_manager,access.tariff.category.purchase.manager,model_purchase_import_tariff_category,purchase.group_purchase_manager,1,1,1,1
2140+access_tariff_purchase_user,access.tariff.purchase.user,model_purchase_import_tariff,purchase.group_purchase_user,1,1,1,0
2141+access_tariff_purchase_manager,access.tariff.purchase.manager,model_purchase_import_tariff,purchase.group_purchase_manager,1,1,1,1
2142+access_tax_purchase_user,access.tax.purchase.user,model_purchase_import_tax,purchase.group_purchase_user,1,1,1,0
2143+access_tax_purchase_manager,access.tax.purchase.manager,model_purchase_import_tax,purchase.group_purchase_manager,1,1,1,1
2144
2145=== added directory 'purchase_import/static'
2146=== added directory 'purchase_import/static/src'
2147=== added directory 'purchase_import/static/src/img'
2148=== added file 'purchase_import/static/src/img/icon.png'
2149Binary files purchase_import/static/src/img/icon.png 1970-01-01 00:00:00 +0000 and purchase_import/static/src/img/icon.png 2014-05-15 14:59:21 +0000 differ
2150=== added directory 'purchase_import/view'
2151=== added file 'purchase_import/view/purchase_import_menu.xml'
2152--- purchase_import/view/purchase_import_menu.xml 1970-01-01 00:00:00 +0000
2153+++ purchase_import/view/purchase_import_menu.xml 2014-05-15 14:59:21 +0000
2154@@ -0,0 +1,39 @@
2155+<?xml version="1.0" encoding="UTF-8"?>
2156+<openerp>
2157+ <data>
2158+ <menuitem id="menu_purchase_import"
2159+ parent="base.menu_purchase_root"
2160+ name="Purchase Import"
2161+ sequence="5" />
2162+
2163+ <menuitem id="menu_import_order"
2164+ parent="menu_purchase_import"
2165+ name="Import Orders"
2166+ action="action_import_order"
2167+ sequence="10" />
2168+
2169+ <menuitem id="menu_import_voucher"
2170+ parent="menu_purchase_import"
2171+ name="Import Vouchers"
2172+ action="action_import_voucher"
2173+ sequence="20" />
2174+
2175+ <menuitem id="menu_purchase_import_config"
2176+ parent="purchase.menu_purchase_config_purchase"
2177+ name="Tariffs"
2178+ action="action_tariff"
2179+ sequence="50" />
2180+
2181+ <menuitem id="menu_tariff"
2182+ parent="menu_purchase_import_config"
2183+ name="Tariffs"
2184+ action="action_tariff"
2185+ sequence="10" />
2186+
2187+ <menuitem id="menu_tariff_category"
2188+ parent="menu_purchase_import_config"
2189+ name="Tariff Categories"
2190+ action="action_tariff_category"
2191+ sequence="20" />
2192+ </data>
2193+</openerp>
2194\ No newline at end of file
2195
2196=== added file 'purchase_import/view/purchase_import_view.xml'
2197--- purchase_import/view/purchase_import_view.xml 1970-01-01 00:00:00 +0000
2198+++ purchase_import/view/purchase_import_view.xml 2014-05-15 14:59:21 +0000
2199@@ -0,0 +1,416 @@
2200+<?xml version="1.0" encoding="UTF-8"?>
2201+<openerp>
2202+ <data>
2203+ <!-- Views -->
2204+ <!-- product.product -->
2205+ <!-- form -->
2206+ <record id="view_product_form" model="ir.ui.view">
2207+ <field name="name">view.product.form</field>
2208+ <field name="model">product.product</field>
2209+ <field name="inherit_id" ref="product.product_normal_form_view"/>
2210+ <field name="priority" eval="16"/>
2211+ <field name="arch" type="xml">
2212+ <xpath expr="//form/sheet/notebook/page[@string='Procurements']/group[@name='procurement']" position="after">
2213+ <group string="Tariff" name="tariff">
2214+ <group>
2215+ <field name="tariff_id"/>
2216+ <field name="tax_ids" nolabel="1" colspan="2">
2217+ <tree>
2218+ <field name="code"/>
2219+ <field name="name"/>
2220+ <field name="value" sum="Total"/>
2221+ </tree>
2222+ </field>
2223+ </group>
2224+ <separator/>
2225+ <separator/>
2226+ </group>
2227+ </xpath>
2228+ <xpath expr="//form/sheet/notebook" position="inside">
2229+ <page string="Import History" name="import_history">
2230+ <field name="import_history_ids"/>
2231+ </page>
2232+ </xpath>
2233+ </field>
2234+ </record>
2235+
2236+ <!-- purchase.import.product.import.history -->
2237+ <!-- tree -->
2238+ <record id="view_product_import_history" model="ir.ui.view">
2239+ <field name="name">view.product.import.history</field>
2240+ <field name="model">purchase.import.product.import.history</field>
2241+ <field name="type">tree</field>
2242+ <field name="priority" eval="16"/>
2243+ <field name="arch" type="xml">
2244+ <tree string="Purchase Import History">
2245+ <field name="name"/>
2246+ <field name="import_number"/>
2247+ <field name="date"/>
2248+ <field name="product_id"/>
2249+ <field name="last_price"/>
2250+ <field name="tax_percentage"/>
2251+ <field name="tax_total"/>
2252+ <field name="freight_percentage"/>
2253+ <field name="freight_total"/>
2254+ <field name="import_total"/>
2255+ </tree>
2256+ </field>
2257+ </record>
2258+
2259+ <!-- purchase.import.import.order -->
2260+ <!-- form -->
2261+ <record id="view_import_order_form" model="ir.ui.view">
2262+ <field name="name">view.import.order.form</field>
2263+ <field name="model">purchase.import.import.order</field>
2264+ <field name="type">form</field>
2265+ <field name="priority" eval="16"/>
2266+ <field name="arch" type="xml">
2267+ <form string="Import Orders" version="7.0">
2268+ <header>
2269+ <button name="import_draft" string="Draft" states="cancel"/>
2270+ <button name="import_confirmed" string="Confirm" states="draft" class="oe_highlight"/>
2271+ <button name="import_processed" string="Process" states="confirmed" class="oe_highlight" confirm="Are you sure you want to process this order? You must be sure that all products are already in stock"/>
2272+ <button name="import_cancel" string="Cancel" states="confirmed,wait"/>
2273+ <field name="state" widget="statusbar"/>
2274+ </header>
2275+ <sheet>
2276+ <h1>
2277+ <field name="name"/>
2278+ </h1>
2279+ <group>
2280+ <group name="general">
2281+ <field name="origin_id"/>
2282+ <field name="company_id"/>
2283+ </group>
2284+ <group name="dates">
2285+ <field name="date_arrive"/>
2286+ <field name="date_due"/>
2287+ <field name="date"/>
2288+ </group>
2289+ </group>
2290+ <group>
2291+ <group string="Freight and Taxes" name="freight_taxes" col="3">
2292+ <field name="freight_order_id" domain="[('type', '=', 'in_invoice'),('state','not in',['draft','cancel']),('company_id','=',company_id)]"
2293+ on_change="onchange_freight_order(freight_order_id)" class="oe_inline"/> -
2294+ <field name="freight_currency_id" nolabel="1"/>
2295+ <field name="tax_order_id" domain="[('type', '=', 'in_invoice'),('state','not in',['draft','cancel']),('company_id','=',company_id)]"
2296+ on_change="onchange_tax_order(tax_order_id)" class="oe_inline"/>
2297+ <field name="tax_currency_id" nolabel="1"/>
2298+ <field name="tax_total" colspan="3"/>
2299+ <field name="freight_total" colspan="3"/>
2300+ <field name="paid_total" colspan="3"/>
2301+ </group>
2302+ <group string="Purchase Information" name="totals">
2303+ <field name="sum_tax_value"/>
2304+ <field name="purchase_total"/>
2305+ <field name="total_weight"/>
2306+ </group>
2307+ </group>
2308+ <field name="notes" placeholder="Add a note..."/>
2309+ <notebook>
2310+ <page string="Order Lines" name="order_lines">
2311+ <field name="line_ids"/>
2312+ </page>
2313+ <page string="Import Invoices" name="invoices">
2314+ <field name="imports_order_ids" domain="[('type', '=', 'in_invoice'),('state','not in',['draft','cancel']),('company_id','=',company_id)]"
2315+ attrs="{'readonly':[('state','=','done')]}"/>
2316+ </page>
2317+ <page string="Vouchers" name="vouchers">
2318+ <field name="voucher_ids">
2319+ <tree>
2320+ <field name="number"/>
2321+ <field name="date"/>
2322+ <field name="bidder_id"/>
2323+ <field name="agent_number"/>
2324+ <field name="regime"/>
2325+ <field name="type"/>
2326+ <field name="mode"/>
2327+ <field name="type_audit"/>
2328+ <field name="number_packages"/>
2329+ <field name="weight"/>
2330+ <field name="cif_paid"/>
2331+ <field name="currency_rate"/>
2332+ </tree>
2333+ </field>
2334+ </page>
2335+ </notebook>
2336+ </sheet>
2337+ </form>
2338+ </field>
2339+ </record>
2340+
2341+ <!-- tree -->
2342+ <record id="view_import_order_tree" model="ir.ui.view">
2343+ <field name="name">view.import.order.tree</field>
2344+ <field name="model">purchase.import.import.order</field>
2345+ <field name="type">tree</field>
2346+ <field name="priority" eval="16"/>
2347+ <field name="arch" type="xml">
2348+ <tree string="Import Orders">
2349+ <field name="name"/>
2350+ <field name="origin_id"/>
2351+ <field name="total_weight"/>
2352+ <field name="date_arrive"/>
2353+ <field name="date_due"/>
2354+ <field name="date"/>
2355+ <field name="freight_order_id" domain="[('type', '=', 'in_invoice'),('state','not in',['draft','cancel'])]"/>
2356+ <field name="tax_order_id" domain="[('type', '=', 'in_invoice'),('state','not in',['draft','cancel'])]"/>
2357+ <field name="sum_tax_value"/>
2358+ <field name="purchase_total"/>
2359+ <field name="tax_total"/>
2360+ <field name="freight_total"/>
2361+ <field name="paid_total"/>
2362+ <field name="state"/>
2363+ </tree>
2364+ </field>
2365+ </record>
2366+
2367+ <!-- search -->
2368+ <record id="view_import_order_search" model="ir.ui.view">
2369+ <field name="name">view.import.order.search</field>
2370+ <field name="model">purchase.import.import.order</field>
2371+ <field name="type">search</field>
2372+ <field name="priority" eval="16"/>
2373+ <field name="arch" type="xml">
2374+ <search string="Search Import Orders">
2375+ <field name="name"/>
2376+ <field name="origin_id"/>
2377+ <filter name="draft" string="Draft" domain="[('state','=','draft')]" help="Import Orders which are in draft state"/>
2378+ <filter name="confirmed" string="Confirmed" domain="[('state','=','confirmed')]" help="Import Orders which are in confirmed state"/>
2379+ <filter name="done" string="Processed" domain="[('state','=','done')]" help="Import Orders which are in processed state"/>
2380+ <filter name="cancel" string="Cancelled" domain="[('state','=','cancel')]" help="Import Orders which are in Cancelled state"/>
2381+ <group expand="0" string="Group By...">
2382+ <filter string="State" context="{'group_by':'state'}"/>
2383+ <filter string="Origin" context="{'group_by':'origin_id'}"/>
2384+ <filter string="Arrive Date" context="{'group_by':'date_arrive'}"/>
2385+ <filter string="Date Limit" context="{'group_by':'date_due'}"/>
2386+ <filter string="Create Date" context="{'group_by':'create_date'}"/>
2387+ </group>
2388+ </search>
2389+ </field>
2390+ </record>
2391+
2392+ <!-- purchase.import.import.order.line -->
2393+ <!-- tree -->
2394+ <record id="view_import_order_line_tree" model="ir.ui.view">
2395+ <field name="name">view.import.order.line.tree</field>
2396+ <field name="model">purchase.import.import.order.line</field>
2397+ <field name="type">tree</field>
2398+ <field name="priority" eval="16"/>
2399+ <field name="arch" type="xml">
2400+ <tree string="Import Order Lines" editable="bottom">
2401+ <field name="code"/>
2402+ <field name="product_id"/>
2403+ <field name="quantity"/>
2404+ <field name="product_uom_id"/>
2405+ <field name="unit_price"/>
2406+ <field name="subtotal"/>
2407+ <field name="fob_cost"/>
2408+ <field name="import_taxes"/>
2409+ <field name="tax_percentage"/>
2410+ <field name="tax_assigned"/>
2411+ <field name="freight_percentage"/>
2412+ <field name="freight_assigned"/>
2413+ <field name="tariff"/>
2414+ </tree>
2415+ </field>
2416+ </record>
2417+
2418+ <!-- purchase.import.import.voucher -->
2419+ <!-- form -->
2420+ <record id="view_import_voucher_form" model="ir.ui.view">
2421+ <field name="name">view.import.voucher.form</field>
2422+ <field name="model">purchase.import.import.voucher</field>
2423+ <field name="type">form</field>
2424+ <field name="priority" eval="16"/>
2425+ <field name="arch" type="xml">
2426+ <form string="Import Vouchers" version="7.0">
2427+ <sheet>
2428+ <label for="number" class="oe_edit_only"/>
2429+ <h1>
2430+ <field name="number"/>
2431+ </h1>
2432+ <group name="general">
2433+ <group>
2434+ <field name="order_id"/>
2435+ <field name="agent_number"/>
2436+ <field name="bidder_id"/>
2437+ <field name="regime"/>
2438+ </group>
2439+ <group>
2440+ <field name="date"/>
2441+ <field name="type"/>
2442+ <field name="mode"/>
2443+ <field name="type_audit"/>
2444+ </group>
2445+ </group>
2446+ <group>
2447+ <group string="Product" name="product">
2448+ <field name="number_packages"/>
2449+ <field name="weight"/>
2450+ <field name="net_weight"/>
2451+ </group>
2452+ <group string="Payment" name="payment">
2453+ <field name="cif_paid"/>
2454+ <field name="currency_rate"/>
2455+ <field name="cif_real"/>
2456+ <field name="cif_dolars"/>
2457+ </group>
2458+ </group>
2459+ </sheet>
2460+ </form>
2461+ </field>
2462+ </record>
2463+
2464+ <!-- tree -->
2465+ <record id="view_import_voucher_tree" model="ir.ui.view">
2466+ <field name="name">view.import.voucher.tree</field>
2467+ <field name="model">purchase.import.import.voucher</field>
2468+ <field name="type">tree</field>
2469+ <field name="priority" eval="16"/>
2470+ <field name="arch" type="xml">
2471+ <tree string="Import Vouchers" version="7.0">
2472+ <field name="number"/>
2473+ <field name="date"/>
2474+ <field name="bidder_id"/>
2475+ <field name="agent_number"/>
2476+ <field name="regime"/>
2477+ <field name="type"/>
2478+ <field name="mode"/>
2479+ <field name="type_audit"/>
2480+ <field name="number_packages"/>
2481+ <field name="weight"/>
2482+ <field name="net_weight"/>
2483+ <field name="cif_real"/>
2484+ <field name="cif_paid"/>
2485+ <field name="cif_dolars"/>
2486+ <field name="currency_rate"/>
2487+ <field name="order_id"/>
2488+ </tree>
2489+ </field>
2490+ </record>
2491+
2492+ <!-- search -->
2493+ <record id="view_import_voucher_search" model="ir.ui.view">
2494+ <field name="name">view.import.voucher.search</field>
2495+ <field name="model">purchase.import.import.voucher</field>
2496+ <field name="type">search</field>
2497+ <field name="priority" eval="16"/>
2498+ <field name="arch" type="xml">
2499+ <search string="Search Import Vouchers">
2500+ <field name="number"/>
2501+ <field name="order_id"/>
2502+ <filter name="import" string="Import" domain="[('type','=','import')]"/>
2503+ <filter name="export" string="Export" domain="[('type','=','export')]"/>
2504+ <group expand="0" string="Group By...">
2505+ <filter string="Import Order" context="{'group_by':'order_id'}"/>
2506+ <filter string="Type" context="{'group_by':'type'}"/>
2507+ <filter string="Date" context="{'group_by':'date'}"/>
2508+ </group>
2509+ </search>
2510+ </field>
2511+ </record>
2512+
2513+ <!-- purchase.import.tariff -->
2514+ <!-- form -->
2515+ <record id="view_tariff_form" model="ir.ui.view">
2516+ <field name="name">view.tariff.form</field>
2517+ <field name="model">purchase.import.tariff</field>
2518+ <field name="type">form</field>
2519+ <field name="priority" eval="16"/>
2520+ <field name="arch" type="xml">
2521+ <form string="Tariffs" version="7.0">
2522+ <sheet>
2523+ <label for="name" class="oe_edit_only"/>
2524+ <h1>
2525+ <field name="name"/>
2526+ </h1>
2527+ <group>
2528+ <group>
2529+ <field name="category_id"/>
2530+ </group>
2531+ <group>
2532+ <field name="tariff_total"/>
2533+ </group>
2534+ </group>
2535+ <notebook>
2536+ <page string="Description" name="description">
2537+ <field name="description" placeholder="Add a description..."/>
2538+ <field name="tax_ids">
2539+ <tree editable="bottom">
2540+ <field name="code"/>
2541+ <field name="name"/>
2542+ <field name="value" sum="Total Taxes"/>
2543+ </tree>
2544+ </field>
2545+ </page>
2546+ </notebook>
2547+ </sheet>
2548+ </form>
2549+ </field>
2550+ </record>
2551+
2552+ <!-- tree -->
2553+ <record id="view_tariff_tree" model="ir.ui.view">
2554+ <field name="name">view.tariff.tree</field>
2555+ <field name="model">purchase.import.tariff</field>
2556+ <field name="type">tree</field>
2557+ <field name="priority" eval="16"/>
2558+ <field name="arch" type="xml">
2559+ <tree string="Tariffs">
2560+ <field name="name"/>
2561+ <field name="category_id"/>
2562+ <field name="tariff_total"/>
2563+ </tree>
2564+ </field>
2565+ </record>
2566+
2567+ <!-- purchase.import.tariff.category -->
2568+ <!-- tree -->
2569+ <record id="view_tariff_category_tree" model="ir.ui.view">
2570+ <field name="name">view.tariff.category.tree</field>
2571+ <field name="model">purchase.import.tariff.category</field>
2572+ <field name="type">tree</field>
2573+ <field name="priority" eval="16"/>
2574+ <field name="arch" type="xml">
2575+ <tree string="Tariff Categories" editable="top">
2576+ <field name="code"/>
2577+ <field name="name"/>
2578+ <field name="description"/>
2579+ </tree>
2580+ </field>
2581+ </record>
2582+
2583+ <!-- actions -->
2584+ <!-- purchase.import.import.order -->
2585+ <record model="ir.actions.act_window" id="action_import_order">
2586+ <field name="name">Import Order</field>
2587+ <field name="res_model">purchase.import.import.order</field>
2588+ <field name="view_mode">tree,form</field>
2589+ <field name="context">{'search_default_confirmed': 1}</field>
2590+ <field name="search_view_id" ref="view_import_order_search"/>
2591+ </record>
2592+
2593+ <!-- purchase.import.import.voucher -->
2594+ <record model="ir.actions.act_window" id="action_import_voucher">
2595+ <field name="name">Import Voucher</field>
2596+ <field name="res_model">purchase.import.import.voucher</field>
2597+ <field name="view_mode">tree,form</field>
2598+ <field name="search_view_id" ref="view_import_voucher_search"/>
2599+ </record>
2600+
2601+ <!-- purchase.import.tariff -->
2602+ <record model="ir.actions.act_window" id="action_tariff">
2603+ <field name="name">Tariff</field>
2604+ <field name="res_model">purchase.import.tariff</field>
2605+ <field name="view_mode">tree,form</field>
2606+ </record>
2607+
2608+ <!-- purchase.import.tariff.category -->
2609+ <record model="ir.actions.act_window" id="action_tariff_category">
2610+ <field name="name">Tariff Category</field>
2611+ <field name="res_model">purchase.import.tariff.category</field>
2612+ <field name="view_mode">tree</field>
2613+ </record>
2614+ </data>
2615+</openerp>
2616\ No newline at end of file

Subscribers

People subscribed via source and target branches