Merge lp:~mikel-martin/openobject-addons/extra-5.0_esale_osc_enhancement into lp:openobject-addons/extra-5.0

Proposed by mikel on 2010-03-12
Status: Needs review
Proposed branch: lp:~mikel-martin/openobject-addons/extra-5.0_esale_osc_enhancement
Merge into: lp:openobject-addons/extra-5.0
Diff against target: 4794 lines (+1651/-1634) (has conflicts)
13 files modified
.bzrignore (+4/-0)
esale_osc/__terp__.py (+8/-2)
esale_osc/connector/ZhenIT_zencart_compatibility_functions.php (+244/-0)
esale_osc/connector/openerp-synchro.php (+371/-521)
esale_osc/connector/openerp_login.php (+41/-0)
esale_osc/connector/openerp_runonce.php (+10/-0)
esale_osc/esale_oscom.py (+348/-326)
esale_osc/esale_oscom_product.py (+13/-7)
esale_osc/esale_oscom_view.xml (+375/-372)
esale_osc/esale_oscom_workflow.xml (+0/-230)
esale_osc/i18n/es_ES.po (+36/-6)
esale_osc/i18n/esale_osc.pot (+200/-170)
esale_osc/wizard/wizard_esale_oscom_update_select_stocks.py (+1/-0)
Path conflict: <deleted> / account_product_fiscal_classification.py
Path conflict: <deleted> / __init__.py
Path conflict: <deleted> / product_view.xml
Path conflict: <deleted> / __terp__.py
Contents conflict in esale_osc/i18n/es.po
To merge this branch: bzr merge lp:~mikel-martin/openobject-addons/extra-5.0_esale_osc_enhancement
Reviewer Review Type Date Requested Status
OpenERP Core Team 2010-03-12 Pending
Review via email: mp+21279@code.launchpad.net
To post a comment you must log in.
6. By mikel <mikel@pcl2> on 2010-06-14

ok

7. By mikel <mikel@pcl2> on 2010-07-08

Merge totnto

8. By mikel <mikel@pcl2> on 2010-07-21

Fix oscom_prod_url qhen not oscommerce o not in root folder
Fix import multiple variants qhen options value name is different in different languages
Add option to avoid syncronization of shop products whit openerp's maodifies data

Unmerged revisions

8. By mikel <mikel@pcl2> on 2010-07-21

Fix oscom_prod_url qhen not oscommerce o not in root folder
Fix import multiple variants qhen options value name is different in different languages
Add option to avoid syncronization of shop products whit openerp's maodifies data

7. By mikel <mikel@pcl2> on 2010-07-08

Merge totnto

6. By mikel <mikel@pcl2> on 2010-06-14

ok

5. By mikel <mikel@pcl2> on 2010-04-26

Ability to define a default category for imported partners

added:
  .bzrignore
modified:
  esale_osc/connector/openerp-synchro.php
  esale_osc/esale_oscom.py
  esale_osc/esale_oscom_view.xml
  esale_osc/i18n/es_ES.po
  esale_osc/i18n/esale_osc.pot

4. By mikel <mikel@pcl2> on 2010-04-22

Comentarios idiomas y bug en sincronización de descripciones de productos
removed:
  esale_osc/i18n/es.po
modified:
  esale_osc/__terp__.py
  esale_osc/connector/openerp-synchro.php
  esale_osc/i18n/es_ES.po*
  esale_osc/i18n/esale_osc.pot*

3. By mikel <mikel@pcl2> on 2010-03-15

changes in credits

2. By mikel <mikel@pcl2> on 2010-03-12

missing files

1. By mikel <mikel@pcl2> on 2010-03-12

Added to esale_osc:
- ZenCart compatibility
- osCommerce admin authentication

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file '.bzrignore'
2--- .bzrignore 1970-01-01 00:00:00 +0000
3+++ .bzrignore 2010-07-21 10:31:39 +0000
4@@ -0,0 +1,4 @@
5+.orig
6+*.orig
7+*.pyc
8+*~
9
10=== modified file 'esale_osc/__terp__.py'
11--- esale_osc/__terp__.py 2009-11-16 19:09:09 +0000
12+++ esale_osc/__terp__.py 2010-07-21 10:31:39 +0000
13@@ -1,3 +1,4 @@
14+# -*- coding: utf-8 -*-
15 # -*- encoding: utf-8 -*-
16 ##############################################################################
17 #
18@@ -23,7 +24,7 @@
19
20 {
21 "name" : "OScommerce Interface / ZenCart",
22- "version" : "1.0",
23+ "version" : "1.5",
24 "author" : "Axelor/Zikzakmedia",
25 "license" : "GPL-3",
26 "category" : "Interfaces/CMS & eCommerce",
27@@ -41,7 +42,12 @@
28 2. Export Stocks.
29 3. Change Oscommerce Order status and include comments. Upload Osc Status and comments.
30
31-Developed by Tiny, Axelor, Zikzakmedia and Ana Juaristi""",
32+New in this version (1.5.0):
33+ * User validation at store's administration
34+ * Out of the box ZenCart compatibility
35+ * Encoding isues
36+
37+Developed by Tiny, Axelor, Zikzakmedia, Ana Juaristi and ZhenIT Software""",
38 "init_xml" : [],
39 "demo_xml" : [],
40 "update_xml" : [
41
42=== added file 'esale_osc/connector/ZhenIT_zencart_compatibility_functions.php'
43--- esale_osc/connector/ZhenIT_zencart_compatibility_functions.php 1970-01-01 00:00:00 +0000
44+++ esale_osc/connector/ZhenIT_zencart_compatibility_functions.php 2010-07-21 10:31:39 +0000
45@@ -0,0 +1,244 @@
46+<?
47+/*
48+ OsCommerce/Zencart Compatibility Payment Module Copyright (c) 2010 ZhenIT Software
49+
50+ Valid for osCommerce, Zencart & soon for xt:commerce
51+
52+ http://ZhenIT.com
53+ info@ZhenIT.com
54+
55+ Released under the GNU General Public License
56+
57+ No se limita la reutilización o mejora de este código pero se ruega
58+ se mantengan los créditos y las referencias a ZhenIT, tanto las
59+ explícitas como en los nombres de ficheros o de funciones.
60+
61+*/
62+define('PLATAFORMA','zen');
63+define("IS_ADMIN_FLAG","true");
64+// include("../".DIR_WS_CLASSES."class.base.php");
65+// require("../".DIR_WS_CLASSES."db/" .DB_TYPE . '/query_factory.php');
66+// $db = new queryFactory();
67+// $db->connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD, DB_DATABASE, USE_PCONNECT, false);
68+if (file_exists("../".DIR_WS_INCLUDES."compat_ZhenIT/ZhenIT_zencart_compatibility_functions.php")){
69+ include_once("../".DIR_WS_INCLUDES."compat_ZhenIT/ZhenIT_zencart_compatibility_functions.php");
70+}else{
71+ function tep_db_query($query)
72+ {
73+ global $db;
74+ return($db->Execute($query));
75+ }
76+
77+ function tep_db_fetch_array(&$query){
78+ if(!$query->EOF){
79+ $array = $query->fields;
80+ $query->MoveNext();
81+ return $array;
82+ }
83+ return false;
84+ }
85+
86+ function tep_db_num_rows($query)
87+ {
88+ return($query->RecordCount());
89+ }
90+
91+ function tep_db_input($string) {
92+ if (function_exists('mysql_escape_string')) {
93+ return mysql_escape_string($string);
94+ }
95+ return addslashes($string);
96+ }
97+
98+ function tep_db_perform($table, $data, $action = 'insert', $parameters = '') {
99+ reset($data);
100+ if ($action == 'insert') {
101+ $query = 'insert into ' . $table . ' (';
102+ while (list($columns, ) = each($data)) {
103+ $query .= $columns . ', ';
104+ }
105+ $query = substr($query, 0, -2) . ') values (';
106+ reset($data);
107+ while (list(, $value) = each($data)) {
108+ switch ((string)$value) {
109+ case 'now()':
110+ $query .= 'now(), ';
111+ break;
112+ case 'null':
113+ $query .= 'null, ';
114+ break;
115+ default:
116+ $query .= '\'' . tep_db_input($value) . '\', ';
117+ break;
118+ }
119+ }
120+ $query = substr($query, 0, -2) . ')';
121+ } elseif ($action == 'update') {
122+ $query = 'update ' . $table . ' set ';
123+ while (list($columns, $value) = each($data)) {
124+ switch ((string)$value) {
125+ case 'now()':
126+ $query .= $columns . ' = now(), ';
127+ break;
128+ case 'null':
129+ $query .= $columns .= ' = null, ';
130+ break;
131+ default:
132+ $query .= $columns . ' = \'' . tep_db_input($value) . '\', ';
133+ break;
134+ }
135+ }
136+ $query = substr($query, 0, -2) . ' where ' . $parameters;
137+ }
138+
139+ return tep_db_query($query);
140+ }
141+
142+ function tep_db_insert_id() {
143+ return mysql_insert_id();
144+ }
145+
146+ function tep_draw_hidden_field($name, $value = '', $parameters = '') {
147+ return zen_draw_hidden_field($name,$value,$parameters);
148+ }
149+
150+ function tep_redirect($url) {
151+ zen_redirect($url);
152+ }
153+
154+ function tep_href_link($page = '', $parameters = '', $connection = 'NONSSL', $add_session_id = true, $search_engine_safe = true) {
155+ return zen_href_link($page , $parameters, $connection , $add_session_id , $search_engine_safe);
156+ }
157+
158+ function tep_cfg_pull_down_zone_classes($zone_class_id, $key = '') {
159+ return zen_cfg_pull_down_zone_classes($zone_class_id, $key);
160+ }
161+ function tep_cfg_pull_down_order_statuses($zone_class_id, $key = '') {
162+ return zen_cfg_pull_down_order_statuses($zone_class_id, $key);
163+ }
164+ function tep_get_order_status_name($zone_class_id, $key = '') {
165+ return zen_get_order_status_name($zone_class_id, $key);
166+ }
167+ function tep_get_zone_class_title($zone_class_id, $key = '') {
168+ return zen_get_zone_class_title($zone_class_id, $key);
169+ }
170+
171+ function tep_cfg_select_option($select_array, $key_value, $key = '') {
172+ return zen_cfg_select_option($select_array, $key_value, $key) ;
173+ }
174+ function tep_session_id($sessid = '') {
175+ return zen_session_id($sessid );
176+ }
177+ function tep_session_register($param) {
178+ return zen_session_register($param);
179+ }
180+ function tep_session_unregister($param) {
181+ return zen_session_unregister($param);
182+ }
183+ function tep_cfg_pull_down_tax_classes($tax_class_id, $key = '') {
184+ return zen_cfg_pull_down_tax_classes($tax_class_id, $key);
185+ }
186+ function tep_get_tax_class_title($tax_class_id) {
187+ return zen_get_tax_class_title($tax_class_id);
188+ }
189+
190+ function tep_get_tax_rate($tax_class_id){
191+ return zen_get_tax_rate($tax_class_id);
192+ }
193+ function tep_get_tax_description($tax_class_id, $country, $zone){
194+ return zen_get_tax_description($tax_class_id, $country, $zone);
195+ }
196+ function tep_calculate_tax($amount, $rate){
197+ return zen_calculate_tax($amount, $rate);
198+ }
199+ function tep_get_prid($id){
200+ return zen_get_prid($id);
201+ }
202+ function tep_not_null($variable){
203+ return zen_not_null($variable);
204+ }
205+ function tep_session_is_registered($variable) {
206+ if (PHP_VERSION < 4.3) {
207+ return session_is_registered($variable);
208+ } else {
209+ return isset($_SESSION) && array_key_exists($variable, $_SESSION);
210+ }
211+ }
212+ function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '') {
213+ return zen_image($src, $alt, $width, $height, $parameters);
214+ }
215+ function tep_image_button($image, $alt = '', $parameters = '') {
216+ global $language;
217+ return zen_image(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image, $alt, '', '', $parameters);
218+ }
219+ function tep_draw_separator($image = 'pixel_black.gif', $width = '100%', $height = '1') {
220+ return zen_image(DIR_WS_IMAGES . $image, '', $width, $height);
221+ }
222+ function tep_catalog_href_link($page = '', $parameters = '', $connection = 'NONSSL') {
223+ return zen_catalog_href_link($page , $parameters , $connection );
224+ }
225+ function tep_call_function($function, $parameter, $object = '') {
226+ return zen_call_function($function, $parameter, $object = '');
227+ }
228+ function tep_get_all_get_params($exclude_array = ''){
229+ return zen_get_all_get_params($exclude_array);
230+ }
231+ function tep_db_prepare_input($sql){
232+ return zen_db_prepare_input($sql);
233+ }
234+ function tep_date_short($raw_date){
235+ return zen_date_short($raw_date);
236+ }
237+ function tep_datetime_short($raw_datetime) {
238+ return zen_datetime_short($raw_date);
239+ }
240+ function tep_draw_pull_down_menu($name, $values, $default = '', $parameters = '', $required = false) {
241+ return zen_draw_pull_down_menu($name, $values, $default, $parameters, $required);
242+ }
243+ function tep_draw_input_field($name, $value = '', $parameters = '', $required = false, $type = 'text', $reinsert_value = true){
244+ return zen_draw_input_field($name, $value = '', $parameters = '', $required = false, $type = 'text', $reinsert_value = true);
245+ }
246+ function tep_draw_form($name, $action, $parameters = '', $method = 'post', $params = ''){
247+ return zen_draw_form($name, $action, $parameters , $method, $params );
248+ }
249+ function tep_image_submit($image, $alt = '', $parameters = '') {
250+ return zen_image_submit($image, $alt, $parameters);
251+ }
252+ function tep_hide_session_id() {
253+ return zen_hide_session_id();
254+ }
255+ function tep_address_format($address_format_id, $address, $html, $boln, $eoln) {
256+ return zen_address_format($address_format_id, $address, $html, $boln, $eoln) ;
257+ }
258+ function tep_display_tax_value($value, $padding = TAX_DECIMAL_PLACES) {
259+ return zen_display_tax_value($value, $padding);
260+ }
261+ function tep_add_tax($price, $tax, $override = false) {
262+ return zen_add_tax($price, $tax, $override );
263+ }
264+ function tep_db_output($string) {
265+ return zen_db_output($string);
266+ }
267+ function tep_draw_textarea_field($name, $wrap, $width, $height, $text = '', $parameters = '', $reinsert_value = true) {
268+ return zen_draw_textarea_field($name, $wrap, $width, $height, $text, $parameters, $reinsert_value);
269+ }
270+ function tep_draw_checkbox_field($name, $value = '', $checked = false, $compare = '') {
271+ return zen_draw_checkbox_field($name, $value , $checked , $compare);
272+ }
273+ function tep_draw_radio_field($name, $value = '', $checked = false, $compare = '') {
274+ return zen_draw_radio_field($name, $value , $checked , $compare );
275+ }
276+ function tep_get_category_name($category_id, $language_id) {
277+ return zen_get_category_name($category_id, $language_id);
278+ }
279+ function tep_get_country_name($country_id){
280+ return zen_get_country_name($country_id);
281+ }
282+ function tep_get_languages(){
283+ return zen_get_languages();
284+ }
285+ function tep_validate_password($plain, $encrypted) {
286+ return zen_validate_password($plain, $encrypted);
287+ }
288+}
289+?>
290\ No newline at end of file
291
292=== modified file 'esale_osc/connector/openerp-synchro.php'
293--- esale_osc/connector/openerp-synchro.php 2010-02-02 20:22:20 +0000
294+++ esale_osc/connector/openerp-synchro.php 2010-07-21 10:31:39 +0000
295@@ -3,9 +3,12 @@
296 #
297 # OpenERP, Open Source Management Solution
298 # Copyright (c) 2008 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Reserved.
299-# Jordi Esteve <jesteve@zikzakmedia.com>
300+# Jordi Esteve <jesteve@zikzakmedia.com>
301 # Ana Juaristi <ajuaristio@gmail.com>
302-# $Id$
303+#
304+# Copyright (c) 2010 ZhenIT Software http://ZhenIT.com
305+# Added ZenCart compatibility out of the box
306+# Added user validation in the stores administration.
307 #
308 # This program is free software: you can redistribute it and/or modify
309 # it under the terms of the GNU General Public License as published by
310@@ -21,57 +24,75 @@
311 # along with this program. If not, see <http://www.gnu.org/licenses/>.
312 #
313 ##############################################################################*/
314-
315-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
316-///////////////// On windows servers line 65 use return utf8_encode($text); ////////////////////
317-///////////////// PLEASE CONFIGURE THE RIGHT INCLUDES AND DEFINES FOR YOUR CONFIGURATION ////////////////////
318-
319+//SET YOUR PREFERENCES
320+define('DIR_WS_INCLUDES', 'includes/');
321+define('TRANSACTIONAL',true); //Set true if you have installed transactional feature.
322+define('DEBUG_MODE', true); //Absolute path to debug and warning file
323+define('DEBUG_FILE', '../images/debug.xmlrpc.txt'); //Absolute path to debug and warning file
324+
325+
326+///////login//////////////
327+include("openerp_login.php");
328+$url = ($_SERVER['HTTPS']?'https':'http').'://'.$_SERVER['HTTP_HOST'].substr($_SERVER['PHP_SELF'],0,strrpos($_SERVER['PHP_SELF'],'/')+1);
329+login($url,$_GET['admin_user'],$_GET['admin_pass']);
330+//////////////////////////
331+
332+
333+//////////////////////////////////////////////////////////////////////////////////////////////////
334+///////////////// THIS INCLUDES SHOULD BE OK, BUT CHANGE THEM IF YOU NEED ////////////////////
335+include(DIR_WS_INCLUDES."application_top.php");
336 include("xmlrpcutils/xmlrpc.inc");
337 include("xmlrpcutils/xmlrpcs.inc");
338-include("../../includes/configure.php");
339-
340-define('TRANSACTIONAL',true); //Set true if you have intalled transactional feature.
341-define('RESPONSE_ENCODING', 'ISO-8859-1'); //It must be your DDBB encoding
342-define('DEBUG_FILE', '../../temp/debug.xmlrpc.txt'); //Absolute path to debug and warning file
343-
344-////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
345+
346+////ZENCARTS FUCNTIONS MAPPING///////////////////////////////////////////////////////////////////
347+if(function_exists('zen_redirect')){
348+ include_once('ZhenIT_zencart_compatibility_functions.php');
349+}else{
350+ define('PLATAFORMA','osc');
351+}
352+////////////////INSTALL/////////////
353+//CHECKS TO MAKE ONCE (CREATE FIELDS IN DB ETC...)
354+@include("openerp_runonce.php");
355+////////////////////////////////////
356+
357+/////DEBUG/////////////////////////
358+if(DEBUG_MODE){
359+ @ini_set('display_errors', '1');
360+ error_reporting(E_ALL & ~E_NOTICE);
361+ function debug($s) {
362+ $fp = fopen(DEBUG_FILE,"a");
363+ fwrite($fp, $s."\n");
364+ fclose($fp);
365+ }
366+
367+ function debug_arr($para_arr,$tab='') {
368+ if (is_array($para_arr)) {
369+ foreach($para_arr as $key=>$values) {
370+ debug($tab.'Key :'.$key.' Value :'.$values);
371+ }
372+ }
373+ }
374+}else{
375+ function debug($s) {return;}
376+ function debug_arr($para_arr,$tab='') {return;}
377+}
378
379 $con = mysql_pconnect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD);
380 mysql_select_db(DB_DATABASE);
381
382-
383-function debug($s) {
384- $fp = fopen(DEBUG_FILE,"a");
385- fwrite($fp, $s."\n");
386- fclose($fp);
387-}
388-
389-function debug_arr($para_arr,$tab='') {
390- if (is_array($para_arr)) {
391- foreach($para_arr as $key=>$values) {
392- debug($tab.'Key :'.$key.' Value :'.$values);
393- /*
394- if (is_array($values)) {
395- $tab.='\t';
396- debug_arr($values,$tab);
397- }*/
398- }
399- }
400-}
401-
402-function clean_special_chars($text){
403- for ($i=128; $i<=159; $i++){
404- $text = ereg_replace(chr($i), "?", $text );
405- }
406- return $text;
407+//This function should let openERP know about the shop
408+function init() {
409+ $values = array();
410+ $values[] = new xmlrpcval(PLATAFORMA, "string");
411+ return new xmlrpcresp( new xmlrpcval($values, "array"));
412 }
413
414 function get_taxes() {
415 $taxes = array();
416
417- $result = mysql_query("select tax_class_id, tax_class_title from tax_class;");
418+ $result = mysql_query("select tax_class_id, tax_class_title from ".TABLE_TAX_CLASS.";");
419 if ($result) while ($row = mysql_fetch_row($result)) {
420- $taxes[] = new xmlrpcval(array(new xmlrpcval($row[0], "int"), new xmlrpcval($row[1], "string")), "array");
421+ $taxes[] = new xmlrpcval(array(new xmlrpcval($row[0], "int"), new xmlrpcval(utf8_encode($row[1]), "string")), "array");
422 }
423 return new xmlrpcresp( new xmlrpcval($taxes, "array"));
424 }
425@@ -79,9 +100,9 @@
426 function get_statuses() {
427 $status = array();
428
429- $result = mysql_query("select orders_status_id, orders_status_name, language_id from orders_status;");
430+ $result = mysql_query("select orders_status_id, orders_status_name, language_id from ".TABLE_ORDERS_STATUS);
431 if ($result) while ($row = mysql_fetch_row($result)) {
432- $status[] = new xmlrpcval(array(new xmlrpcval($row[0], "int"), new xmlrpcval(clean_special_chars($row[1]), "string"), new xmlrpcval($row[2], "int")), "array");
433+ $status[] = new xmlrpcval(array(new xmlrpcval($row[0], "int"), new xmlrpcval(utf8_encode($row[1]), "string"), new xmlrpcval($row[2], "int")), "array");
434 }
435 return new xmlrpcresp( new xmlrpcval($status, "array"));
436 }
437@@ -89,10 +110,9 @@
438
439 function get_languages() {
440 $languages = array();
441-
442- $result = mysql_query("select languages_id, name from languages;");
443+ $result = mysql_query("select languages_id, name from ".TABLE_LANGUAGES.";");
444 if ($result) while ($row = mysql_fetch_row($result)) {
445- $languages[] = new xmlrpcval(array(new xmlrpcval($row[0], "int"), new xmlrpcval(clean_special_chars($row[1]), "string")), "array");
446+ $languages[] = new xmlrpcval(array(new xmlrpcval($row[0], "int"), new xmlrpcval(utf8_encode($row[1]), "string")), "array");
447 }
448 return new xmlrpcresp(new xmlrpcval($languages, "array"));
449 }
450@@ -101,11 +121,11 @@
451 function get_categories() {
452 $categories = array();
453
454- $result = mysql_query("select categories_id, min(language_id) from categories_description group by categories_id;");
455+ $result = mysql_query("select categories_id, min(language_id) from ".TABLE_CATEGORIES_DESCRIPTION." group by categories_id;");
456 if ($result) while ($row = mysql_fetch_row($result)) {
457- $resultb = mysql_query("select categories_id, categories_name from categories_description where categories_id=".$row[0]." and language_id=".$row[1].";");
458+ $resultb = mysql_query("select categories_id, categories_name from ".TABLE_CATEGORIES_DESCRIPTION." where categories_id=".$row[0]." and language_id=".$row[1].";");
459 if ($resultb and $row = mysql_fetch_row($resultb)) {
460- $categories[] = new xmlrpcval(array(new xmlrpcval($row[0], "int"), new xmlrpcval(clean_special_chars(parent_category($row[0],$row[1])), "string")), "array");
461+ $categories[] = new xmlrpcval(array(new xmlrpcval($row[0], "int"), new xmlrpcval(utf8_encode(parent_category($row[0],$row[1])), "string")), "array");
462 }
463 }
464 return new xmlrpcresp( new xmlrpcval($categories, "array"));
465@@ -115,17 +135,16 @@
466 $categories = array();
467 $lang_ids = "";
468
469- foreach ($languages as $lang)
470- $lang_ids = $lang.", ";
471+ foreach ($languages as $lang){
472+ $lang_ids = $lang.", ";
473+ }
474 $lang_ids = substr($lang_ids, 0, strlen($lang_ids)-2);
475- $result = mysql_query("select categories_id, parent_id from categories order by parent_id;");
476+ $result = mysql_query("select categories_id, parent_id from ".TABLE_CATEGORIES." order by parent_id;");
477 if ($result) while ($row = mysql_fetch_row($result)) {
478- //debug('Category: ' . $row[0].'-'. $row[1]);
479 $cat = array(new xmlrpcval($row[0], "int"), new xmlrpcval($row[1], "int"));
480- $resultlang = mysql_query("select categories_id, categories_name from categories_description where categories_id=".$row[0]." and language_id in ($lang_ids);");
481+ $resultlang = mysql_query("select categories_id, categories_name from ".TABLE_CATEGORIES_DESCRIPTION." where categories_id=".$row[0]." and language_id in ($lang_ids);");
482 if ($resultlang) while ($rowl = mysql_fetch_row($resultlang)) {
483- //debug('Category language: ' .$rowl[1]);
484- $cat[] = new xmlrpcval(clean_special_chars($rowl[1]), "string");
485+ $cat[] = new xmlrpcval(utf8_encode($rowl[1]), "string");
486 }
487 $categories[] = new xmlrpcval($cat, "array");
488 }
489@@ -133,6 +152,7 @@
490 }
491
492 function get_products($languages, $osCodIni, $block, $last_date) {
493+ global $languages_id;
494 $products = array();
495 $prod = array();
496 $prod_desc = array();
497@@ -159,59 +179,59 @@
498 products_status,
499 products_tax_class_id,
500 manufacturers_id
501- from products";
502+ from ".TABLE_PRODUCTS;
503
504 $nexo = ' where ';
505
506 if (TRANSACTIONAL){
507 $sQuery .= $nexo . "( products_last_modified >= '" . $last_date . "' ";
508- $nexo = ' or ';
509+ $nexo = ' or ';
510 $sQuery .= $nexo . "products_date_added >= '" . $last_date . "' )" ;
511- $nexo = ' and ';
512- }
513+ $nexo = ' and ';
514+ }
515
516 if ($osCodIni>0){
517 $sQuery .= $nexo . "products_id > " . $osCodIni;
518- $nexo = ' and ';
519- }
520+ $nexo = ' and ';
521+ }
522
523- $sQuery .= " order by products_id LIMIT " . $block;
524+ $sQuery .= " order by products_id LIMIT " . $block;
525 debug('Query: ' .$sQuery);
526 $result = mysql_query($sQuery);
527
528 //debug('IF-WHILE-get_products');
529 if ($result) while ($row_product = mysql_fetch_row($result)) {
530- $resultcateg = mysql_query("select min(categories_id) from products_to_categories
531+ $resultcateg = mysql_query("select min(categories_id) from ".TABLE_PRODUCTS_TO_CATEGORIES."
532 where products_id=".$row_product[0]." group by products_id;");
533 if ($resultcateg) {
534- $row = mysql_fetch_row($resultcateg);
535+ $row = mysql_fetch_row($resultcateg);
536 $prod_cat = $row[0];
537
538 }
539 debug('Producto: ' .$row_product[0]);
540 //Get product's manufacturer name
541 if ($row_product[11] > 0){
542- $resultmanuf = mysql_query("select manufacturers_name from manufacturers where manufacturers_id = ".$row_product[11].";");
543+ $resultmanuf = mysql_query("select manufacturers_name from ".TABLE_MANUFACTURERS." where manufacturers_id = ".$row_product[11].";");
544 if ($resultmanuf){
545 $row_manuf = mysql_fetch_row($resultmanuf);
546 if (strlen($row_manuf[0]) > 0)
547- $manufacturers_name = $row_manuf[0];
548+ $manufacturers_name = $row_manuf[0];
549 else
550- $manufacturers_name = "";
551+ $manufacturers_name = "";
552 }
553 //Get product's manufacturer url on each language
554 $manuf_url = array();
555 $resultmanuflang = mysql_query("select manufacturers_url, languages_id
556- from manufacturers_info where manufacturers_id = ".$row_product[11]." and languages_id in (".$lang_ids.");");
557+ from ".TABLE_MANUFACTURERS_INFO." where manufacturers_id = ".$row_product[11]." and languages_id in (".$lang_ids.");");
558 if ($resultmanuflang) while ($row_manuflang = mysql_fetch_row($resultmanuflang)) {
559 if (strlen($row_manuflang[0]) == 0)
560- $manufacturers_url = "";
561+ $manufacturers_url = "";
562 else
563- $manufacturers_url = $row_manuflang[0];
564+ $manufacturers_url = $row_manuflang[0];
565 $manuf_url[] = new xmlrpcval(array(
566 "languages_id" => new xmlrpcval($row_manuflang[1],"int"),
567 "manufacturers_url" => new xmlrpcval($manufacturers_url,"string"),
568- ), "struct");
569+ ), "struct");
570 }
571 } else {
572 $manufacturers_name = "";
573@@ -221,16 +241,16 @@
574 $prod = new xmlrpcval(array(
575 "products_id" => new xmlrpcval($row_product[0],"int"),
576 "products_quantity" => new xmlrpcval($row_product[1],"int"),
577- "products_model" => new xmlrpcval(clean_special_chars($row_product[2]),"string"),
578- "products_image" => new xmlrpcval(clean_special_chars($row_product[3]),"string"),
579- "products_price" => new xmlrpcval(clean_special_chars($row_product[4]),"string"),
580- "products_date_added" => new xmlrpcval(clean_special_chars($row_product[5]),"string"),
581- "products_last_modified" => new xmlrpcval(clean_special_chars($row_product[6]),"string"),
582- "products_date_available" => new xmlrpcval(clean_special_chars($row_product[7]),"string"),
583- "products_weight" => new xmlrpcval(clean_special_chars($row_product[8]),"string"),
584+ "products_model" => new xmlrpcval(utf8_encode($row_product[2]),"string"),
585+ "products_image" => new xmlrpcval(utf8_encode($row_product[3]),"string"),
586+ "products_price" => new xmlrpcval(utf8_encode($row_product[4]),"string"),
587+ "products_date_added" => new xmlrpcval(utf8_encode($row_product[5]),"string"),
588+ "products_last_modified" => new xmlrpcval(utf8_encode($row_product[6]),"string"),
589+ "products_date_available" => new xmlrpcval(utf8_encode($row_product[7]),"string"),
590+ "products_weight" => new xmlrpcval(utf8_encode($row_product[8]),"string"),
591 "products_status" => new xmlrpcval($row_product[9],"int"),
592 "products_tax_class_id" => new xmlrpcval($row_product[10],"int"),
593- "manufacturers_name" => new xmlrpcval(clean_special_chars($manufacturers_name),"string"),
594+ "manufacturers_name" => new xmlrpcval(utf8_encode($manufacturers_name),"string"),
595 "categ_id" => new xmlrpcval($prod_cat,"int")), "struct");
596 //debug('Product_id: ' . $row_product[0] . '-IMG:' .$row_product[3]. '-CAT:' . $prod_cat);
597
598@@ -242,33 +262,23 @@
599 products_description,
600 products_url,
601 products_viewed
602- from products_description where products_id=".$row_product[0]." and language_id in (".$lang_ids.");");
603+ from ".TABLE_PRODUCTS_DESCRIPTION." where products_id=".$row_product[0]." and language_id in (".$lang_ids.");");
604 if ($resultlang) while ($row_desc = mysql_fetch_row($resultlang)) {
605- /* if (strlen($row_desc[3] == 0))
606- $products_description_str = "";
607- else
608- $products_description_str = $row_desc[3];
609- if (strlen($row_desc[4] == 0))
610- $products_url_str = "";
611- else
612- $products_url_str = $row_desc[4];
613- */
614-
615- $description=clean_special_chars($row_desc[3]);
616- if ($description!=$row_desc[3]){
617+ $description=utf8_encode($row_desc[3]);
618+ if ($description!=$row_desc[3]){
619 debug(date(DATE_ATOM) . ' -- Product_id: ' . $row_desc[0] . ' Language_id: ' . $row_desc[1] . ' -> Undefined characters: Description has been updated.');
620 }
621
622 $prod_desc[] = new xmlrpcval(array(
623- //"products_id" => new xmlrpcval($row_desc[0],"int"),
624+ //"products_id" => new xmlrpcval($row_desc[0],"int"),
625 "language_id" => new xmlrpcval($row_desc[1],"int"),
626- "products_name" => new xmlrpcval(clean_special_chars($row_desc[2]),"string"),
627- "products_description" => new xmlrpcval($description,"string"),
628- "products_url" => new xmlrpcval(clean_special_chars($row_desc[4]),"string"),
629- "products_viewed" => new xmlrpcval(clean_special_chars($row_desc[5]),"string")), "struct");
630+ "products_name" => new xmlrpcval(utf8_encode($row_desc[2]),"string"),
631+ "products_description" => new xmlrpcval(utf8_encode($row_desc[3]),"string"),
632+ "products_url" => new xmlrpcval(utf8_encode($row_desc[4]),"string"),
633+ "products_viewed" => new xmlrpcval(utf8_encode($row_desc[5]),"string")), "struct");
634 //debug('Product_id: ' . $row_desc[0] . 'language_id: ' . $row_desc[1] . 'products_name: ' . $row_desc[2]);
635 }
636-
637+
638 // Get product discounts
639 $prod_spec = new xmlrpcval(array(), "struct"); // If product has not any discount
640 $resultspec = mysql_query("select specials_new_products_price,
641@@ -277,48 +287,44 @@
642 expires_date,
643 date_status_change,
644 status
645- from specials where products_id=". $row_product[0] .
646+ from ".TABLE_SPECIALS." where products_id=". $row_product[0] .
647 " and specials_date_added =
648- (select max(specials_date_added) from specials where products_id=". $row_product[0] . ");");
649+ (select max(specials_date_added) from ".TABLE_SPECIALS." where products_id=". $row_product[0] . ");");
650 if ($resultspec) {
651 $rowesp = mysql_fetch_row($resultspec);
652 //debug('Product specials: ' . $rowesp[0] . " " . $rowesp[3]);
653 $prod_spec = new xmlrpcval(array(
654 "specials_new_products_price" => new xmlrpcval($rowesp[0],"string"),
655- //"specials_date_added" => new xmlrpcval($rowesp[1],"string"),
656- //"specials_last_modified" => new xmlrpcval($rowesp[2],"string"),
657+ //"specials_date_added" => new xmlrpcval($rowesp[1],"string"),
658+ //"specials_last_modified" => new xmlrpcval($rowesp[2],"string"),
659 "expires_date" => new xmlrpcval($rowesp[3],"string"),
660- //"date_status_change" => new xmlrpcval($rowesp[4],"string"),
661+ //"date_status_change" => new xmlrpcval($rowesp[4],"string"),
662 "status" => new xmlrpcval($rowesp[5],"int")), "struct");
663 }
664 // Get product attributes
665 debug('Inicio atributos: ' . $row_product[0]);
666- debug("Query: SELECT p.products_id, op.products_options_name , opv.products_options_values_name
667- FROM products p, products_attributes pa, products_options op, products_options_values opv
668+ $sql = "SELECT p.products_id, op.products_options_name , opv.products_options_values_name
669+ FROM ".TABLE_PRODUCTS." p, ".TABLE_PRODUCTS_ATTRIBUTES." pa, ".TABLE_PRODUCTS_OPTIONS." op, ".TABLE_PRODUCTS_OPTIONS_VALUES." opv
670 WHERE p.products_id = pa.products_id
671 AND pa.options_id = op.products_options_id
672 AND pa.options_values_id = opv.products_options_values_id
673- and p.products_id =". $row_product[0]);
674+ and p.products_id =". $row_product[0] . "
675+ AND opv.language_id=".(int)$languages_id.";";
676+ debug("Query: ".$sql);
677
678 $prod_atrib = array();// If product has not attributes
679-
680- $result_atrib = mysql_query("SELECT p.products_id, op.products_options_name , opv.products_options_values_name
681- FROM products p, products_attributes pa, products_options op, products_options_values opv
682- WHERE p.products_id = pa.products_id
683- AND pa.options_id = op.products_options_id
684- AND pa.options_values_id = opv.products_options_values_id
685- and p.products_id =". $row_product[0] . ";");
686+ $result_atrib = mysql_query($sql);
687 if ($result_atrib) while ($rowatr = mysql_fetch_row($result_atrib)) {
688
689- $num_atrib = explode("-", clean_special_chars($rowatr[2]));
690- $auxi_model = clean_special_chars($row_product[2]) . '-' . $num_atrib[0];
691+ $num_atrib = explode("-", utf8_encode($rowatr[2]));
692+ $auxi_model = utf8_encode($row_product[2]) . '-' . $num_atrib[0];
693
694 debug('Product atributes: ' . $rowatr[0] . " " . $rowatr[1]. " " . $rowatr[2] . 'Codigo prod: ' . $auxi_model);
695 $prod_atrib[] = new xmlrpcval(array(
696- "variants_name" => new xmlrpcval(clean_special_chars($rowatr[1]),"string"),
697- "variants_value" => new xmlrpcval(clean_special_chars($rowatr[2]),"string"),
698+ "variants_name" => new xmlrpcval(utf8_encode($rowatr[1]),"string"),
699+ "variants_value" => new xmlrpcval(utf8_encode($rowatr[2]),"string"),
700 "composed_code" => new xmlrpcval($auxi_model,"string"),
701- ), "struct");
702+ ), "struct");
703 }
704
705
706@@ -328,50 +334,59 @@
707 'product_special' => $prod_spec,
708 'manufacturers_url' => new xmlrpcval($manuf_url, "array"),
709 'variants' => new xmlrpcval($prod_atrib, "array"),
710- ), "struct");
711+ ), "struct");
712 }
713 //debug('END-IF-WHILE-get_products');
714 return new xmlrpcresp(new xmlrpcval($products, "array"));
715 }
716
717 function get_payment_methods() {
718+ global $language;
719 $payment_methods = array();
720
721- $result_modules = mysql_query("SELECT configuration_value FROM configuration WHERE (configuration_key = 'MODULE_PAYMENT_INSTALLED');");
722+ $result_modules = mysql_query("SELECT configuration_value FROM ".TABLE_CONFIGURATION." WHERE (configuration_key = 'MODULE_PAYMENT_INSTALLED');");
723 if ($result_modules && $row_modules=mysql_fetch_row($result_modules)) {
724 $modules = explode(';', $row_modules[0]);
725 }
726 reset($modules);
727 while (list($key, $value) = each($modules)) {
728- include("../../includes/modules/payment/".$value);
729- include("../../includes/languages/espanol/modules/payment/".$value);
730+ $file = DIR_FS_CATALOG_MODULES."payment/".$value;
731+ if (!file_exists($file))continue;
732+ include($file);
733+ include(DIR_FS_CATALOG_LANGUAGES.$language."/modules/payment/".$value);
734 $class = substr($value, 0, strrpos($value, '.'));
735 $obj = new $class();
736- $payment_methods[] = new xmlrpcval(array(new xmlrpcval($key, "int"), new xmlrpcval(clean_special_chars($obj->title), "string")), "array");
737+ $payment_methods[] = new xmlrpcval(array(new xmlrpcval($key, "int"), new xmlrpcval(trim(utf8_encode(html_entity_decode(strip_tags($obj->title)))), "string")), "array");
738 }
739 return new xmlrpcresp( new xmlrpcval($payment_methods, "array"));
740 }
741
742+$arrLanguagesDirs = null;
743+function _loadArrLanguageDirs(){//Avoid making this query more then once
744+ global $arrLanguagesDirs;
745+ $arrLanguagesDirs = array();;
746+ $result=mysql_query("select directory from ".TABLE_LANGUAGES.";");
747+ if ($result) while ($row=mysql_fetch_row($result)) {
748+ $arrLanguagesDirs[] = $row[0];
749+ }
750+}
751+
752 function search_payment_method($payment_name) {
753- $languages = array();
754+ global $arrLanguagesDirs;
755+ if(is_null($arrLanguagesDirs))_loadArrLanguageDirs();
756
757- $result_modules = mysql_query("SELECT configuration_value FROM configuration WHERE (configuration_key = 'MODULE_PAYMENT_INSTALLED');");
758+ $result_modules = mysql_query("SELECT configuration_value FROM ".TABLE_CONFIGURATION." WHERE (configuration_key = 'MODULE_PAYMENT_INSTALLED');");
759 if ($result_modules && $row_modules = mysql_fetch_row($result_modules)) {
760 $modules = explode(';', $row_modules[0]);
761 }
762
763- $result=mysql_query("select directory from languages;");
764- if ($result) while ($row=mysql_fetch_row($result)) {
765- $languages[] = $row[0];
766- }
767-
768 reset($modules);
769 while (list($key, $value) = each($modules)) {
770- foreach ($languages as $lang) {
771+ foreach ($arrLanguagesDirs as $lang) {
772 $title = "";
773 // We must extract the payment method name from the translation file of the payment module
774 // We search lines containing the TEXT_TITLE constant like: define('MODULE_PAYMENT_COD_TEXT_TITLE', 'Cash on Delivery');
775- $gestor = @fopen("../../includes/languages/$lang/modules/payment/$value", "r");
776+ $gestor = @fopen(DIR_FS_CATALOG_LANGUAGES.$lang."/modules/payment/$value", "r");
777 if ($gestor) {
778 while (!feof($gestor) and $title=="") {
779 // Read translation file line by line
780@@ -392,14 +407,14 @@
781
782
783 function parent_category($id, $name) {
784- $result = mysql_query("select parent_id from categories where categories_id=".$id.";");
785+ $result = mysql_query("select parent_id from ".TABLE_CATEGORIES." where categories_id=".$id.";");
786 if ($result && $row = mysql_fetch_row($result)) {
787 if ($row[0] == 0) {
788 return $name;
789 } else {
790- $resultb = mysql_query("select min(language_id) from categories_description where categories_id=".$row[0].";");
791+ $resultb = mysql_query("select min(language_id) from ".TABLE_CATEGORIES_DESCRIPTION." where categories_id=".$row[0].";");
792 if ($resultb && $rowb=mysql_fetch_row($resultb)) {
793- $resultb = mysql_query("select categories_name from categories_description where categories_id=".$row[0]." and language_id=".$rowb[0].";\n");
794+ $resultb = mysql_query("select categories_name from ".TABLE_CATEGORIES_DESCRIPTION." where categories_id=".$row[0]." and language_id=".$rowb[0].";\n");
795 if ($resultb && $rowb=mysql_fetch_row($resultb)) {
796 $name = parent_category($row[0], $rowb[0] . " \\ ". $name);
797 return $name;
798@@ -415,13 +430,15 @@
799 }
800
801 function setSyncronizedFlag($product_id) {
802- mysql_query("update products set products_syncronized = 1, products_last_syncronized = now() where products_id=" . $product_id . ";");
803- return new xmlrpcresp(new xmlrpcval(true,"boolean"));
804+ if(mysql_query("update ".TABLE_PRODUCTS." set products_syncronized = 1, products_last_syncronized = now() where products_id=" . $product_id . ";")){
805+ return new xmlrpcresp(new xmlrpcval(true,"boolean"));
806+ }
807+ return new xmlrpcresp(new xmlrpcval(false,"boolean"));
808 }
809
810 function set_product_stock($tiny_product) {
811- mysql_query("update products set products_quantity=".$tiny_product['quantity']." where products_id=".$tiny_product['product_id'].";");
812- mysql_query("update products set products_status=".(($tiny_product['quantity']>0)?1:0)." where products_id=".$tiny_product['product_id'].";");
813+ mysql_query("update ".TABLE_PRODUCTS." set products_quantity=".$tiny_product['quantity']." where products_id=".$tiny_product['product_id'].";");
814+ mysql_query("update ".TABLE_PRODUCTS." set products_status=".(($tiny_product['quantity']>0)?1:0)." where products_id=".$tiny_product['product_id'].";");
815 return new xmlrpcresp(new xmlrpcval(0,"int"));
816 }
817
818@@ -430,29 +447,29 @@
819 $oscom_id = 0;
820
821 if(array_key_exists('manufacturers_name',$tiny_product)) {
822- $result = mysql_query("select l.languages_id from languages as l ,configuration as c where
823+ $result = mysql_query("select l.languages_id from ".TABLE_LANGUAGES." as l ,configuration as c where
824 c.configuration_key='DEFAULT_LANGUAGE' and c.configuration_value=l.code;");
825
826 if ($result && $row = mysql_fetch_row($result)) {
827 $lang_id = $row[0];
828 }
829- $result = mysql_query("select manufacturers_id from manufacturers where (manufacturers_name='".$tiny_product['manufacturers_name']."');");
830+ $result = mysql_query("select manufacturers_id from ".TABLE_MANUFACTURERS." where (manufacturers_name='".$tiny_product['manufacturers_name']."');");
831 if ($result && $row = mysql_fetch_row($result)) {
832 $id_exist = 1;
833 $oscom_id = $row[0];
834 }
835 if ($id_exist == 0) {
836- mysql_query("insert into manufacturers (manufacturers_name, date_added) values ('".$tiny_product['manufacturers_name']."', now());");
837+ mysql_query("insert into ".TABLE_MANUFACTURERS." (manufacturers_name, date_added) values ('".$tiny_product['manufacturers_name']."', now());");
838 $oscom_id = mysql_insert_id();
839- mysql_query("insert into manufacturers_info (manufacturers_id, languages_id,manufacturers_url) values (".$oscom_id.",".$lang_id.",'".$tiny_product['manufacturers_url']."');");
840+ mysql_query("insert into ".TABLE_MANUFACTURERS_INFO." (manufacturers_id, languages_id,manufacturers_url) values (".$oscom_id.",".$lang_id.",'".$tiny_product['manufacturers_url']."');");
841 foreach ($tiny_product['manufacturer_langs'] as $lang=>$values){
842- mysql_query("insert into manufacturers_info (manufacturers_id, languages_id,manufacturers_url) values (".$oscom_id.",".$lang.",'".$values['manufacturers_url']."');");
843+ mysql_query("insert into ".TABLE_MANUFACTURERS_INFO." (manufacturers_id, languages_id,manufacturers_url) values (".$oscom_id.",".$lang.",'".$values['manufacturers_url']."');");
844 }
845 } else {
846- mysql_query("update manufacturers_info set manufacturers_url='".$tiny_product['manufacturers_url']."' where manufacturers_id=".$oscom_id." and languages_id=".$lang_id.";");
847+ mysql_query("update ".TABLE_MANUFACTURERS_INFO." set manufacturers_url='".$tiny_product['manufacturers_url']."' where manufacturers_id=".$oscom_id." and languages_id=".$lang_id.";");
848 foreach ($tiny_product['manufacturer_langs'] as $lang=>$values){
849- mysql_query("delete from manufacturers_info where manufacturers_id=".$oscom_id." and languages_id=".$lang.";");
850- mysql_query("insert into manufacturers_info (manufacturers_id, languages_id,manufacturers_url) values (".$oscom_id.",".$lang.",'".$values['manufacturers_url']."');");
851+ mysql_query("delete from ".TABLE_MANUFACTURERS_INFO." where manufacturers_id=".$oscom_id." and languages_id=".$lang.";");
852+ mysql_query("insert into ".TABLE_MANUFACTURERS_INFO." (manufacturers_id, languages_id,manufacturers_url) values (".$oscom_id.",".$lang.",'".$values['manufacturers_url']."');");
853 }
854 }
855 }
856@@ -472,123 +489,31 @@
857 $i = $i + 1;
858 }
859 foreach(array('_description','_to_categories','') as $key) {
860- mysql_query("delete from products".$key." where products_id in (".$a.");");
861+ mysql_query("delete from ".TABLE_PRODUCTS.$key." where products_id in (".$a.");");
862 }
863 }
864 return new xmlrpcresp(new xmlrpcval(1, "int"));
865 }
866
867 function del_spe_price($tiny_val) {
868- mysql_query("delete from specials where products_id = ".$tiny_val.";");
869+ mysql_query("delete from ".TABLE_SPECIALS." where products_id = ".$tiny_val.";");
870 return new xmlrpcresp(new xmlrpcval(1, "int"));
871 }
872
873 function set_product_spe($tiny_product) {
874- $lang_id = 1;
875- $id_exist = 0;
876-
877- ////////Check for existance of product_id ///////////
878- debug("localizando producto Oferta: select products_id from products where products_model='".$tiny_product['model']."'");
879- $result = mysql_query("select products_id from products where (products_id=".$tiny_product['product_id'].");");
880- if ($result && $row=mysql_fetch_row($result)) {
881- $id_exist = 1;
882- }
883-
884- $result = mysql_query("select l.languages_id from languages as l configuration as c where c.configuration_key='DEFAULT_LANGUAGE' and c.configuration_value = l.code;");
885-
886- if ($result && $row = mysql_fetch_row($result)) {
887- $lang_id = $row[0];
888- }
889- //if ($tiny_product['quantity']>0) {
890- // $tiny_product['status']=1;
891- //} else {
892- // $tiny_product['status']=0;
893- //}
894- $manufacturers_id = set_product_manufacturer($tiny_product);
895- if ($id_exist == 0) {
896- mysql_query("insert into products (products_quantity, products_model, products_price, products_weight, products_tax_class_id, products_status, manufacturers_id, products_date_added) values (".$tiny_product['quantity'].", '". $tiny_product['model']."', ".$tiny_product['price'].", ".$tiny_product['weight'].", ".$tiny_product['tax_class_id'].", ".$tiny_product['status'].", ".$manufacturers_id.", now());");
897-
898- $oscom_id = mysql_insert_id();
899- if ( $tiny_product['date_available'] != 'NULL') {
900- mysql_query("update products set products_date_available='".$tiny_product['date_available']."' where products_id=".$oscom_id.";");
901- }
902- mysql_query("insert into specials (products_id, specials_new_products_price, specials_date_added, date_status_change, status) values (".$oscom_id.",".$tiny_product['spe_price'].",now(),now(),".$tiny_product['spe_price_status'].");");
903- if ( $tiny_product['exp_date'] != 'NULL') {
904- mysql_query("update specials set expires_date='".$tiny_product['exp_date']."' where products_id=".$oscom_id.";");
905- }
906- mysql_query("insert into products_description (products_id, language_id, products_name, products_description, products_url) values (".$oscom_id.", ".$lang_id.", '".$tiny_product['name']."', '".$tiny_product['description']."', '".$tiny_product['url']."');");
907- mysql_query("insert into products_to_categories (categories_id, products_id) values(".$tiny_product['category_id'].",".$oscom_id.");");
908- foreach ($tiny_product['langs'] as $lang=>$values) {
909- mysql_query("insert into products_description(products_id, language_id, products_name, products_description, products_url)
910- values (".$oscom_id.", ".$lang.", '".$values['name']."', '".$values['description']."', '".$values['url']."');");
911- }
912- } else {
913- debug("localizando producto Modelo existe: select products_id from products where products_id=".$tiny_product['product_id']);
914- $result = mysql_query("select products_id from products where (products_id=".$tiny_product['product_id'].");");
915- if ($result && $row=mysql_fetch_row($result)) {
916- $id_exist = 1;
917- }
918- if ($id_exist){
919- $oscom_id = $tiny_product['product_id'];
920- foreach (array('quantity', 'price', 'weight', 'tax_class_id', 'status', 'date_available') as $key) {
921- if ($key == 'date_available' and $tiny_product[$key] != 'NULL') {
922- mysql_query("update products set products_".$key."='".$tiny_product[$key]."' where products_id=".$oscom_id.";");
923- } else {
924- mysql_query("update products set products_".$key."=".$tiny_product[$key]." where products_id=".$oscom_id.";");
925- }
926- }
927- mysql_query("delete from specials where products_id=".$oscom_id.";");
928- mysql_query("insert into specials (products_id, specials_new_products_price, specials_date_added, date_status_change, status) values (".$oscom_id.",".$tiny_product['spe_price'].",now(),now(),".$tiny_product['spe_price_status'].");");
929- if ( $tiny_product['exp_date'] != 'NULL') {
930- mysql_query("update specials set expires_date='".$tiny_product['exp_date']."' where products_id=".$oscom_id.";");
931- }
932-
933- mysql_query("update products set products_model='".$tiny_product['model']."', manufacturers_id=".$manufacturers_id." where products_id=".$oscom_id.";");
934-
935- mysql_query("update products_to_categories set categories_id=".$tiny_product['category_id']." where products_id=".$oscom_id.";");
936- foreach ($tiny_product['langs'] as $lang=>$values) {
937- mysql_query("update products_description set ".
938- " products_id = " . $oscom_id .
939- ", language_id = ". $lang .
940- ", products_name = '".$values['name']."'" .
941- ", products_description = '".$values['description']."'" .
942- ", products_url = '".$values['url']."'".
943- " where products_id=".$oscom_id." and language_id=".$lang.";");
944- }
945- }
946- }
947-
948- $cpt = 0;
949- if ($tiny_product['haspic']==1) {
950- if (file_exists('../../images/'.$cpt.'-'.$tiny_product['fname'])) {
951- unlink('../../images/'.$cpt.'-'.$tiny_product['fname']); // DELETE THE EXISTING IMAGES
952- }
953- if ($hd = fopen('../../images/'.$cpt.'-'.$tiny_product['fname'], "w")) {
954- fwrite($hd, base64_decode($tiny_product['picture']));
955- fclose($hd);
956- mysql_query("update products set products_image='".$cpt."-".$tiny_product['fname']."' where products_id=".$oscom_id.";");
957- }
958- } else if ($tiny_product['haspic']==2) {
959- if (file_exists('../../images/'.$cpt.'-'.$tiny_product['fname'])) {
960- unlink('../../images/'.$cpt.'-'.$tiny_product['fname']); // DELETE THE EXISTING IMAGES
961- }
962- mysql_query("update products set products_image='".$tiny_product['fname']."' where products_id=".$oscom_id.";");
963- } else {
964- mysql_query("update products set products_image=NULL where products_id=".$oscom_id.";");
965- }
966- return new xmlrpcresp(new xmlrpcval($oscom_id, "int"));
967+ return set_product_classical($tiny_product,true);
968 }
969
970-function set_product_classical($tiny_product) {
971+function set_product_classical($tiny_product,$spe = false ) {
972 $lang_id = 1;
973 $id_exist = 0;
974
975 ////////Check for existance of product ///////////
976- $result = mysql_query("select products_id from products where (products_id=".$tiny_product['product_id'].");");
977+ $result = mysql_query("select products_id from ".TABLE_PRODUCTS." where (products_id=".$tiny_product['product_id'].");");
978 if ($result && $row=mysql_fetch_row($result)) {
979 $id_exist = 1;
980 }
981- $result = mysql_query("select l.languages_id from languages as l configuration as c where c.configuration_key='DEFAULT_LANGUAGE' and c.configuration_value=l.code;");
982+ $result = mysql_query("select l.languages_id from ".TABLE_LANGUAGES." as l, ".TABLE_CONFIGURATION." as c where c.configuration_key='DEFAULT_LANGUAGE' and c.configuration_value=l.code;");
983
984 if ($result && $row = mysql_fetch_row($result)) {
985 $lang_id = $row[0];
986@@ -600,75 +525,87 @@
987 //}
988 $manufacturers_id = set_product_manufacturer($tiny_product);
989 if ($id_exist == 0) {
990- mysql_query("insert into products (products_quantity, products_model, products_price, products_weight, products_tax_class_id, products_status, manufacturers_id, products_date_added) values (".$tiny_product['quantity'].", '". $tiny_product['model']."', ".$tiny_product['price'].", ".$tiny_product['weight'].", ".$tiny_product['tax_class_id'].", ".$tiny_product['status'].", ".$manufacturers_id.", now());");
991+ mysql_query("insert into ".TABLE_PRODUCTS." (products_quantity, products_model, products_price, products_weight, products_tax_class_id, products_status, manufacturers_id, products_date_added) values (".$tiny_product['quantity'].", '". $tiny_product['model']."', ".$tiny_product['price'].", ".$tiny_product['weight'].", ".$tiny_product['tax_class_id'].", ".$tiny_product['status'].", ".$manufacturers_id.", now());");
992
993 $oscom_id = mysql_insert_id();
994 if ( $tiny_product['date_available'] != 'NULL') {
995- mysql_query("update products set products_date_available='".$tiny_product['date_available']."' where products_id=".$oscom_id.";");
996- }
997- mysql_query("insert into products_description (products_id, language_id, products_name, products_description, products_url) values (".$oscom_id.", ".$lang_id.", '".$tiny_product['name']."', '".$tiny_product['description']."', '".$tiny_product['url']."');");
998- mysql_query("insert into products_to_categories (categories_id, products_id) values(".$tiny_product['category_id'].",".$oscom_id.");");
999+ mysql_query("update ".TABLE_PRODUCTS." set products_date_available='".$tiny_product['date_available']."' where products_id=".$oscom_id.";");
1000+ }
1001+ if($spe){
1002+ mysql_query("insert into ".TABLE_SPECIALS." (products_id, specials_new_products_price, specials_date_added, date_status_change, status) values (".$oscom_id.",".$tiny_product['spe_price'].",now(),now(),".$tiny_product['spe_price_status'].");");
1003+ if ( $tiny_product['exp_date'] != 'NULL') {
1004+ mysql_query("update ".TABLE_SPECIALS." set expires_date='".$tiny_product['exp_date']."' where products_id=".$oscom_id.";");
1005+ }
1006+ }
1007+ mysql_query("insert into ".TABLE_PRODUCTS_DESCRIPTION." (products_id, language_id, products_name, products_description, products_url) values (".$oscom_id.", ".$lang_id.", '".$tiny_product['name']."', '".$tiny_product['description']."', '".$tiny_product['url']."');");
1008+ mysql_query("insert into ".TABLE_PRODUCTS_TO_CATEGORIES." (categories_id, products_id) values(".$tiny_product['category_id'].",".$oscom_id.");");
1009 foreach ($tiny_product['langs'] as $lang=>$values) {
1010- mysql_query("insert into products_description(products_id, language_id, products_name, products_description, products_url)
1011+ mysql_query("insert into ".TABLE_PRODUCTS_DESCRIPTION." (products_id, language_id, products_name, products_description, products_url)
1012 values (".$oscom_id.", ".$lang.", '".$values['name']."', '".$values['description']."', '".$values['url']."');");
1013 }
1014 } else {
1015- debug("localizando producto Modelo existe: select products_id from products where products_id=".$tiny_product['product_id']);
1016- $result = mysql_query("select products_id from products where (products_id=".$tiny_product['product_id'].");");
1017+ $sql = "select products_id from ".TABLE_PRODUCTS." where (products_id=".$tiny_product['product_id'].");";
1018+ debug("localizando producto Modelo existe: ".$sql);
1019+ $result = mysql_query($sql);
1020 if ($result && $row=mysql_fetch_row($result)) {
1021 $id_exist = 1;
1022 }
1023 if ($id_exist){
1024-
1025- $oscom_id = $tiny_product['product_id'];
1026- foreach (array('quantity', 'price', 'weight', 'tax_class_id', 'status', 'date_available') as $key) {
1027- if ($key == 'date_available' and $tiny_product[$key] != 'NULL') {
1028- mysql_query("update products set products_".$key."='".$tiny_product[$key]."' where products_id=".$oscom_id.";");
1029- } else {
1030- mysql_query("update products set products_".$key."=".$tiny_product[$key]." where products_id=".$oscom_id.";");
1031- }
1032- }
1033-
1034- mysql_query("update products set products_model='".$tiny_product['model']."', manufacturers_id=".$manufacturers_id." where products_id=".$oscom_id.";");
1035-
1036- mysql_query("update products_to_categories set categories_id=".$tiny_product['category_id']." where products_id=".$oscom_id.";");
1037- foreach ($tiny_product['langs'] as $lang=>$values) {
1038- mysql_query("update products_description set ".
1039+
1040+ $oscom_id = $tiny_product['product_id'];
1041+ foreach (array('quantity', 'price', 'weight', 'tax_class_id', 'status', 'date_available') as $key) {
1042+ if ($key == 'date_available' and $tiny_product[$key] != 'NULL') {
1043+ mysql_query("update ".TABLE_PRODUCTS." set products_".$key."='".$tiny_product[$key]."' where products_id=".$oscom_id.";");
1044+ } else {
1045+ mysql_query("update ".TABLE_PRODUCTS." set products_".$key."=".$tiny_product[$key]." where products_id=".$oscom_id.";");
1046+ }
1047+ }
1048+ if($spe){
1049+ mysql_query("delete from ".TABLE_SPECIALS." where products_id=".$oscom_id.";");
1050+ mysql_query("insert into ".TABLE_SPECIALS." (products_id, specials_new_products_price, specials_date_added, date_status_change, status) values (".$oscom_id.",".$tiny_product['spe_price'].",now(),now(),".$tiny_product['spe_price_status'].");");
1051+ if ( $tiny_product['exp_date'] != 'NULL') {
1052+ mysql_query("update ".TABLE_SPECIALS." set expires_date='".$tiny_product['exp_date']."' where products_id=".$oscom_id.";");
1053+ }
1054+ }
1055+ mysql_query("update ".TABLE_PRODUCTS." set products_model='".$tiny_product['model']."', manufacturers_id=".$manufacturers_id." where products_id=".$oscom_id.";");
1056+
1057+ mysql_query("update ".TABLE_PRODUCTS_TO_CATEGORIES." set categories_id=".$tiny_product['category_id']." where products_id=".$oscom_id.";");
1058+ foreach ($tiny_product['langs'] as $lang=>$values) {
1059+ mysql_query("update ".TABLE_PRODUCTS_DESCRIPTION." set ".
1060 " products_id = " . $oscom_id .
1061 ", language_id = ". $lang .
1062 ", products_name = '".$values['name']."'" .
1063 ", products_description = '".$values['description']."'" .
1064 ", products_url = '".$values['url']."'".
1065 " where products_id=".$oscom_id." and language_id=".$lang.";");
1066+ }
1067 }
1068 }
1069- }
1070 $cpt = 0;
1071 if ($tiny_product['haspic']==1) {
1072- if (file_exists('../../images/'.$cpt.'-'.$tiny_product['fname'])) {
1073- unlink('../../images/'.$cpt.'-'.$tiny_product['fname']); // DELETE THE EXISTING IMAGES
1074+ if (file_exists(DIR_WS_CATALOG_IMAGES.$cpt.'-'.$tiny_product['fname'])) {
1075+ unlink(DIR_WS_CATALOG_IMAGES.$cpt.'-'.$tiny_product['fname']); // DELETE THE EXISTING IMAGES
1076 }
1077- if ($hd=fopen('../../images/'.$cpt.'-'.$tiny_product['fname'], "w")){
1078+ if ($hd=fopen(DIR_WS_CATALOG_IMAGES.$cpt.'-'.$tiny_product['fname'], "w")){
1079 fwrite($hd, base64_decode($tiny_product['picture']));
1080 fclose($hd);
1081- mysql_query("update products set products_image='".$cpt."-".$tiny_product['fname']."' where products_id=".$oscom_id.";");
1082+ mysql_query("update ".TABLE_PRODUCTS." set products_image='".$cpt."-".$tiny_product['fname']."' where products_id=".$oscom_id.";");
1083 }
1084 } else if ($tiny_product['haspic']==2) {
1085- if (file_exists('../../images/'.$cpt.'-'.$tiny_product['fname'])) {
1086- unlink('../../images/'.$cpt.'-'.$tiny_product['fname']); // DELETE THE EXISTING IMAGES
1087+ if (file_exists(DIR_WS_CATALOG_IMAGES.$cpt.'-'.$tiny_product['fname'])) {
1088+ unlink(DIR_WS_CATALOG_IMAGES.$cpt.'-'.$tiny_product['fname']); // DELETE THE EXISTING IMAGES
1089 }
1090- mysql_query("update products set products_image='".$tiny_product['fname']."' where products_id=".$oscom_id.";");
1091+ mysql_query("update ".TABLE_PRODUCTS." set products_image='".$tiny_product['fname']."' where products_id=".$oscom_id.";");
1092 } else {
1093- mysql_query("update products set products_image=NULL where products_id=".$oscom_id.";");
1094+ mysql_query("update ".TABLE_PRODUCTS." set products_image=NULL where products_id=".$oscom_id.";");
1095 }
1096 return new xmlrpcresp(new xmlrpcval($oscom_id, "int"));
1097 }
1098
1099-
1100 function get_order_address($address_condition, $oscom_id, $name, $street, $street2, $zip, $city, $state, $zone, $country, $email="", $phone="", $fax="") {
1101 $addresses = array();
1102- $num_rows = 0;
1103- $query = "SELECT address_book_id,CONCAT(entry_firstname,' ',entry_lastname) as name, entry_street_address, entry_suburb, entry_postcode, entry_city, entry_state, entry_country_id, entry_zone_id FROM address_book";
1104+ $num_rows = 0;
1105+ $query = "SELECT address_book_id,CONCAT(entry_firstname,' ',entry_lastname) as name, entry_street_address, entry_suburb, entry_postcode, entry_city, entry_state, entry_country_id, entry_zone_id FROM ".TABLE_ADDRESS_BOOK;
1106 //debug("Init address controll:". $name . "-zip: ". $zip . "-city" . $city . "-state" . $state . "-country" . $country);
1107
1108 if (is_array($address_condition)) {
1109@@ -692,7 +629,7 @@
1110 }
1111 $result = mysql_query($query.$where);
1112 $num_rows = mysql_num_rows($result);
1113- }
1114+ }
1115 if ($num_rows>0) {
1116 return get_partner_address($address_condition,$email, $phone, $fax);
1117 }
1118@@ -708,16 +645,16 @@
1119 $state_data = get_state_detail($country,$state_name);
1120 $ret_address = array(
1121 "esale_oscom_id" => new xmlrpcval($oscom_id,"int"),
1122- "name" => new xmlrpcval(clean_special_chars($name),"string"),
1123- "street" => new xmlrpcval(clean_special_chars($street),"string"),
1124- "street2" => new xmlrpcval(clean_special_chars($street2),"string"),
1125- "zip" => new xmlrpcval(clean_special_chars($zip),"string"),
1126- "city" => new xmlrpcval(clean_special_chars($city),"string"),
1127+ "name" => new xmlrpcval(utf8_encode($name),"string"),
1128+ "street" => new xmlrpcval(utf8_encode($street),"string"),
1129+ "street2" => new xmlrpcval(utf8_encode($street2),"string"),
1130+ "zip" => new xmlrpcval(utf8_encode($zip),"string"),
1131+ "city" => new xmlrpcval(utf8_encode($city),"string"),
1132 "state" => $state_data,
1133 "country" => $country_data,
1134- "email" => new xmlrpcval(clean_special_chars($email),"string"),
1135- "phone" => new xmlrpcval(clean_special_chars($phone),"string"),
1136- "fax" => new xmlrpcval(clean_special_chars($fax),"string")
1137+ "email" => new xmlrpcval(utf8_encode($email),"string"),
1138+ "phone" => new xmlrpcval(utf8_encode($phone),"string"),
1139+ "fax" => new xmlrpcval(utf8_encode($fax),"string")
1140 );
1141
1142 $addresses[] = new xmlrpcval($ret_address,"struct");
1143@@ -729,7 +666,7 @@
1144
1145 function get_partner_address($address_condition, $email="", $phone="", $fax="") {
1146 $addresses = array();
1147- $query = "SELECT address_book_id,CONCAT(entry_firstname,' ',entry_lastname) as name, entry_street_address, entry_suburb, entry_postcode, entry_city, entry_state, entry_country_id, entry_zone_id FROM address_book";
1148+ $query = "SELECT address_book_id,CONCAT(entry_firstname,' ',entry_lastname) as name, entry_street_address, entry_suburb, entry_postcode, entry_city, entry_state, entry_country_id, entry_zone_id FROM ".TABLE_ADDRESS_BOOK;
1149
1150 if (is_array($address_condition)) {
1151 $where = " where ";
1152@@ -762,16 +699,16 @@
1153 $state_data = get_state_detail($row_address['entry_country_id'],$state_name);
1154 $ret_address = array(
1155 "esale_oscom_id" => new xmlrpcval($row_address['address_book_id'],"int"),
1156- "name" => new xmlrpcval(clean_special_chars($row_address['name']),"string"),
1157- "street" => new xmlrpcval(clean_special_chars($row_address['entry_street_address']),"string"),
1158- "street2" => new xmlrpcval(clean_special_chars($row_address['entry_suburb']),"string"),
1159- "zip" => new xmlrpcval(clean_special_chars($row_address['entry_postcode']),"string"),
1160- "city" => new xmlrpcval(clean_special_chars($row_address['entry_city']),"string"),
1161+ "name" => new xmlrpcval(utf8_encode($row_address['name']),"string"),
1162+ "street" => new xmlrpcval(utf8_encode($row_address['entry_street_address']),"string"),
1163+ "street2" => new xmlrpcval(utf8_encode($row_address['entry_suburb']),"string"),
1164+ "zip" => new xmlrpcval(utf8_encode($row_address['entry_postcode']),"string"),
1165+ "city" => new xmlrpcval(utf8_encode($row_address['entry_city']),"string"),
1166 "state" => $state_data,
1167 "country" => $country_data,
1168- "email" => new xmlrpcval(clean_special_chars($email),"string"),
1169- "phone" => new xmlrpcval(clean_special_chars($phone),"string"),
1170- "fax" => new xmlrpcval(clean_special_chars($fax),"string")
1171+ "email" => new xmlrpcval(utf8_encode($email),"string"),
1172+ "phone" => new xmlrpcval(utf8_encode($phone),"string"),
1173+ "fax" => new xmlrpcval(utf8_encode($fax),"string")
1174 );
1175 $addresses[] = new xmlrpcval($ret_address,"struct");
1176 }
1177@@ -781,52 +718,22 @@
1178
1179 function get_customer($cust_id) {
1180 $ret_partners = array();
1181- $condition = '';
1182- $file="../../temp/logsynchrophp.txt";
1183- $f=fopen($file,"a");
1184-
1185- $query = "SELECT customers_id, CONCAT(customers_firstname,' ',customers_lastname) as name, customers_email_address, customers_default_address_id, customers_telephone, customers_fax from customers";
1186-
1187- if ($cust_id != 0) {
1188- $condition = " where customers_id=".$cust_id;
1189- }
1190- $result = mysql_query($query.$condition.';');
1191+ $query = "SELECT customers_id, CONCAT(customers_firstname,' ',customers_lastname) as name, customers_email_address, customers_default_address_id, customers_telephone, customers_fax from ".TABLE_CUSTOMERS.($cust_id != 0?" where customers_id=".$cust_id:"");
1192+ $result = mysql_query($query);
1193+
1194 if ($result) while ($row_cust=mysql_fetch_array($result, MYSQL_ASSOC)) {
1195 $addresses = get_partner_address(array('customers_id'=>$row_cust['customers_id']));
1196+ $query_company = "select IF(isnull(entry_nif) OR entry_nif='','23232323T',entry_nif) entry_nif,IF(isnull(entry_company) OR entry_company='','NO_COMPANY',entry_company) entry_company from ".TABLE_ADDRESS_BOOK." where customers_id = " .$row_cust['customers_id'];
1197+ $result_company = mysql_fetch_array(mysql_query($query_company), MYSQL_ASSOC);
1198 $partner = array();
1199+ //$partner['nif'] = $result_company[0];
1200+ //$partner['company'] = new xmlrpcval($result_company['entry_company'], "string");
1201 $partner['esale_oscom_id'] = new xmlrpcval($row_cust['customers_id'],"int");
1202- $partner['name'] = new xmlrpcval(clean_special_chars($row_cust['name']),"string");
1203-
1204-//!!!!!!!!!!! BE CAREFULL, ENTRY_NIF is VAT NUMBER IN SPAIN, if you obtain
1205-///// response error when executing sales order download, remove the field or addecuate the name
1206- $query_company = "select a.entry_nif, a.entry_company
1207- from address_book a, customers c
1208- where c.customers_id = " . $row_cust['customers_id'] . " and a.address_book_id = c.customers_default_address_id;";
1209- $result_company = mysql_query($query_company);
1210- if ($result_company) while ($row_nif=mysql_fetch_array($result_company, MYSQL_ASSOC)) {
1211- $cif_nif = str_replace(' ', '',str_replace('-', '',strtoupper($row_nif['entry_nif'])));
1212- fwrite($f, "TRATANDO NIF: " . $cif_nif . " -- Longitud: " . strlen($cif_nif) );
1213-
1214- if (strlen($cif_nif)== 9) {
1215- $partner['vat'] = new xmlrpcval("ES" . clean_special_chars($cif_nif), "string");
1216- fwrite($f, " -- NIF CORRECTO: " . "ES" . $cif_nif);
1217- fwrite($f, " -- Nombre: " . $row_cust['name']);
1218- fwrite($f, " -- Compania: " . $row_nif['entry_company']. " -- IDCliente: " . $row_cust['customers_id'] . "\n");
1219- }else {
1220- $cif_nif = "01234567L";
1221- $partner['vat'] = new xmlrpcval("ES" . clean_special_chars($cif_nif), "string");
1222- fwrite($f, " -- ERROR EN NIF: " . "ES" . $cif_nif);
1223- fwrite($f, " -- Nombre: " . $row_cust['name']);
1224- fwrite($f, " -- Compania " . $row_nif['entry_company']. " -- IDCliente " . $row_cust['customers_id'] . "\n");
1225- }
1226-
1227- if ($row_nif['entry_company']!= '' ) {
1228- $partner['name'] = new xmlrpcval(clean_special_chars($row_nif['entry_company']),"string");
1229- fwrite($f, "existe compania " . $row_nif['entry_company'] . "\n");
1230- }else{
1231- $partner['name'] = new xmlrpcval(clean_special_chars($row_cust['name']),"string");
1232- fwrite($f, "NO existe compania " . $partner['company'] . "\n");
1233- }
1234+ $partner['vat'] = new xmlrpcval("ES" . $result_company['entry_nif'], "string");
1235+ if ($partner['company']<> 'NO_COMPANY' ) {
1236+ $partner['name'] = new xmlrpcval(utf8_encode($row_cust['name']),"string");
1237+ }else {
1238+ $partner['name'] = new xmlrpcval(utf8_encode($partner['company']),"string");
1239 }
1240 $partner['addresses'] = $addresses;
1241 $ret_partners[] = new xmlrpcval($partner,"struct");
1242@@ -836,8 +743,7 @@
1243
1244
1245 function get_country_detail($country_name) {
1246- $query = "select countries_id, countries_name, countries_iso_code_2, countries_iso_code_3 from countries";
1247- $ret_country = '0';
1248+ $query = "select countries_id, countries_name, countries_iso_code_2, countries_iso_code_3 from ".TABLE_COUNTRIES;
1249
1250 if (!is_numeric($country_name)) {
1251 if($country_name != '') {
1252@@ -849,19 +755,24 @@
1253 if ($result && $row=mysql_fetch_row($result)) {
1254 $ret_country = new xmlrpcval( array (
1255 "esale_oscom_id" => new xmlrpcval($row[0],"int"),
1256- "name" => new xmlrpcval(clean_special_chars($row[1]),"string"),
1257- "code" => new xmlrpcval(clean_special_chars($row[2]),"string"),
1258- "code3" => new xmlrpcval(clean_special_chars($row[3]),"string")
1259+ "name" => new xmlrpcval(utf8_encode($row[1]),"string"),
1260+ "code" => new xmlrpcval(utf8_encode($row[2]),"string"),
1261+ "code3" => new xmlrpcval(utf8_encode($row[3]),"string")
1262 ),"struct");
1263 return $ret_country;
1264 }
1265- return new xmlrpcval($ret_country,'string');
1266+ return new xmlrpcval( array (
1267+ "esale_oscom_id" => new xmlrpcval(0,"int"),
1268+ "name" => new xmlrpcval("UNKNOWN","string"),
1269+ "code" => new xmlrpcval("UN","string"),
1270+ "code3" => new xmlrpcval("UNK","string")
1271+ ),"struct");
1272 }
1273
1274
1275 function get_state_detail($country_id,$state_name) {
1276 $ret_state = '0';
1277- $query = "select zone_id, zone_code, zone_name from zones";
1278+ $query = "select zone_id, zone_code, zone_name from ".TABLE_ZONES;
1279 $condition = '';
1280
1281 if (!is_numeric($state_name)) {
1282@@ -875,42 +786,49 @@
1283 if ($result && $row=mysql_fetch_row($result)) {
1284 $ret_state = new xmlrpcval( array (
1285 "esale_oscom_id" => new xmlrpcval($row[0],"int"),
1286- "name" => new xmlrpcval(clean_special_chars($row[2]),"string"),
1287- "code" => new xmlrpcval(clean_special_chars($row[1]),"string")
1288+ "name" => new xmlrpcval(utf8_encode($row[2]),"string"),
1289+ "code" => new xmlrpcval(utf8_encode($row[1]),"string")
1290 ),"struct");
1291 return $ret_state;
1292 }
1293 $ret_state = new xmlrpcval( array (
1294 "esale_oscom_id" => new xmlrpcval(0,"int"),
1295- "name" => new xmlrpcval(clean_special_chars($state_name),"string"),
1296+ "name" => new xmlrpcval(utf8_encode($state_name),"string"),
1297 "code" => new xmlrpcval('',"string")
1298 ),"struct");
1299 return $ret_state;
1300 }
1301
1302
1303-function get_saleorders($last_so, $statuses_ids) {
1304+function get_saleorders($last_so, $statuses_ids, $block_size=100) {
1305 $saleorders = array();
1306 $status_ids = implode(", ", $statuses_ids);
1307
1308-
1309- debug("SELECT `orders_id` , `customers_name` , `customers_street_address` , `customers_city` , `customers_postcode` , `customers_state` , `customers_country` , `customers_telephone` , `customers_email_address` , `delivery_name` , `delivery_street_address` , `delivery_city` , `delivery_postcode` , `delivery_state` , `delivery_country` , `billing_name` , `billing_street_address` , `billing_city` , `billing_postcode` , `billing_state` , `billing_country` , `date_purchased` , `orders_status`, `customers_id`, `payment_method`, `customers_id`,`customers_company`,`delivery_company`,`billing_company`
1310- FROM `orders` where (orders_id > ".$last_so." and orders_status in (" . $status_ids . ")) order by orders_id limit 1;");
1311-
1312- $result = mysql_query("SELECT `orders_id` , `customers_name` , `customers_street_address` , `customers_city` , `customers_postcode` , `customers_state` , `customers_country` , `customers_telephone` , `customers_email_address` , `delivery_name` , `delivery_street_address` , `delivery_city` , `delivery_postcode` , `delivery_state` , `delivery_country` , `billing_name` , `billing_street_address` , `billing_city` , `billing_postcode` , `billing_state` , `billing_country` , `date_purchased` , `orders_status`, `customers_id`, `payment_method`, `customers_id`,`customers_company`,`delivery_company`,`billing_company`
1313- FROM `orders` where (orders_id > ".$last_so." and orders_status in (" . $status_ids . ")) order by orders_id limit 1;");
1314+ $result = mysql_query("SELECT `orders_id` , `customers_name` , `customers_street_address` , `customers_city` , `customers_postcode` , `customers_state` , `customers_country` , `customers_email_address`, `customers_telephone` , `delivery_name` , `delivery_street_address` , `delivery_city` , `delivery_postcode` , `delivery_state` , `delivery_country` , `billing_name` , `billing_street_address` , `billing_city` , `billing_postcode` , `billing_state` , `billing_country` , `date_purchased` , `orders_status`, `customers_id`, `payment_method`, `customers_id`,`customers_company`,`delivery_company`,`billing_company`
1315+ FROM ".TABLE_ORDERS." where (orders_id > ".$last_so." and orders_status in (" . $status_ids . ")) order by orders_id limit ".$block_size.";");
1316
1317 if ($result){
1318 while ($row = mysql_fetch_row($result)) {
1319- debug("En pedido while: " . $row[0]);
1320 $shopping_price = 0;
1321- $result_shopping = mysql_query("SELECT value, title from orders_total where class='ot_shipping' and orders_id=".$row[0].";");
1322+ $result_shopping = mysql_query("SELECT value, title from ".TABLE_ORDERS_TOTAL." where class='ot_shipping' and orders_id=".$row[0].";");
1323 if ($result_shopping && $row_shopping=mysql_fetch_row($result_shopping)) {
1324 $shopping_price = $row_shopping[0];
1325 $shipping_title = $row_shopping[1];
1326 }
1327+ $dcoupon_price = 0;
1328+ $result_coupon = mysql_query("SELECT value, title from ".TABLE_ORDERS_TOTAL." where class='ot_discount_coupon' and orders_id=".$row[0].";");
1329+ if ($result_coupon && $row_coupon=mysql_fetch_row($result_coupon)) {
1330+ $dcoupon_price = $row_coupon[0];
1331+ $dcoupon_title = $row_coupon[1];
1332+ }
1333+ $cash_price = 0;
1334+ $result_cash = mysql_query("SELECT value, title from ".TABLE_ORDERS_TOTAL." where class='ot_fixed_payment_chg' and orders_id=".$row[0].";");
1335+ if ($result_cash && $row_cash=mysql_fetch_row($result_cash)) {
1336+ $cash_price = $row_cash[0];
1337+ $cash_title = $row_cash[1];
1338+ }
1339
1340- $result_customer = mysql_query("SELECT customers_email_address, customers_telephone, customers_fax FROM customers WHERE customers_id=".$row[25].";");
1341+ $result_customer = mysql_query("SELECT customers_email_address, customers_telephone, customers_fax FROM ".TABLE_CUSTOMERS." WHERE customers_id=".$row[25].";");
1342 if ($result_customer && $row_customer=mysql_fetch_row($result_customer)) {
1343 $email = $row_customer[0];
1344 $phone = $row_customer[1];
1345@@ -922,7 +840,7 @@
1346 "entry_street_address"=>$row[2],
1347 "entry_city"=>$row[3],
1348 "entry_postcode"=>$row[4]
1349- );
1350+ );
1351 $oscom_id = 9990;
1352 $name= $row[1];
1353 $street = $row[2];
1354@@ -944,7 +862,7 @@
1355 "entry_street_address"=>$row[10],
1356 "entry_city"=>$row[11],
1357 "entry_postcode"=>$row[12]
1358- );
1359+ );
1360 $oscom_id = 9991;
1361 $name= $row[9];
1362 $street = $row[10];
1363@@ -963,7 +881,7 @@
1364 "entry_street_address"=>$row[16],
1365 "entry_city"=>$row[17],
1366 "entry_postcode"=>$row[18]
1367- );
1368+ );
1369 $oscom_id = 9992;
1370 $name= $row[15];
1371 $street = $row[16];
1372@@ -976,63 +894,62 @@
1373 $billing_address =get_order_address($billing_condition, $oscom_id, $name, $street, $street2, $zip, $city, $state, $zone, $country, $email, $phone, $fax);
1374 //$billing_address = get_partner_address($billing_condition, $email, $phone, $fax);
1375
1376- $result_status = mysql_query("select orders_status_name from orders_status where orders_status_id = " . $row[22].";");
1377+ $result_status = mysql_query("select orders_status_name from ".TABLE_ORDER_STATUS." where orders_status_id = " . $row[22].";");
1378 if ($result_status && $row_status=mysql_fetch_row($result_status)) {
1379- $status = $row_status[0];
1380+ $status = $row_status[0];
1381 }
1382 $orderlines = array();
1383- $resultb = mysql_query("select products_id, products_quantity, products_price, products_tax, products_name, orders_products_id, products_model from orders_products where orders_id=".$row[0]." UNION select 999999, 1, value, '16.0000', title, 0,'' from orders_total where class not in('ot_subtotal', 'ot_total', 'ot_tax') and orders_id=".$row[0].";");
1384- debug("query lineas pedidos:". $resultb);
1385+ $resultb = mysql_query("select products_id, products_quantity, products_price, products_tax, products_name, orders_products_id from ".TABLE_ORDERS_PRODUCTS." where orders_id=".$row[0].";");
1386 if ($resultb){
1387 while ($rowb = mysql_fetch_row($resultb)) {
1388 $values_array = array("product_id" => new xmlrpcval($rowb[0], "int"),
1389 "product_qty" => new xmlrpcval($rowb[1], "int"),
1390 "price" => new xmlrpcval($rowb[2], "double"),
1391 "tax_rate" => new xmlrpcval($rowb[3],"double"),
1392- "products_model" => new xmlrpcval(html_entity_decode(clean_special_chars($rowb[6])),"string"),
1393- "name" => new xmlrpcval(html_entity_decode(clean_special_chars($rowb[4])),"string"));
1394- $result_orders_product_attributes = mysql_query("select products_options, products_options_values, options_values_price, price_prefix from orders_products_attributes where orders_id=".$row[0]." and orders_products_id=".$rowb[5].";");
1395+ "products_model" => new xmlrpcval(trim(utf8_encode(html_entity_decode($rowb[6]))),"string"),
1396+ "name" => new xmlrpcval(utf8_encode(html_entity_decode($rowb[4])),"string"));
1397+ $result_orders_product_attributes = mysql_query("select products_options, products_options_values, options_values_price, if(isnull(price_prefix) OR price_prefix='','+',price_prefix) price_prefix from ".TABLE_ORDERS_PRODUCTS_ATTRIBUTES." where orders_id=".$row[0]." and orders_products_id=".$rowb[5].";");
1398 if($result_orders_product_attributes && $row_orders_product_attributes= mysql_fetch_row($result_orders_product_attributes)) {
1399- //debug("En atributos línea:" . $row_orders_product_attributes[0]);
1400- if ($row_orders_product_attributes[3] !== '+' and $row_orders_product_attributes[3] !== '-'){$row_orders_product_attributes[3]='+';}
1401-
1402- //debug("En atributos línea prefijo :" . $row_orders_product_attributes[3]);
1403- $num_atrib = explode("-", clean_special_chars($row_orders_product_attributes[1]));
1404- $auxi_model = clean_special_chars($rowb[6]) . '-' . $num_atrib[0];
1405+ $num_atrib = explode("-", utf8_encode($row_orders_product_attributes[1]));
1406+ $auxi_model = utf8_encode($rowb[6]) . '-' . $num_atrib[0];
1407
1408 $orders_product_attributes = new xmlrpcval( array(
1409- "products_options" => new xmlrpcval(clean_special_chars($row_orders_product_attributes[0]),"string"),
1410- "products_options_values" => new xmlrpcval(clean_special_chars($row_orders_product_attributes[1]),"string"),
1411+ "products_options" => new xmlrpcval(utf8_encode($row_orders_product_attributes[0]),"string"),
1412+ "products_options_values" => new xmlrpcval(utf8_encode($row_orders_product_attributes[1]),"string"),
1413 "options_values_price" => new xmlrpcval($row_orders_product_attributes[2],"double"),
1414 "composed_code" => new xmlrpcval($auxi_model,"string"),
1415- "price_prefix" => new xmlrpcval(clean_special_chars($row_orders_product_attributes[3]),"string")), "struct");
1416+ "price_prefix" => new xmlrpcval(utf8_encode($row_orders_product_attributes[3]),"string")), "struct");
1417 $values_array["attributes"] = $orders_product_attributes;
1418 }
1419 $orderlines[] = new xmlrpcval($values_array, "struct");
1420 }
1421 }
1422 $note = "";
1423- $result_comments = mysql_query("select comments FROM orders_status_history where (orders_id = ".$row[0]." and orders_status_id = 1);");
1424+ $result_comments = mysql_query("select comments FROM ".TABLE_ORDERS_STATUS_HISTORY." where (orders_id = ".$row[0]." and orders_status_id = 1);");
1425 if ($result_comments && $row_comments=mysql_fetch_row($result_comments)) {
1426 $note=$row_comments[0];
1427 }
1428-// $result_price_with_tax = mysql_query("SELECT configuration_value FROM configuration where (configuration_key = 'DISPLAY_PRICE_WITH_TAX');");
1429-// if ($result_price_with_tax && $row_price_with_tax=mysql_fetch_row($result_price_with_tax)) {
1430-// if ($row_price_with_tax[0] == 'false') {
1431- $price_type="tax_excluded";
1432-// } else {
1433-// $price_type="tax_included";
1434-// }
1435-// }
1436+ // $result_price_with_tax = mysql_query("SELECT configuration_value FROM configuration where (configuration_key = 'DISPLAY_PRICE_WITH_TAX');");
1437+ // if ($result_price_with_tax && $row_price_with_tax=mysql_fetch_row($result_price_with_tax)) {
1438+ // if ($row_price_with_tax[0] == 'false') {
1439+ $price_type="tax_excluded";
1440+ // } else {
1441+ // $price_type="tax_included";
1442+ // }
1443+ // }
1444 $saleorders[] = new xmlrpcval( array("id" => new xmlrpcval( $row[0], "int"),
1445- "price_type" => new xmlrpcval( clean_special_chars($price_type), "string" ),
1446- "note" => new xmlrpcval(clean_special_chars($note), "string" ),
1447+ "price_type" => new xmlrpcval( utf8_encode($price_type), "string" ),
1448+ "note" => new xmlrpcval(utf8_encode($note), "string" ),
1449 "lines" => new xmlrpcval( $orderlines, "array"),
1450- "pay_met" => new xmlrpcval( search_payment_method($row[24]), "int"),
1451- "pay_met_title" => new xmlrpcval( clean_special_chars($row[24]), "string"),
1452+ "pay_met" => new xmlrpcval(search_payment_method($row[24]), "int"),
1453+ "pay_met_title" => new xmlrpcval( trim(utf8_encode(html_entity_decode(strip_tags($row[24])))), "string"),
1454 "shipping_price" => new xmlrpcval( $shopping_price, "double"),
1455- "shipping_title" => new xmlrpcval(html_entity_decode(clean_special_chars($shipping_title)), "string"),
1456- "orders_status" => new xmlrpcval( clean_special_chars($status), "string"),
1457+ "shipping_title" => new xmlrpcval(utf8_encode($shipping_title), "string"),
1458+ "dcoupon_price" => new xmlrpcval( $dcoupon_price, "double"),
1459+ "dcoupon_title" => new xmlrpcval(utf8_encode($dcoupon_title), "string"),
1460+ "cash_price" => new xmlrpcval( $cash_price, "double"),
1461+ "cash_title" => new xmlrpcval(utf8_encode($cash_title), "string"),
1462+ "orders_status" => new xmlrpcval( utf8_encode($status), "string"),
1463 "partner" => get_customer($row[25]),
1464 "date" => new xmlrpcval( $row[21], "string"),
1465 "address" => $default_address,
1466@@ -1046,79 +963,77 @@
1467
1468
1469 function get_min_open_orders($last_so) {
1470- $result = mysql_query("SELECT min(`orders_id`) as min FROM `orders` where (orders_id <= ".$last_so.") and (orders_status = 2);");
1471+ $result = mysql_query("SELECT min(`orders_id`) as min FROM ".TABLE_ORDERS." where (orders_id <= ".$last_so.") and (orders_status = 2);");
1472 if ($result) {
1473 $min = mysql_fetch_row($result);
1474 return new xmlrpcresp( new xmlrpcval($min[0], "int"));
1475 } else
1476- return new xmlrpcresp( new xmlrpcval(-1, "int"));
1477+ return new xmlrpcresp( new xmlrpcval(-1, "int"));
1478 }
1479
1480
1481
1482 function get_max_products_id() {
1483- $result = mysql_query("SELECT max(`products_id`) as max FROM `products`;");
1484+ $result = mysql_query("SELECT max(`products_id`) as max FROM ".TABLE_PRODUCTS);
1485 if ($result) {
1486 $max = mysql_fetch_row($result);
1487 return new xmlrpcresp( new xmlrpcval($max[0], "int"));
1488 } else
1489- return new xmlrpcresp( new xmlrpcval(-1, "int"));
1490+ return new xmlrpcresp( new xmlrpcval(-1, "int"));
1491 }
1492
1493 function get_min_products_id() {
1494- $result = mysql_query("SELECT min(`products_id`) as min FROM `products`;");
1495+ $result = mysql_query("SELECT min(`products_id`) as min FROM ".TABLE_PRODUCTS);
1496 if ($result) {
1497 $min = mysql_fetch_row($result);
1498 return new xmlrpcresp( new xmlrpcval($min[0], "int"));
1499 } else
1500- return new xmlrpcresp( new xmlrpcval(-1, "int"));
1501+ return new xmlrpcresp( new xmlrpcval(-1, "int"));
1502 }
1503
1504
1505 function close_open_orders($order_id, $order_status_id) {
1506- mysql_query("update orders set orders_status= " . $order_status_id . " where orders_id=".$order_id.";");
1507+ mysql_query("update ".TABLE_ORDERS." set orders_status=3 where orders_id=".$order_id.";");
1508 return new xmlrpcresp(new xmlrpcval(0, "int"));
1509 }
1510
1511
1512 function process_order($order_id, $order_status_id) {
1513- debug("ONPROCESS: update orders set orders_status = " . $order_status_id . " where orders_id = ".$order_id.";");
1514-
1515- mysql_query("update orders set orders_status= " . $order_status_id . " where orders_id=".$order_id.";");
1516+ mysql_query("update ".TABLE_ORDERS." set orders_status= " . $order_status_id . " where orders_id=".$order_id.";");
1517 return new xmlrpcresp(new xmlrpcval(0, "int"));
1518 }
1519
1520
1521 function update_order_status($order_id, $order_status_id, $status_comment, $update_comment, $send_web_email) {
1522
1523- $oID = $order_id;
1524-
1525- mysql_query("update orders set orders_status = '" . $order_status_id . "', last_modified = now() where orders_id = '" . (int)$oID . "'");
1526- $customer_notified = $send_web_email;
1527+ $oID = $order_id;
1528+
1529+ mysql_query("update ".TABLE_ORDERS." set orders_status = '" . $order_status_id . "', last_modified = now() where orders_id = '" . (int)$oID . "'");
1530+ $customer_notified = $send_web_email;
1531
1532 if ($update_comment){
1533- debug("ACTUALIZAR COMENTARIOS insert into orders_status_history (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . $order_status_id . "', now(), '1', '" . $status_comment . "')");
1534- mysql_query("insert into orders_status_history (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . $order_status_id . "', now(), '". $customer_notified . "', '" . $status_comment . "')");
1535+ debug("ACTUALIZAR COMENTARIOS insert into orders_status_history (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . $order_status_id . "', now(), '1', '" . $status_comment . "')");
1536+ mysql_query("insert into ".TABLE_ORDERS_STATUS_HISTORY." (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . $order_status_id . "', now(), '". $customer_notified . "', '" . $status_comment . "')");
1537 }else {
1538- debug("NO ACTUALIZAR COMENTARIOS insert into orders_status_history (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . $order_status_id . "', now(), '1', '')");
1539- mysql_query("insert into orders_status_history (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . $order_status_id . "', now(), '". $customer_notified . "', '')");
1540+ debug("NO ACTUALIZAR COMENTARIOS insert into orders_status_history (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . $order_status_id . "', now(), '1', '')");
1541+ mysql_query("insert into ".TABLE_ORDERS_STATUS_HISTORY." (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . (int)$oID . "', '" . $order_status_id . "', now(), '". $customer_notified . "', '')");
1542 }
1543
1544 if ($send_web_email) {
1545- $check_status_query = mysql_query("select customers_name, customers_email_address, orders_status, date_purchased
1546- from orders where orders_id = '" . (int)$oID . "'");
1547-
1548- if ($check_status_query && $check_status=mysql_fetch_row($check_status_query)) {
1549- debug("ONCHANGEORDER1: en envio e-mail;");
1550- $email = $status_comment ;
1551-
1552- debug("ONCHANGEORDER2: " . $email);
1553- // $headers = "From: \r\n";
1554- // mail($check_status['customers_email_address'],'Subject', $email, $headers );
1555-
1556-
1557- debug("ONCHANGEORDER: en envio e-mail;");
1558- }
1559+ $check_status_query = mysql_query("select customers_name, customers_email_address, orders_status, date_purchased
1560+ from ".TABLE_ORDER." where orders_id = '" . (int)$oID . "'");
1561+
1562+ if ($check_status_query && $check_status=mysql_fetch_row($check_status_query)) {
1563+ debug("ONCHANGEORDER1: en envio e-mail;");
1564+ $email = $status_comment ;
1565+
1566+ debug("ONCHANGEORDER2: " . $email);
1567+ // $headers = "From: \r\n";
1568+ // mail($check_status['customers_email_address'],'Subject', $email, $headers );
1569+
1570+
1571+ debug("ONCHANGEORDER: en envio e-mail;");
1572+ }
1573 } else {
1574 debug("ONCHANGEORDER: en NO envio e-mail;");
1575 }
1576@@ -1127,99 +1042,34 @@
1577 return new xmlrpcresp(new xmlrpcval(0, "int"));
1578 }
1579
1580-$server = new xmlrpc_server( array( "get_taxes" => array( "function" => "get_taxes",
1581- "signature" => array( array($xmlrpcArray)
1582- )
1583- ),
1584- "get_statuses" => array( "function" => "get_statuses",
1585- "signature" => array( array($xmlrpcArray)
1586- )
1587- ),
1588-
1589- "get_languages" => array( "function" => "get_languages",
1590- "signature" => array( array($xmlrpcArray)
1591- )
1592- ),
1593- "get_categories" => array( "function" => "get_categories",
1594- "signature" => array( array($xmlrpcArray)
1595- )
1596- ),
1597- "get_categories_parent" => array( "function" => "get_categories_parent",
1598- "signature" => array( array($xmlrpcArray, $xmlrpcArray)
1599- )
1600- ),
1601- "get_products" => array( "function" => "get_products",
1602- "signature" => array( array($xmlrpcArray, $xmlrpcArray, $xmlrpcInt, $xmlrpcInt, $xmlrpcString)
1603- )
1604- ),
1605- "get_payment_methods" => array( "function" => "get_payment_methods",
1606- "signature" => array( array($xmlrpcArray)
1607- )
1608- ),
1609- "get_saleorders" => array( "function" => "get_saleorders",
1610- "signature" => array( array($xmlrpcArray, $xmlrpcInt ,$xmlrpcArray)
1611- )
1612- ),
1613- "get_min_products_id" => array( "function" => "get_min_products_id",
1614- "signature" => array( array($xmlrpcInt)
1615- )
1616- ),
1617- "get_max_products_id" => array( "function" => "get_max_products_id",
1618- "signature" => array( array($xmlrpcInt)
1619- )
1620- ),
1621- "get_min_open_orders" => array( "function" => "get_min_open_orders",
1622- "signature" => array( array($xmlrpcInt, $xmlrpcInt)
1623- )
1624- ),
1625- "set_product_spe" => array( "function" => "set_product_spe",
1626- "signature" => array( array($xmlrpcInt, $xmlrpcStruct)
1627- )
1628- ),
1629- "set_product_classical" => array( "function" => "set_product_classical",
1630- "signature" => array( array($xmlrpcInt, $xmlrpcStruct)
1631- )
1632- ),
1633- "remove_product" => array( "function" => "remove_product",
1634- "signature" => array( array($xmlrpcInt, $xmlrpcStruct)
1635- )
1636- ),
1637- "del_spe_price" => array( "function" => "del_spe_price",
1638- "signature" => array( array($xmlrpcInt, $xmlrpcInt)
1639- )
1640- ),
1641- "update_order_status" => array( "function" => "update_order_status",
1642- "signature" => array( array($xmlrpcInt, $xmlrpcInt, $xmlrpcInt, $xmlrpcString, $xmlrpcInt, $xmlrpcInt)
1643- )
1644- ),
1645-
1646- "isTransactional" => array( "function" => "isTransactional",
1647- "signature" => array( array($xmlrpcBoolean)
1648- )
1649- ),
1650- "setSyncronizedFlag" => array( "function" => "setSyncronizedFlag",
1651- "signature" => array( array($xmlrpcBoolean, $xmlrpcInt)
1652- )
1653- ),
1654- "set_product_stock" => array( "function" => "set_product_stock",
1655- "signature" => array( array($xmlrpcInt, $xmlrpcStruct)
1656- )
1657- ),
1658- "process_order" => array( "function" => "process_order",
1659- "signature" => array( array($xmlrpcInt, $xmlrpcInt, $xmlrpcInt)
1660- )
1661- ),
1662- "close_open_orders" => array( "function" => "close_open_orders",
1663- "signature" => array( array($xmlrpcInt, $xmlrpcInt, $xmlrpcInt)
1664- )
1665- ),
1666- "get_customer" => array( "function" => "get_customer",
1667- "signature" => array( array($xmlrpcArray, $xmlrpcInt)
1668- )
1669- )
1670-
1671- ), false);
1672+$server = new xmlrpc_server(array(
1673+ "init" => array("function" => "init" ,"signature" => array(array($xmlrpcArray))),
1674+ "get_taxes" => array("function" => "get_taxes" ,"signature" => array(array($xmlrpcArray))),
1675+ "get_statuses" => array("function" => "get_statuses" ,"signature" => array(array($xmlrpcArray))),
1676+ "get_languages" => array("function" => "get_languages" ,"signature" => array(array($xmlrpcArray))),
1677+ "get_categories" => array("function" => "get_categories" ,"signature" => array(array($xmlrpcArray))),
1678+ "get_categories_parent" => array("function" => "get_categories_parent","signature" => array(array($xmlrpcArray, $xmlrpcArray))),
1679+ "get_products" => array("function" => "get_products" ,"signature" => array(array($xmlrpcArray, $xmlrpcArray, $xmlrpcInt, $xmlrpcInt, $xmlrpcString))),
1680+ "get_payment_methods" => array("function" => "get_payment_methods" ,"signature" => array(array($xmlrpcArray))),
1681+ "get_saleorders" => array("function" => "get_saleorders" ,"signature" => array(array($xmlrpcArray, $xmlrpcInt ,$xmlrpcArray, $xmlrpcInt))),
1682+ "get_min_products_id" => array("function" => "get_min_products_id" ,"signature" => array(array($xmlrpcInt))),
1683+ "get_max_products_id" => array("function" => "get_max_products_id" ,"signature" => array(array($xmlrpcInt))),
1684+ "get_min_open_orders" => array("function" => "get_min_open_orders" ,"signature" => array(array($xmlrpcInt, $xmlrpcInt))),
1685+ "set_product_spe" => array("function" => "set_product_spe" ,"signature" => array(array($xmlrpcInt, $xmlrpcStruct))),
1686+ "set_product_classical" => array("function" => "set_product_classical","signature" => array(array($xmlrpcInt, $xmlrpcStruct))),
1687+ "remove_product" => array("function" => "remove_product" ,"signature" => array(array($xmlrpcInt, $xmlrpcStruct))),
1688+ "del_spe_price" => array("function" => "del_spe_price" ,"signature" => array(array($xmlrpcInt, $xmlrpcInt))),
1689+ "update_order_status" => array("function" => "update_order_status" ,"signature" => array(array($xmlrpcInt, $xmlrpcInt, $xmlrpcInt, $xmlrpcString, $xmlrpcInt, $xmlrpcInt))),
1690+ "isTransactional" => array("function" => "isTransactional" ,"signature" => array(array($xmlrpcBoolean))),
1691+ "setSyncronizedFlag" => array("function" => "setSyncronizedFlag" ,"signature" => array(array($xmlrpcBoolean, $xmlrpcInt))),
1692+ "set_product_stock" => array("function" => "set_product_stock" ,"signature" => array(array($xmlrpcInt, $xmlrpcStruct))),
1693+ "process_order" => array("function" => "process_order" ,"signature" => array(array($xmlrpcInt, $xmlrpcInt, $xmlrpcInt))),
1694+ "close_open_orders" => array("function" => "close_open_orders" ,"signature" => array(array($xmlrpcInt, $xmlrpcInt, $xmlrpcInt))),
1695+ "get_customer" => array("function" => "get_customer" ,"signature" => array(array($xmlrpcArray, $xmlrpcInt)))
1696+
1697+), false);
1698 $server->functions_parameters_type = 'phpvals';
1699-$server->response_charset_encoding = RESPONSE_ENCODING;
1700+//$server->response_charset_encoding = RESPONSE_ENCODING;
1701 $server->service();
1702-?>
1703+include(DIR_WS_INCLUDES."application_bottom.php");
1704+?>
1705\ No newline at end of file
1706
1707=== added file 'esale_osc/connector/openerp_login.php'
1708--- esale_osc/connector/openerp_login.php 1970-01-01 00:00:00 +0000
1709+++ esale_osc/connector/openerp_login.php 2010-07-21 10:31:39 +0000
1710@@ -0,0 +1,41 @@
1711+<?php
1712+function login($url,$user,$pass){
1713+ //GET SESSION COOKIE AND SECURITY TOKEN FOR ZENCART
1714+ $ch = curl_init();
1715+ curl_setopt($ch, CURLOPT_URL, $url."login.php");
1716+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
1717+ curl_setopt($ch, CURLOPT_HEADER, 1);
1718+ curl_setopt($ch, CURLOPT_POST, 0);
1719+ curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
1720+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
1721+ curl_setopt($ch, CURLOPT_TIMEOUT, 30);
1722+ $res = curl_exec ($ch);
1723+ preg_match("/Set-Cookie\: ([^;]*);/",$res,$cookie);
1724+ preg_match("/name=\"securityToken\" value=\"([^\"]*)\"/",$res,$sec_token);
1725+ if($sec_token[1]){
1726+ $post_fields="admin_name=".$user."&admin_pass=".$pass."&securityToken=".$sec_token[1]."&submit=Login";
1727+ }else{
1728+ $post_fields="username=".$user."&password=".$pass;
1729+ }
1730+ //LOGIN INTO ADMINISTRATION
1731+ $header[] = "Content-type: application/x-www-form-urlencoded"; //Important header, won't work if any other content type set
1732+ $header[] = "Content-length: ".strlen($post_fields);
1733+ $header[] = "Cookie: ".$cookie[1];
1734+ $ch = curl_init();
1735+ curl_setopt($ch, CURLOPT_URL, $url."login.php?action=process&".$cookie[1]);
1736+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
1737+ curl_setopt($ch, CURLOPT_HEADER, 1);
1738+ curl_setopt($ch, CURLOPT_POST, 1);
1739+ curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
1740+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
1741+ curl_setopt($ch, CURLOPT_HTTPHEADER,$header);
1742+ curl_setopt($ch, CURLOPT_POSTFIELDS,$post_fields);
1743+ curl_setopt($ch, CURLOPT_TIMEOUT, 30);
1744+ $res = curl_exec ($ch);
1745+ preg_match("/Set-Cookie\: ([^;]*);/",$res,$new_cookie);
1746+ if($new_cookie[1])$cookie[1]=$new_cookie[1];
1747+ list($ses_name,$sessid)=split('=',$cookie[1]);
1748+ session_id($sessid);
1749+ //echo $res;
1750+}
1751+?>
1752\ No newline at end of file
1753
1754=== added file 'esale_osc/connector/openerp_runonce.php'
1755--- esale_osc/connector/openerp_runonce.php 1970-01-01 00:00:00 +0000
1756+++ esale_osc/connector/openerp_runonce.php 2010-07-21 10:31:39 +0000
1757@@ -0,0 +1,10 @@
1758+<?php
1759+if(tep_db_num_rows(tep_db_query('describe '.TABLE_ADDRESS_BOOK.' entry_nif'))==0){
1760+ tep_db_query('ALTER TABLE '.TABLE_ADDRESS_BOOK.' ADD entry_nif VARCHAR( 32 )');
1761+}
1762+if(tep_db_num_rows(tep_db_query('describe '.TABLE_PRODUCTS.' products_syncronized'))==0){
1763+ tep_db_query('ALTER TABLE '.TABLE_PRODUCTS.' ADD products_syncronized int(1)');
1764+ tep_db_query('ALTER TABLE '.TABLE_PRODUCTS.' ADD products_last_syncronized datetime');
1765+}
1766+unlink(__FILE__);
1767+?>
1768\ No newline at end of file
1769
1770=== modified file 'esale_osc/esale_oscom.py'
1771--- esale_osc/esale_oscom.py 2010-06-04 15:39:08 +0000
1772+++ esale_osc/esale_oscom.py 2010-07-21 10:31:39 +0000
1773@@ -1,3 +1,4 @@
1774+# -*- coding: utf-8 -*-
1775 # -*- encoding: utf-8 -*-
1776 ##############################################################################
1777 #
1778@@ -5,6 +6,7 @@
1779 # Copyright (c) 2008 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Reserved.
1780 # Jordi Esteve <jesteve@zikzakmedia.com>
1781 # Ana Juaristi <ajuaristio@gmail.com>
1782+# Copyright (c) 2010 ZhenIT Software (http://ZhenIT.com/).
1783 # $Id$
1784 #
1785 # This program is free software: you can redistribute it and/or modify
1786@@ -30,24 +32,6 @@
1787 from mx import DateTime
1788 from tools.translate import _
1789
1790-
1791-class esale_oscom_web(osv.osv):
1792- _name = 'esale.oscom.web'
1793-esale_oscom_web()
1794-
1795-
1796-class esale_oscom_tax(osv.osv):
1797- _name = "esale.oscom.tax"
1798- _description = "esale_oscom Tax"
1799- _columns = {
1800- 'name': fields.char('Tax name', size=32, required=True, readonly=True),
1801- 'esale_oscom_id': fields.integer('OScommerce Id'),
1802- 'web_id': fields.many2one('esale.oscom.web', 'Website'),
1803- 'tax_id': fields.many2one('account.tax', 'OpenERP tax'),
1804- }
1805-esale_oscom_tax()
1806-
1807-
1808 class esale_oscom_status(osv.osv):
1809 _name = "esale.oscom.status"
1810 _description = "esale_oscom Status"
1811@@ -60,86 +44,16 @@
1812 }
1813 esale_oscom_status()
1814
1815-
1816-class esale_oscom_category(osv.osv):
1817- _name = "esale.oscom.category"
1818- _description = "esale_oscom Category"
1819- _columns = {
1820- 'name': fields.char('Name', size=64, required=True, readonly=True),
1821- 'esale_oscom_id': fields.integer('OScommerce Id', required=True),
1822- 'web_id': fields.many2one('esale.oscom.web', 'Website'),
1823- 'category_id': fields.many2one('product.category', 'OpenERP category'),
1824- }
1825-esale_oscom_category()
1826-
1827-
1828-class esale_oscom_paytype(osv.osv):
1829- _name = "esale.oscom.paytype"
1830- _description = "esale_oscom PayType"
1831- _columns = {
1832- 'name': fields.char('Name', size=64, required=True, readonly=True),
1833- 'esale_oscom_id': fields.integer('OScommerce Id', required=True),
1834- 'web_id': fields.many2one('esale.oscom.web', 'Website'),
1835- 'payment_id': fields.many2one('payment.type', 'OpenERP payment'),
1836- 'paytyp': fields.selection([('type1','SO in State Draft'),('type2','SO Confirmed'),('type3','Invoice Draft'),('type4','Invoice Confirmed'),('type5','Invoice Payed')], 'Payment type'),
1837- 'journal_id': fields.many2one('account.journal', 'OpenERP payment journal'),
1838- }
1839-esale_oscom_paytype()
1840-
1841-
1842-class esale_oscom_language(osv.osv):
1843- _name = "esale.oscom.lang"
1844- _description = "esale_oscom Language"
1845- _columns = {
1846- 'name': fields.char('Name', size=32, required=True, readonly=True),
1847- 'esale_oscom_id': fields.integer('OScommerce Id', required=True),
1848- 'web_id': fields.many2one('esale.oscom.web', 'Website'),
1849- 'language_id': fields.many2one('res.lang', 'OpenERP language'),
1850- }
1851-esale_oscom_language()
1852-
1853-
1854-class esale_oscom_product(osv.osv):
1855- _name = "esale.oscom.product"
1856- _description = "esale_oscom Product"
1857- _columns = {
1858- 'name': fields.char('Name', size=64, required=True, readonly=True),
1859- 'esale_oscom_id': fields.integer('OScommerce product Id'),
1860- 'web_id': fields.many2one('esale.oscom.web', 'Website'),
1861- 'product_id': fields.many2one('product.product', 'OpenERP product'),
1862- }
1863-
1864- def onchange_product_id(self, cr, uid, ids, product_id, web_id):
1865- value = {}
1866- if (product_id):
1867- product = self.pool.get('product.product').browse(cr, uid, product_id)
1868- value['name'] = product.name
1869- return {'value': value}
1870-
1871- def unlink(self, cr, uid, ids, context=None):
1872- websites = {}
1873- for esale_product in self.browse(cr, uid, ids):
1874- web_product_ids = websites.get(esale_product.web_id and esale_product.web_id.id)
1875- if web_product_ids and len(web_product_ids):
1876- web_product_ids.append(esale_product.esale_oscom_id)
1877- else:
1878- websites[esale_product.web_id and esale_product.web_id.id] = [esale_product.esale_oscom_id]
1879- websites_objs = self.pool.get('esale.oscom.web').browse(cr, uid, [x for x in websites.keys() if type(x) is int])
1880- for website in websites_objs:
1881- server = xmlrpclib.ServerProxy("%s/openerp-synchro.php" % website.url)
1882- server.remove_product({'oscom_product_ids':websites.get(website.id)})
1883- return super(esale_oscom_product,self).unlink(cr, uid, ids, context)
1884-esale_oscom_product()
1885-
1886-
1887 class esale_oscom_web(osv.osv):
1888 _name = "esale.oscom.web"
1889 _description = "OScommerce Website"
1890 _columns = {
1891 'name': fields.char('Name',size=64, required=True),
1892 'url': fields.char('URL', size=128, required=True),
1893+ 'admin_user': fields.char('Admin User', size=128, required=True),
1894+ 'admin_pass': fields.char('Admin Pass', size=128, required=True),
1895 'shop_id': fields.many2one('sale.shop', 'Sale shop', required=True),
1896-# 'partner_anonymous_id': fields.many2one('res.partner', 'Anonymous', required=True),
1897+ 'default_partner_category': fields.many2one('res.partner.category', 'Customers partner category', required=False),
1898 'active': fields.boolean('Active'),
1899 'product_ids': fields.one2many('esale.oscom.product', 'web_id', 'Web products'),
1900 'language_ids': fields.one2many('esale.oscom.lang', 'web_id', 'Languages'),
1901@@ -152,13 +66,22 @@
1902 'date_download_from':fields.date('Date Download From', help="Specify date since you want to download modified or new products"),
1903 'intermediate': fields.many2one('esale.oscom.status', 'Intermediate Status', help="Select intermediate status for Osc downloaded Orders"),
1904 'download_number': fields.integer('Download number', help="Osc product number to download by block. You should find the optimum block to download for your shop"),
1905+ 'override_products_data': fields.boolean('Override Products Data', help="Click if you want to Update products data on the shop with changes made in openerp."),
1906+ 'plataforma': fields.char('Plataforma', size=16),
1907 }
1908 _defaults = {
1909 'active': lambda *a: 1,
1910- 'price_type': lambda *a:'0',
1911+ 'plataforma': lambda *a:'osc',
1912+ 'price_type': lambda *a:'0',
1913+ 'override_products_data': lambda *a:True,
1914 'download_number': lambda *a:30,
1915 }
1916-
1917+ def create(self, cr, uid, vals, context=None):
1918+ server = xmlrpclib.ServerProxy("%s/openerp-synchro.php?admin_user=%s&admin_pass=%s" % (vals['url'],vals['admin_user'],vals['admin_pass']))
1919+ init_vals = server.init()
1920+ vals["plataforma"] = init_vals[0]
1921+ return super(esale_oscom_web, self).create(cr, uid, vals, context=context)
1922+
1923 def add_all_products(self, cr, uid, ids, *args):
1924 esale_product_obj = self.pool.get('esale.oscom.product')
1925 for id in ids:
1926@@ -176,7 +99,7 @@
1927 def tax_import(self, cr, uid, ids, *args):
1928 esale_tax_obj = self.pool.get('esale.oscom.tax')
1929 for website in self.browse(cr, uid, ids):
1930- server = xmlrpclib.ServerProxy("%s/openerp-synchro.php" % website.url)
1931+ server = xmlrpclib.ServerProxy("%s/openerp-synchro.php?admin_user=%s&admin_pass=%s" % (website.url,website.admin_user,website.admin_pass))
1932 taxes = server.get_taxes()
1933 for tax in taxes:
1934 update_taxes_ids = esale_tax_obj.search(cr, uid, [('web_id','=',website.id), ('esale_oscom_id','=',tax[0])])
1935@@ -194,7 +117,7 @@
1936 def status_import(self, cr, uid, ids, *args):
1937 esale_status_obj = self.pool.get('esale.oscom.status')
1938 for website in self.browse(cr, uid, ids):
1939- server = xmlrpclib.ServerProxy("%s/openerp-synchro.php" % website.url)
1940+ server = xmlrpclib.ServerProxy("%s/openerp-synchro.php?admin_user=%s&admin_pass=%s" % (website.url,website.admin_user,website.admin_pass))
1941 statuses = server.get_statuses()
1942 for status in statuses:
1943 update_statuses_ids = esale_status_obj.search(cr, uid, [('web_id','=',website.id), ('esale_oscom_id','=',status[0])])
1944@@ -215,7 +138,7 @@
1945 def lang_import(self, cr, uid, ids, *args):
1946 esale_lang_obj = self.pool.get('esale.oscom.lang')
1947 for website in self.browse(cr, uid, ids):
1948- server = xmlrpclib.ServerProxy("%s/openerp-synchro.php" % website.url)
1949+ server = xmlrpclib.ServerProxy("%s/openerp-synchro.php?admin_user=%s&admin_pass=%s" % (website.url,website.admin_user,website.admin_pass))
1950 languages = server.get_languages()
1951 for language in languages:
1952 update_language_ids = esale_lang_obj.search(cr, uid, [('web_id','=',website.id), ('esale_oscom_id','=',language[0])])
1953@@ -234,7 +157,7 @@
1954 def get_payment_methods(self, cr, uid, ids, *args):
1955 esale_paytype_obj = self.pool.get('esale.oscom.paytype')
1956 for website in self.browse(cr, uid, ids):
1957- server = xmlrpclib.ServerProxy("%s/openerp-synchro.php" % website.url)
1958+ server = xmlrpclib.ServerProxy("%s/openerp-synchro.php?admin_user=%s&admin_pass=%s" % (website.url,website.admin_user,website.admin_pass))
1959 payment_methods = server.get_payment_methods()
1960 for payment_method in payment_methods:
1961 value={
1962@@ -254,7 +177,7 @@
1963 """Imports product categories from OSCommerce"""
1964 esale_category_obj = self.pool.get('esale.oscom.category')
1965 for website in self.browse(cr, uid, ids):
1966- server = xmlrpclib.ServerProxy("%s/openerp-synchro.php" % website.url)
1967+ server = xmlrpclib.ServerProxy("%s/openerp-synchro.php?admin_user=%s&admin_pass=%s" % (website.url,website.admin_user,website.admin_pass))
1968 categories = server.get_categories()
1969 for category in categories:
1970 value = {
1971@@ -277,7 +200,7 @@
1972
1973 created, updated = 0,0
1974 for website in self.browse(cr, uid, ids):
1975- server = xmlrpclib.ServerProxy("%s/openerp-synchro.php" % website.url)
1976+ server = xmlrpclib.ServerProxy("%s/openerp-synchro.php?admin_user=%s&admin_pass=%s" % (website.url,website.admin_user,website.admin_pass))
1977
1978 # Search OScommerce languages mapped to OpenERP
1979 osc_langs = [lang.esale_oscom_id for lang in website.language_ids if lang.language_id and lang.language_id.translatable]
1980@@ -356,6 +279,17 @@
1981 """If you want create additonal information in OpenERP objects related to product you can redefine this method in your own module"""
1982 return True
1983
1984+ def get_products_oscom_url(self, cr, uid, website, prod_id,cat_id):
1985+ website_url = website.url.split("/")
1986+ prod_url = website_url[0] + "//" + website_url[2] + "/"
1987+ for x in range(3,len(website_url)-1):
1988+ prod_url += website_url[x] + "/"
1989+ if(website.plataforma=='zen'):
1990+ prod_url += "index.php?page=product_info&cPath=" + cat_id + "&products_id=" + prod_id
1991+ else:
1992+ prod_url += "product_info.php?cPath=" + cat_id + "&products_id=" + prod_id
1993+ return prod_url
1994+
1995
1996 def product_import_create(self, cr, uid, ids, *args):
1997 """Imports products from OSCommerce and creates/updates OpenERP products"""
1998@@ -367,8 +301,7 @@
1999
2000 created, updated = 0,0
2001 for website in self.browse(cr, uid, ids):
2002- server = xmlrpclib.ServerProxy("%s/openerp-synchro.php" % website.url)
2003- website_url = website.url.split("/")
2004+ server = xmlrpclib.ServerProxy("%s/openerp-synchro.php?admin_user=%s&admin_pass=%s" % (website.url,website.admin_user,website.admin_pass))
2005
2006 # Search esale languages mapped to OpenERP
2007 osc_langs = [lang.esale_oscom_id for lang in website.language_ids if lang.language_id and lang.language_id.translatable]
2008@@ -457,7 +390,7 @@
2009 'spe_price_status': 'status' in spec_prod and str(spec_prod['status']) or False,
2010 'spe_price': 'specials_new_products_price' in spec_prod and spec_prod['specials_new_products_price'] or False,
2011 'exp_date': 'expires_date' in spec_prod and spec_prod['expires_date']!='0000-00-00 00:00:00' and spec_prod['expires_date'] or False,
2012- 'oscom_url': website_url[0] + "//" + website_url[2] + "/" +"product_info.php?cPath=" + str(info_prod['categ_id']) + "&products_id=" + str(info_prod['products_id']),
2013+ 'oscom_url': self.get_products_oscom_url(cr, uid, website, str(info_prod['products_id']),str(info_prod['categ_id'])),
2014 'manufacturer_id': manuf_id or False,
2015 #'ean13': info_prod['products_model'],
2016 #'type': 'Stockable product',
2017@@ -560,6 +493,8 @@
2018 oscom_id = info_prod['products_id']
2019 else:
2020 raise osv.except_osv(_('Product import done'),_('New or updated products are not found'))
2021+ #website.date_download_from = lambda *a:time.strftime('%Y-%m-%d')
2022+ #website.write(cr, uid, website.id, {'date_download_from':time.strftime('%Y-%m-%d')})
2023 raise osv.except_osv(_('Product import done'), _('Created: %d products\nUpdated: %d products\n\nRefresh screen to see updates') % (created, updated))
2024 return True
2025
2026@@ -632,241 +567,328 @@
2027 website = self.pool.get('esale.oscom.web').browse(cr, uid, website_id)
2028 osc_int = esale_status_obj.read(cr, uid, website.intermediate.id, ['esale_oscom_id'])
2029 intermediate = osc_int['esale_oscom_id']
2030- #print "intermediate before import", intermediate
2031-
2032- server = xmlrpclib.ServerProxy("%s/openerp-synchro.php" % website.url)
2033- cr.execute("select max(esale_oscom_id) from sale_order where esale_oscom_web=%s;" % str(website.id))
2034- max_web_id = cr.fetchone()[0]
2035-
2036- min_openorder=-1
2037- if max_web_id:
2038- saleorders = server.get_saleorders(max_web_id, statuses_ids)
2039- min_openorder = server.get_min_open_orders(max_web_id)
2040- else:
2041- saleorders = server.get_saleorders(0, statuses_ids)
2042+
2043+ server = xmlrpclib.ServerProxy("%s/openerp-synchro.php?admin_user=%s&admin_pass=%s" % (website.url,website.admin_user,website.admin_pass))
2044+ exists_more_packages = True
2045 no_of_so = 0
2046- for saleorder in saleorders:
2047+ while exists_more_packages:
2048+ cr.execute("select max(esale_oscom_id) from sale_order where esale_oscom_web=%s;" % str(website.id))
2049+ max_web_id = cr.fetchone()[0]
2050+
2051+ min_openorder=-1
2052+ if max_web_id:
2053+ saleorders = server.get_saleorders(max_web_id, statuses_ids,website.download_number)
2054+ min_openorder = server.get_min_open_orders(max_web_id)
2055+ else:
2056+ saleorders = server.get_saleorders(0, statuses_ids,website.download_number)
2057+ if len(saleorders) != website.download_number:
2058+ exists_more_packages = False
2059+ for saleorder in saleorders:
2060 #print "==========*********NEW**************==========="
2061 #print "== Oscommerce Sale Order Number :", saleorder['id']
2062 #print "PEDIDO VENTA: " , saleorder
2063- if len(saleorder['partner']) > 0 :
2064- oscom_partner = saleorder['partner'][0]
2065- #print "== Sale order partner:", saleorder['partner'][0]
2066- partner_ids = partner_obj.search(cr, uid, [('esale_oscom_id','=',oscom_partner['esale_oscom_id'])])
2067- if len(partner_ids):
2068- partner_id = partner_ids[0]
2069- #print "partner: ", partner_ids
2070- partner_obj.write(cr, uid, partner_ids, {'name':oscom_partner['name']})
2071- else:
2072- del oscom_partner['addresses']
2073- partner_id = partner_obj.create(cr, uid, oscom_partner)
2074- partner_obj.write(cr, uid, partner_ids, {'ref':oscom_partner['esale_oscom_id']})
2075-
2076- self.customer_extra_info(cr, uid, website, partner_id, oscom_partner['esale_oscom_id']) # Creates additonal information in OpenERP objects related to customer
2077-
2078- # Default address is right on Website so we create the order.
2079- if len(saleorder['address']) > 0 :
2080- #print ""
2081- #print "===Sale order default address:",saleorder['address'][0]
2082- default_address = saleorder['address'][0]
2083- del saleorder['address']
2084- default_address['type'] = 'default'
2085- default_address_id = _add_address(self, cr, uid, default_address.copy(), partner_id, context)
2086- shipping_address = []
2087- if len(saleorder['delivery']) > 0 :
2088- #print ""
2089- #print "===Sale order Delivery:",saleorder['delivery'][0]
2090- shipping_address = saleorder['delivery'][0]
2091- del saleorder['delivery']
2092- shipping_address['type'] = 'delivery'
2093- shipping_address_id = _add_address(self, cr, uid, shipping_address.copy(), partner_id, context)
2094- billing_address = []
2095- if len(saleorder['billing']) > 0 :
2096- #print ""
2097- #print "===Sale order Billing:",saleorder['billing'][0]
2098- billing_address = saleorder['billing'][0]
2099- del saleorder['billing']
2100- billing_address['type'] = 'invoice'
2101- billing_address_id = _add_address(self, cr, uid, billing_address.copy(),partner_id, context)
2102-
2103- value={ 'esale_oscom_web': website.id,
2104- 'esale_oscom_id' : saleorder['id'],
2105- 'shop_id' : website.shop_id.id,
2106- 'partner_id' : partner_id,
2107- 'note' : saleorder['note'],
2108- 'pay_met_title' : saleorder['pay_met_title'],
2109- 'shipping_title' : saleorder['shipping_title'],
2110- 'orders_status' : saleorder['orders_status'],
2111- 'date_order' : saleorder['date'],
2112- #'price_type' : saleorder['price_type']
2113- }
2114-
2115- value.update(saleorder_obj.onchange_shop_id(cr, uid, [], value['shop_id'])['value'])
2116- value.update(saleorder_obj.onchange_partner_id(cr, uid, [], value['partner_id'])['value'])
2117- # address_obj = self.pool.get('res.partner.address')
2118- # for address in [('address','order'), ('billing', 'invoice'), ('delivery', 'shipping')]:
2119- # criteria = [('partner_id', '=', website.partner_anonymous_id.id)]
2120- # insert = {'partner_id': website.partner_anonymous_id.id}
2121- # for criterium in [('city', 'city'), ('name', 'name'), ('zip','zip'), ('address', 'street') ]:
2122- # criteria.append((criterium[1], 'like', saleorder[address[0]][criterium[0]]))
2123- # insert[criterium[1]] = saleorder[address[0]][criterium[0]]
2124- # address_ids = address_obj.search(cr, uid, criteria)
2125- # if len(address_ids):
2126- # id = address_ids[0]
2127- # else:
2128- # country_ids = self.pool.get('res.country').search(cr, uid, [('name', 'ilike', saleorder[address[0]]['country'])])
2129- # if len(country_ids):
2130- # country_id = country_ids[0]
2131- # else:
2132- # country_id = self.pool.get('res.country').create(cr, uid, { 'name' : saleorder[address[0]]['country'],
2133- # 'code' : saleorder[address[0]]['country'][0:2].lower()})
2134- # insert['country_id'] = country_id
2135- # if address[0] == 'address':
2136- # insert['email'] = saleorder['address']['email']
2137- # id = address_obj.create(cr, uid, insert)
2138- #
2139- # value.update({'partner_%s_id' % address[1]: id})
2140- value['partner_order_id'] = default_address_id
2141- if len(shipping_address) > 0 :
2142- value['partner_shipping_id'] = shipping_address_id
2143- else:
2144- value['partner_shipping_id'] = default_address_id
2145-
2146- if len(billing_address) > 0 :
2147- value['partner_invoice_id'] = billing_address_id
2148- else:
2149- value['partner_invoice_id'] = default_address_id
2150- order_id = saleorder_obj.create(cr, uid, value)
2151- order_id_obj = saleorder_obj.browse(cr, uid, order_id)
2152- concat_cod = self.sale_order_code(order_id_obj)
2153- saleorder_obj.write(cr, uid, order_id, {'name':concat_cod})
2154-
2155- for orderline in saleorder['lines']:
2156- ids = esale_product_obj.search(cr, uid, [('esale_oscom_id', '=', orderline['product_id']), ('web_id', '=', website.id)])
2157- if len(ids):
2158- oscom_product_id = ids[0]
2159- oscom_product = esale_product_obj.browse(cr, uid, oscom_product_id)
2160- product_id = oscom_product.product_id.id
2161- #print "producto oscommerce encontrado:", product_id
2162- else:
2163- product_id = product_obj.search(cr, uid, [('name','=','Shipping Cost')])[0]
2164- # if product comes with attributes, we will try to find the exact product variant
2165- #print "tratando linea" , orderline
2166- attributes = (orderline.has_key('attributes') and orderline['attributes']) or False
2167- if attributes:
2168- #print orderline['attributes']
2169- #print "codigo producto", attributes['composed_code']
2170- ids = product_obj.search(cr, uid, [('default_code', '=', attributes['composed_code']),('variants', '=', attributes['products_options_values'])])
2171+ if len(saleorder['partner']) > 0 :
2172+ oscom_partner = saleorder['partner'][0]
2173+ #print "== Sale order partner:", saleorder['partner'][0]
2174+ partner_ids = partner_obj.search(cr, uid, [('esale_oscom_id','=',oscom_partner['esale_oscom_id'])])
2175+ if len(partner_ids):
2176+ partner_id = partner_ids[0]
2177+ #print "partner: ", partner_ids
2178+ partner_obj.write(cr, uid, partner_ids, {'name':oscom_partner['name']})
2179+ else:
2180+ del oscom_partner['addresses']
2181+ partner_id = partner_obj.create(cr, uid, oscom_partner)
2182+ partner_obj.write(cr, uid, partner_ids, {'ref':oscom_partner['esale_oscom_id']})
2183+ cr.execute("INSERT INTO res_partner_category_rel(partner_id, category_id) VALUES (%d,%d);" % (partner_id,(website.default_partner_category)['id']))
2184+
2185+ self.customer_extra_info(cr, uid, website, partner_id, oscom_partner['esale_oscom_id']) # Creates additonal information in OpenERP objects related to customer
2186+
2187+ # Default address is right on Website so we create the order.
2188+ if len(saleorder['address']) > 0 :
2189+ #print ""
2190+ #print "===Sale order default address:",saleorder['address'][0]
2191+ default_address = saleorder['address'][0]
2192+ del saleorder['address']
2193+ default_address['type'] = 'default'
2194+ default_address_id = _add_address(self, cr, uid, default_address.copy(), partner_id, context)
2195+ shipping_address = []
2196+ if len(saleorder['delivery']) > 0 :
2197+ #print ""
2198+ #print "===Sale order Delivery:",saleorder['delivery'][0]
2199+ shipping_address = saleorder['delivery'][0]
2200+ del saleorder['delivery']
2201+ shipping_address['type'] = 'delivery'
2202+ shipping_address_id = _add_address(self, cr, uid, shipping_address.copy(), partner_id, context)
2203+ billing_address = []
2204+ if len(saleorder['billing']) > 0 :
2205+ #print ""
2206+ #print "===Sale order Billing:",saleorder['billing'][0]
2207+ billing_address = saleorder['billing'][0]
2208+ del saleorder['billing']
2209+ billing_address['type'] = 'invoice'
2210+ billing_address_id = _add_address(self, cr, uid, billing_address.copy(),partner_id, context)
2211+
2212+ value={ 'esale_oscom_web': website.id,
2213+ 'esale_oscom_id' : saleorder['id'],
2214+ 'shop_id' : website.shop_id.id,
2215+ 'partner_id' : partner_id,
2216+ 'note' : saleorder['note'],
2217+ 'pay_met_title' : saleorder['pay_met_title'],
2218+ 'shipping_title' : saleorder['shipping_title'],
2219+ 'orders_status' : saleorder['orders_status'],
2220+ 'date_order' : saleorder['date'],
2221+ #'price_type' : saleorder['price_type']
2222+ }
2223+
2224+ value.update(saleorder_obj.onchange_shop_id(cr, uid, [], value['shop_id'])['value'])
2225+ value.update(saleorder_obj.onchange_partner_id(cr, uid, [], value['partner_id'])['value'])
2226+ # address_obj = self.pool.get('res.partner.address')
2227+ # for address in [('address','order'), ('billing', 'invoice'), ('delivery', 'shipping')]:
2228+ # criteria = [('partner_id', '=', website.partner_anonymous_id.id)]
2229+ # insert = {'partner_id': website.partner_anonymous_id.id}
2230+ # for criterium in [('city', 'city'), ('name', 'name'), ('zip','zip'), ('address', 'street') ]:
2231+ # criteria.append((criterium[1], 'like', saleorder[address[0]][criterium[0]]))
2232+ # insert[criterium[1]] = saleorder[address[0]][criterium[0]]
2233+ # address_ids = address_obj.search(cr, uid, criteria)
2234+ # if len(address_ids):
2235+ # id = address_ids[0]
2236+ # else:
2237+ # country_ids = self.pool.get('res.country').search(cr, uid, [('name', 'ilike', saleorder[address[0]]['country'])])
2238+ # if len(country_ids):
2239+ # country_id = country_ids[0]
2240+ # else:
2241+ # country_id = self.pool.get('res.country').create(cr, uid, { 'name' : saleorder[address[0]]['country'],
2242+ # 'code' : saleorder[address[0]]['country'][0:2].lower()})
2243+ # insert['country_id'] = country_id
2244+ # if address[0] == 'address':
2245+ # insert['email'] = saleorder['address']['email']
2246+ # id = address_obj.create(cr, uid, insert)
2247+ #
2248+ # value.update({'partner_%s_id' % address[1]: id})
2249+ value['partner_order_id'] = default_address_id
2250+ if len(shipping_address) > 0 :
2251+ value['partner_shipping_id'] = shipping_address_id
2252+ else:
2253+ value['partner_shipping_id'] = default_address_id
2254+
2255+ if len(billing_address) > 0 :
2256+ value['partner_invoice_id'] = billing_address_id
2257+ else:
2258+ value['partner_invoice_id'] = default_address_id
2259+ order_id = saleorder_obj.create(cr, uid, value)
2260+ order_id_obj = saleorder_obj.browse(cr, uid, order_id)
2261+ concat_cod = self.sale_order_code(order_id_obj)
2262+ saleorder_obj.write(cr, uid, order_id, {'name':concat_cod})
2263+
2264+ for orderline in saleorder['lines']:
2265+ ids = esale_product_obj.search(cr, uid, [('esale_oscom_id', '=', orderline['product_id']), ('web_id', '=', website.id)])
2266 if len(ids):
2267- #print "producto con atributos encontrado:", ids
2268- product_id = ids[0]
2269-
2270- linevalue = {
2271- 'product_id' : product_id,
2272- 'product_uom_qty': orderline['product_qty'],
2273- 'order_id' : order_id,
2274- }
2275- onchange_product_sol = saleorder_line_obj.product_id_change(cr, uid, [], value['pricelist_id'], linevalue['product_id'], linevalue['product_uom_qty'],False, 0, False, '', value['partner_id'])['value']
2276- onchange_product_sol['tax_id'] = False
2277- if orderline['tax_rate'] > 0.0000:
2278- tax_rate_search_ids = tax_obj.search(cr, uid, [('tax_group','=','vat'),('amount','=',orderline['tax_rate']/100), ('type_tax_use', '=','sale')])
2279- else:
2280- tax_rate_search_ids = tax_obj.search(cr, uid, [('tax_group','=','vat'),('amount','=',0), ('type_tax_use', '=','sale')])
2281- if tax_rate_search_ids:
2282- onchange_product_sol['tax_id'] = tax_rate_search_ids
2283- price = orderline['price']
2284- name = orderline['name']
2285- if saleorder['price_type'] == 'tax_excluded' and attributes:
2286- # print "EVALUANDO PRECIOS ATRIBUTOS: ", str(price)
2287- # print "prefix: ", attributes['price_prefix']
2288- # print "EVALUANDO PRECIOS ATRIBUTOS2: ", str(attributes['options_values_price'])
2289- price = eval(str(price) + attributes['price_prefix'] + str(attributes['options_values_price']))
2290- name = name + ' ' + attributes['products_options'] + ' + ' + attributes['products_options_values']
2291- elif saleorder['price_type'] == 'tax_included':
2292- price = price * (1+orderline['tax_rate']/100)
2293+ oscom_product_id = ids[0]
2294+ oscom_product = esale_product_obj.browse(cr, uid, oscom_product_id)
2295+ product_id = oscom_product.product_id.id
2296+ #print "producto oscommerce encontrado:", product_id
2297+ else:
2298+ #raise osv.except_osv(_('Ordered product not found in OpenErp'), _('Default product named \'Shipping Cost\' will be used.\nIn case it doesn\'t exist, please create it'))
2299+ product_id = product_obj.search(cr, uid, [('name','=','Shipping Cost')])[0]
2300+ # if product comes with attributes, we will try to find the exact product variant
2301+ #print "tratando linea" , orderline
2302+ attributes = (orderline.has_key('attributes') and orderline['attributes']) or False
2303 if attributes:
2304- options_value_price = attributes['options_values_price']
2305- cal_options_value_price = options_value_price * (1+orderline['tax_rate']/100)
2306- price = eval(str(price) + attributes['price_prefix'] + str(cal_options_value_price))
2307+ #print orderline['attributes']
2308+ #print "codigo producto", attributes['composed_code']
2309+ ids = product_obj.search(cr, uid, [('default_code', '=', attributes['composed_code']),('variants', '=', attributes['products_options_values'])])
2310+ if len(ids):
2311+ #print "producto con atributos encontrado:", ids
2312+ product_id = ids[0]
2313+
2314+ linevalue = {
2315+ 'product_id' : product_id,
2316+ 'product_uom_qty': orderline['product_qty'],
2317+ 'order_id' : order_id,
2318+ }
2319+ onchange_product_sol = saleorder_line_obj.product_id_change(cr, uid, [], value['pricelist_id'], linevalue['product_id'], linevalue['product_uom_qty'],False, 0, False, '', value['partner_id'])['value']
2320+ onchange_product_sol['tax_id'] = False
2321+ if orderline['tax_rate'] > 0.0000:
2322+ tax_rate_search_ids = tax_obj.search(cr, uid, [('tax_group','=','vat'),('amount','=',orderline['tax_rate']/100), ('type_tax_use', '=','sale')])
2323+ else:
2324+ tax_rate_search_ids = tax_obj.search(cr, uid, [('tax_group','=','vat'),('amount','=',0), ('type_tax_use', '=','sale')])
2325+ if tax_rate_search_ids:
2326+ onchange_product_sol['tax_id'] = tax_rate_search_ids
2327+ price = orderline['price']
2328+ name = orderline['name']
2329+ if saleorder['price_type'] == 'tax_excluded' and attributes:
2330+ # print "EVALUANDO PRECIOS ATRIBUTOS: ", str(price)
2331+ # print "prefix: ", attributes['price_prefix']
2332+ # print "EVALUANDO PRECIOS ATRIBUTOS2: ", str(attributes['options_values_price'])
2333+ price = eval(str(price) + attributes['price_prefix'] + str(attributes['options_values_price']))
2334 name = name + ' ' + attributes['products_options'] + ' + ' + attributes['products_options_values']
2335- onchange_product_sol['price_unit'] = round(price,2)
2336- linevalue.update(onchange_product_sol)
2337- linevalue.update(saleorder_line_obj.default_get(cr, uid, ['sequence', 'invoiced', 'state', 'product_packaging']))
2338- linevalue['name'] = name
2339- if linevalue.get('weight',False):
2340- del linevalue['weight']
2341- linevalue["product_uos"] = linevalue['product_uos'] and linevalue['product_uos'][0]
2342- tax_id = linevalue['tax_id'] and linevalue['tax_id'][0]
2343- del linevalue['tax_id']
2344- ptax_id = [tax_id]
2345- id_orderline = saleorder_line_obj.create(cr, uid, linevalue)
2346- saleorder_line_obj.write(cr, uid, [id_orderline], {'tax_id':[(6, 0, ptax_id)]})
2347- no_of_so +=1
2348-
2349- ######################################################################################
2350- oscom_pay_met = saleorder['pay_met']
2351- typ_ids = esale_paytype_obj.search(cr, uid, [('esale_oscom_id', '=', oscom_pay_met), ('web_id', '=', website.id)])
2352- saleorder = saleorder_obj.browse(cr, uid, order_id)
2353- if typ_ids:
2354- typ_data = esale_paytype_obj.browse(cr, uid, typ_ids)[0]
2355- paytype = typ_data.paytyp
2356- cr.execute('select * from ir_module_module where name=%s and state=%s', ('sale_payment','installed'))
2357- if cr.fetchone():
2358- saleorder_obj.write(cr, uid, [order_id], {'payment_type': typ_data.payment_id.id})
2359- else:
2360- paytype = 'type1'
2361- wf_service = netsvc.LocalService("workflow")
2362- if paytype == 'type1':
2363- #SO in state draft so nothing
2364- pass
2365- elif paytype == 'type2':
2366- #SO in state confirmed
2367- wf_service.trg_validate(uid, 'sale.order', order_id, 'order_confirm', cr)
2368- elif paytype == 'type3':
2369- #INVOICE draft
2370- wf_service.trg_validate(uid, 'sale.order', order_id, 'order_confirm', cr)
2371- wf_service.trg_validate(uid, 'sale.order', order_id, 'manual_invoice', cr)
2372- elif paytype == 'type4':
2373- wf_service.trg_validate(uid, 'sale.order', order_id, 'order_confirm', cr)
2374- wf_service.trg_validate(uid, 'sale.order', order_id, 'manual_invoice', cr)
2375- inv_ids = inv_obj.search(cr, uid, [('origin','=',saleorder.name)])
2376- inv_obj.button_compute(cr, uid, inv_ids)
2377- wf_service.trg_validate(uid, 'account.invoice',inv_ids[0], 'invoice_open', cr)
2378- elif paytype == 'type5':
2379- #INVOICE payed
2380- wf_service.trg_validate(uid, 'sale.order', order_id, 'order_confirm', cr)
2381- wf_service.trg_validate(uid, 'sale.order', order_id, 'manual_invoice', cr)
2382- pay_account_id = (website.esale_account_id)['id']
2383- pay_journal_id = typ_data.journal_id.id
2384- inv_ids = inv_obj.search(cr, uid, [('origin','=',saleorder.name)])
2385- inv_obj.button_compute(cr, uid, inv_ids)
2386- wf_service.trg_validate(uid, 'account.invoice',inv_ids[0], 'invoice_open', cr)
2387- ids = self.pool.get('account.period').find(cr, uid, context=context)
2388- period_id = False
2389- if len(ids):
2390- period_id = ids[0]
2391-
2392- invoice = inv_obj.browse(cr, uid,inv_ids[0],{})
2393- company_currency = self.pool.get('res.users').browse(cr, uid, uid).company_id.currency_id.id
2394- if invoice.currency_id.id != company_currency:
2395- amount = round(self.pool.get('res.currency').compute(cr, uid, invoice.currency_id.id, company_currency, invoice.amount_total), 2)
2396- else:
2397- amount = invoice.amount_total
2398-
2399- inv_obj.pay_and_reconcile(cr, uid, inv_ids, amount, pay_account_id, period_id, pay_journal_id, False, False, False, context={})
2400- else:
2401- #The payment method hasn't been mapped
2402- pass
2403- cr.commit()
2404- for saleorder in saleorders:
2405- #print "website.intermediate: " , intermediate
2406- server.update_order_status(saleorder['id'], intermediate, '',0,0)
2407+ elif saleorder['price_type'] == 'tax_included':
2408+ price = price * (1+orderline['tax_rate']/100)
2409+ if attributes:
2410+ options_value_price = attributes['options_values_price']
2411+ cal_options_value_price = options_value_price * (1+orderline['tax_rate']/100)
2412+ price = eval(str(price) + attributes['price_prefix'] + str(cal_options_value_price))
2413+ name = name + ' ' + attributes['products_options'] + ' + ' + attributes['products_options_values']
2414+ onchange_product_sol['price_unit'] = round(price,2)
2415+ linevalue.update(onchange_product_sol)
2416+ linevalue.update(saleorder_line_obj.default_get(cr, uid, ['sequence', 'invoiced', 'state', 'product_packaging']))
2417+ linevalue['name'] = name
2418+ if linevalue.get('weight',False):
2419+ del linevalue['weight']
2420+ linevalue["product_uos"] = linevalue['product_uos'] and linevalue['product_uos'][0]
2421+ tax_id = linevalue['tax_id'] and linevalue['tax_id'][0]
2422+ del linevalue['tax_id']
2423+ if tax_id:
2424+ ptax_id = [tax_id]
2425+ id_orderline = saleorder_line_obj.create(cr, uid, linevalue)
2426+ saleorder_line_obj.write(cr, uid, [id_orderline], {'tax_id':[(6, 0, ptax_id)]})
2427+ no_of_so +=1
2428+
2429+ ######################################################################################
2430+ oscom_pay_met = saleorder['pay_met']
2431+ typ_ids = esale_paytype_obj.search(cr, uid, [('esale_oscom_id', '=', oscom_pay_met), ('web_id', '=', website.id)])
2432+ saleorder = saleorder_obj.browse(cr, uid, order_id)
2433+ if typ_ids:
2434+ typ_data = esale_paytype_obj.browse(cr, uid, typ_ids)[0]
2435+ paytype = typ_data.paytyp
2436+ cr.execute('select * from ir_module_module where name=%s and state=%s', ('sale_payment','installed'))
2437+ if cr.fetchone():
2438+ saleorder_obj.write(cr, uid, [order_id], {'payment_type': typ_data.payment_id.id})
2439+ else:
2440+ paytype = 'type1'
2441+ wf_service = netsvc.LocalService("workflow")
2442+ if paytype == 'type1':
2443+ #SO in state draft so nothing
2444+ pass
2445+ elif paytype == 'type2':
2446+ #SO in state confirmed
2447+ wf_service.trg_validate(uid, 'sale.order', order_id, 'order_confirm', cr)
2448+ elif paytype == 'type3':
2449+ #INVOICE draft
2450+ wf_service.trg_validate(uid, 'sale.order', order_id, 'order_confirm', cr)
2451+ wf_service.trg_validate(uid, 'sale.order', order_id, 'manual_invoice', cr)
2452+ elif paytype == 'type4':
2453+ wf_service.trg_validate(uid, 'sale.order', order_id, 'order_confirm', cr)
2454+ wf_service.trg_validate(uid, 'sale.order', order_id, 'manual_invoice', cr)
2455+ inv_ids = inv_obj.search(cr, uid, [('origin','=',saleorder.name)])
2456+ inv_obj.button_compute(cr, uid, inv_ids)
2457+ wf_service.trg_validate(uid, 'account.invoice',inv_ids[0], 'invoice_open', cr)
2458+ elif paytype == 'type5':
2459+ #INVOICE payed
2460+ wf_service.trg_validate(uid, 'sale.order', order_id, 'order_confirm', cr)
2461+ wf_service.trg_validate(uid, 'sale.order', order_id, 'manual_invoice', cr)
2462+ pay_account_id = (website.esale_account_id)['id']
2463+ pay_journal_id = typ_data.journal_id.id
2464+ inv_ids = inv_obj.search(cr, uid, [('origin','=',saleorder.name)])
2465+ inv_obj.button_compute(cr, uid, inv_ids)
2466+ wf_service.trg_validate(uid, 'account.invoice',inv_ids[0], 'invoice_open', cr)
2467+ ids = self.pool.get('account.period').find(cr, uid, context=context)
2468+ period_id = False
2469+ if len(ids):
2470+ period_id = ids[0]
2471+
2472+ invoice = inv_obj.browse(cr, uid,inv_ids[0],{})
2473+ company_currency = self.pool.get('res.users').browse(cr, uid, uid).company_id.currency_id.id
2474+ if invoice.currency_id.id != company_currency:
2475+ amount = round(self.pool.get('res.currency').compute(cr, uid, invoice.currency_id.id, company_currency, invoice.amount_total), 2)
2476+ else:
2477+ amount = invoice.amount_total
2478+
2479+ inv_obj.pay_and_reconcile(cr, uid, inv_ids, amount, pay_account_id, period_id, pay_journal_id, False, False, False, context={})
2480+ else:
2481+ #The payment method hasn't been mapped
2482+ pass
2483+ cr.commit()
2484+ for saleorder in saleorders:
2485+ #print "website.intermediate: " , intermediate
2486+ server.update_order_status(saleorder['id'], intermediate, '',0,0)
2487+
2488
2489 ###################### look for open orders in site that are 'done' in TinyERP ###################
2490 ###################### and close them ###################
2491 return no_of_so
2492 esale_oscom_web()
2493
2494+class esale_oscom_tax(osv.osv):
2495+ _name = "esale.oscom.tax"
2496+ _description = "esale_oscom Tax"
2497+ _columns = {
2498+ 'name': fields.char('Tax name', size=32, required=True, readonly=True),
2499+ 'esale_oscom_id': fields.integer('OScommerce Id'),
2500+ 'web_id': fields.many2one('esale.oscom.web', 'Website'),
2501+ 'tax_id': fields.many2one('account.tax', 'OpenERP tax'),
2502+ }
2503+esale_oscom_tax()
2504+
2505+class esale_oscom_category(osv.osv):
2506+ _name = "esale.oscom.category"
2507+ _description = "esale_oscom Category"
2508+ _columns = {
2509+ 'name': fields.char('Name', size=64, required=True, readonly=True),
2510+ 'esale_oscom_id': fields.integer('OScommerce Id', required=True),
2511+ 'web_id': fields.many2one('esale.oscom.web', 'Website'),
2512+ 'category_id': fields.many2one('product.category', 'OpenERP category'),
2513+ }
2514+esale_oscom_category()
2515+
2516+class esale_oscom_paytype(osv.osv):
2517+ _name = "esale.oscom.paytype"
2518+ _description = "esale_oscom PayType"
2519+ _columns = {
2520+ 'name': fields.char('Name', size=64, required=True, readonly=True),
2521+ 'esale_oscom_id': fields.integer('OScommerce Id', required=True),
2522+ 'web_id': fields.many2one('esale.oscom.web', 'Website'),
2523+ 'payment_id': fields.many2one('payment.type', 'OpenERP payment'),
2524+ 'paytyp': fields.selection([('type1','SO in State Draft'),('type2','SO Confirmed'),('type3','Invoice Draft'),('type4','Invoice Confirmed'),('type5','Invoice Payed')], 'Payment type'),
2525+ 'journal_id': fields.many2one('account.journal', 'OpenERP payment journal'),
2526+ }
2527+esale_oscom_paytype()
2528+
2529+
2530+class esale_oscom_language(osv.osv):
2531+ _name = "esale.oscom.lang"
2532+ _description = "esale_oscom Language"
2533+ _columns = {
2534+ 'name': fields.char('Name', size=32, required=True, readonly=True),
2535+ 'esale_oscom_id': fields.integer('OScommerce Id', required=True),
2536+ 'web_id': fields.many2one('esale.oscom.web', 'Website'),
2537+ 'language_id': fields.many2one('res.lang', 'OpenERP language'),
2538+ }
2539+esale_oscom_language()
2540+
2541+
2542+class esale_oscom_product(osv.osv):
2543+ _name = "esale.oscom.product"
2544+ _description = "esale_oscom Product"
2545+ _columns = {
2546+ 'name': fields.char('Name', size=64, required=True, readonly=True),
2547+ 'esale_oscom_id': fields.integer('OScommerce product Id'),
2548+ 'web_id': fields.many2one('esale.oscom.web', 'Website'),
2549+ 'product_id': fields.many2one('product.product', 'OpenERP product'),
2550+ }
2551+
2552+ def onchange_product_id(self, cr, uid, ids, product_id, web_id):
2553+ value = {}
2554+ if (product_id):
2555+ product = self.pool.get('product.product').browse(cr, uid, product_id)
2556+ value['name'] = product.name
2557+ return {'value': value}
2558+
2559+ def unlink(self, cr, uid, ids, context=None):
2560+ websites = {}
2561+ for esale_product in self.browse(cr, uid, ids):
2562+ web_product_ids = websites.get(esale_product.web_id and esale_product.web_id.id)
2563+ if web_product_ids and len(web_product_ids):
2564+ web_product_ids.append(esale_product.esale_oscom_id)
2565+ else:
2566+ websites[esale_product.web_id and esale_product.web_id.id] = [esale_product.esale_oscom_id]
2567+ websites_objs = self.pool.get('esale.oscom.web').browse(cr, uid, [x for x in websites.keys() if type(x) is int])
2568+ for website in websites_objs:
2569+ server = xmlrpclib.ServerProxy("%s/openerp-synchro.php?admin_user=%s&admin_pass=%s" % (website.url,website.admin_user,website.admin_pass))
2570+ server.remove_product({'oscom_product_ids':websites.get(website.id)})
2571+ return super(esale_oscom_product,self).unlink(cr, uid, ids, context)
2572+esale_oscom_product()
2573+
2574
2575 class esale_oscom_saleorder_line(osv.osv):
2576 def _amount_line_net(self, cr, uid, ids, field_name, arg, context):
2577@@ -925,7 +947,7 @@
2578 value={}
2579 if esale_oscom_web:
2580 website = self.pool.get('esale.oscom.web').browse(cr, uid, esale_oscom_web)
2581- server = xmlrpclib.ServerProxy("%s/openerp-synchro.php" % website.url)
2582+ server = xmlrpclib.ServerProxy("%s/openerp-synchro.php?admin_user=%s&admin_pass=%s" % (website.url,website.admin_user,website.admin_pass))
2583 esale_status_obj = self.pool.get('esale.oscom.status')
2584 osc_int = esale_status_obj.read(cr, uid, orders_status_id, ['esale_oscom_id'])
2585 ostatus_id = osc_int['esale_oscom_id']
2586@@ -1022,4 +1044,4 @@
2587 _columns = {
2588 'esale_oscom_id': fields.integer('OScommerce Id'),
2589 }
2590-esale_oscom_partner_address()
2591+esale_oscom_partner_address()
2592\ No newline at end of file
2593
2594=== modified file 'esale_osc/esale_oscom_product.py'
2595--- esale_osc/esale_oscom_product.py 2010-02-02 20:22:20 +0000
2596+++ esale_osc/esale_oscom_product.py 2010-07-21 10:31:39 +0000
2597@@ -1,3 +1,4 @@
2598+# -*- coding: utf-8 -*-
2599 # -*- encoding: utf-8 -*-
2600 ##############################################################################
2601 #
2602@@ -18,9 +19,9 @@
2603 #
2604 # You should have received a copy of the GNU General Public License
2605 # along with this program. If not, see <http://www.gnu.org/licenses/>.
2606-#
2607-##############################################################################
2608-
2609+#
2610+##############################################################################
2611+
2612 from osv import fields,osv,orm
2613 import xmlrpclib
2614 from tools.translate import _
2615@@ -203,8 +204,10 @@
2616 websites_objs = esale_web_obj.browse(cr, uid, websites.keys())
2617 #print websites_objs
2618 for website in websites_objs:
2619+ if not website.override_products_data:
2620+ continue
2621 # print "%s/openerp-synchro.php" % website.url
2622- server = xmlrpclib.ServerProxy("%s/openerp-synchro.php" % website.url)
2623+ server = xmlrpclib.ServerProxy("%s/openerp-synchro.php?admin_user=%s&admin_pass=%s" % (website.url,website.admin_user,website.admin_pass))
2624 website_url = website.url.split("/")
2625
2626 # Pricelist of the web shop
2627@@ -351,7 +354,7 @@
2628 esale_prod_ids = esale_product_obj.search(cr, uid, [('esale_oscom_id','=',oscom_id)])
2629 esale_prod = esale_product_obj.browse(cr, uid, esale_prod_ids[0])
2630 #print "ESALE PROD DATA (id, web, product, category):",esale_prod.id, esale_prod.web_id.id, esale_prod.product_id.id, esale_prod.product_id.categ_id.id
2631- prod_url = website_url[0] + "//" + website_url[2] + "/" +"product_info.php?cPath=" + str(category_id) + "&products_id=" + str(oscom_id)
2632+ prod_url = website.get_products_oscom_url(cr, uid, website, str(oscom_id),str(category_id)),
2633 super(esale_oscom_product_inherit, self).write(cr, uid, esale_prod.product_id.id, {'oscom_url': prod_url})
2634
2635 # Remove delete products
2636@@ -382,7 +385,7 @@
2637 else:
2638 websites_objs.append(website)
2639 for website in websites_objs:
2640- server = xmlrpclib.ServerProxy("%s/openerp-synchro.php" % website.url)
2641+ server = xmlrpclib.ServerProxy("%s/openerp-synchro.php?admin_user=%s&admin_pass=%s" % (website.url,website.admin_user,website.admin_pass))
2642 if not product_ids:
2643 esale_products = website.product_ids
2644 else:
2645@@ -394,7 +397,10 @@
2646 'quantity': product_obj._product_available(cr, uid, [esale_product.product_id.id], ['virtual_available'], False, {'shop':website.shop_id.id})[esale_product.product_id.id]['virtual_available']
2647 }
2648 oscom_id = server.set_product_stock(webproduct)
2649-
2650+ if(int(webproduct['quantity'])>0):
2651+ product_obj.write(cr, uid, [esale_product.product_id.id], {'in_out_stock':'1'})
2652+ else:
2653+ product_obj.write(cr, uid, [esale_product.product_id.id], {'in_out_stock':'0'})
2654 return {}
2655
2656 ## def on_change_gross_price(self, cr, uid, ids, list_price):
2657
2658=== modified file 'esale_osc/esale_oscom_view.xml'
2659--- esale_osc/esale_oscom_view.xml 2010-02-20 13:12:01 +0000
2660+++ esale_osc/esale_oscom_view.xml 2010-07-21 10:31:39 +0000
2661@@ -1,385 +1,388 @@
2662 <?xml version="1.0" encoding="utf-8"?>
2663 <openerp>
2664 <data>
2665- <menuitem name="Sales Management/Internet Sales" id="menu_esale_oscom_root"/>
2666-
2667- <record model="ir.ui.view" id="view_esale_oscom_form">
2668- <field name="name">esale.oscom.web.form</field>
2669- <field name="model">esale.oscom.web</field>
2670- <field name="type">form</field>
2671- <field name="arch" type="xml">
2672- <form string="OScommerce Web Shop">
2673- <notebook>
2674- <page string="General Informations">
2675- <separator string="esale_oscom Shop Info" colspan="4"/>
2676- <field name="name" select="1" colspan="4"/>
2677- <field name="url" widget="url" required="1"/>
2678- <field name="active" select="1"/>
2679- <field name="shop_id" select="1" required="1"/>
2680- <!--<field name="partner_anonymous_id" required="1"/>-->
2681- <field name="price_type"/>
2682- <field name="esale_account_id"/>
2683- <newline/>
2684- <label string="Proceed with the mappings before adding products!" colspan="2"/>
2685- <field name="date_download_from"/>
2686- <field name="download_number"/>
2687- <button name="product_import_create" string="Import all products from OSCommerce" colspan="2" type="object"/>
2688- <separator string="Active Products" colspan="4"/>
2689- <field name="product_ids" colspan="4" widget="one2many_list" nolabel="1" readonly="1"/>
2690- </page>
2691- <page string="Taxes Mapping">
2692- <button type="object" string="Import Taxes" name="tax_import"/>
2693- <field colspan="4" name="tax_ids" widget="one2many_list" nolabel="1"/>
2694- </page>
2695- <page string="Languages Mapping">
2696- <button type="object" string="Import Languages" name="lang_import"/>
2697- <field colspan="4" name="language_ids" widget="one2many_list" nolabel="1"/>
2698- </page>
2699- <page string="Categories Mapping">
2700- <button type="object" string="Import Categories" name="category_import"/>
2701- <button type="object" string="Import and create/update Categories" name="category_import_create"/>
2702- <field colspan="4" name="category_ids" widget="one2many_list" nolabel="1"/>
2703- </page>
2704- <page string="Payment types Mapping">
2705- <button type="object" string="Import Payment Methods" name="get_payment_methods"/>
2706- <field colspan="4" name="pay_typ_ids" widget="one2many_list" nolabel="1"/>
2707- </page>
2708- <page string="Oscommerce Status Mapping">
2709- <button type="object" string="Import Oscommerce Status" name="status_import" colspan="4"/>
2710- <separator string="Status" colspan="4"/>
2711- <field name="intermediate"/>
2712- <field colspan="4" name="status_ids" widget="one2many_list" nolabel="1"/>
2713- </page>
2714- </notebook>
2715- </form>
2716- </field>
2717- </record>
2718- <record model="ir.ui.view" id="view_esale_oscom_tree">
2719- <field name="name">esale.oscom.web.form</field>
2720- <field name="model">esale.oscom.web</field>
2721- <field name="type">tree</field>
2722- <field name="arch" type="xml">
2723- <tree string="OScommerce Web Shop">
2724- <field name="name"/>
2725- <field name="url"/>
2726- <field name="active"/>
2727- <field name="shop_id"/>
2728- <field name="price_type"/>
2729- <field name="esale_account_id"/>
2730- </tree>
2731- </field>
2732- </record>
2733- <record model="ir.actions.act_window" id="action_esale_oscom_form">
2734- <field name="type">ir.actions.act_window</field>
2735- <field name="res_model">esale.oscom.web</field>
2736- <field name="view_type">form</field>
2737- <field name="view_id" ref="view_esale_oscom_tree"/>
2738- </record>
2739-
2740- <menuitem name="Sales Management/Internet Sales/Websites" id="menu_action_esale_oscom_web" action="action_esale_oscom_form" groups="group_esale_oscom_user"/>
2741-
2742- <record model="ir.ui.view" id="esale_oscom_language_web_form">
2743- <field name="name">esale.oscom.language.web.form</field>
2744- <field name="model">esale.oscom.lang</field>
2745- <field name="type">form</field>
2746- <field name="arch" type="xml">
2747- <form string="Language">
2748- <separator colspan="4" string="Language mapping"/>
2749- <field colspan="4" name="name" select="1" required="1"/>
2750- <field name="language_id" select="1"/>
2751- <field name="esale_oscom_id" readonly="1" select="1"/>
2752- </form>
2753- </field>
2754- </record>
2755- <record model="ir.ui.view" id="esale_oscom_language_web_tree">
2756- <field name="name">esale.oscom.language.web.tree</field>
2757- <field name="model">esale.oscom.lang</field>
2758- <field name="type">tree</field>
2759- <field name="arch" type="xml">
2760- <tree string="Language">
2761- <field name="name" />
2762- <field name="language_id" />
2763- </tree>
2764- </field>
2765- </record>
2766- <record model="ir.ui.view" id="esale_oscom_tax_web_form">
2767- <field name="name">esale.oscom.tax.web.form</field>
2768- <field name="model">esale.oscom.tax</field>
2769- <field name="type">form</field>
2770- <field name="arch" type="xml">
2771- <form string="Taxes">
2772- <separator colspan="4" string="Taxes mapping"/>
2773- <field colspan="4" name="name" select="1" required="1"/>
2774- <field name="tax_id" select="1"/>
2775- <field name="esale_oscom_id" readonly="1" select="1"/>
2776- </form>
2777- </field>
2778- </record>
2779- <record model="ir.ui.view" id="esale_oscom_tax_web_tree">
2780- <field name="name">esale.oscom.tax.web.tree</field>
2781- <field name="model">esale.oscom.tax</field>
2782- <field name="type">tree</field>
2783- <field name="arch" type="xml">
2784- <tree string="Taxes">
2785- <field name="name" />
2786- <field name="tax_id" />
2787- </tree>
2788- </field>
2789- </record>
2790-
2791-<!-- ####################################################################################### -->
2792- <record model="ir.ui.view" id="esale_oscom_pay_typ_form">
2793- <field name="name">esale.oscom.pay.typ.form</field>
2794- <field name="model">esale.oscom.paytype</field>
2795- <field name="type">form</field>
2796- <field name="arch" type="xml">
2797- <form string="Payment types">
2798- <separator colspan="4" string="Payment types mapping"/>
2799- <field colspan="4" name="name" select="1" required="1"/>
2800- <field name="payment_id" select="1"/>
2801- <field name="esale_oscom_id" readonly="1" select="1"/>
2802- <field name="paytyp" select="1"/>
2803- <field name="journal_id" select="2" attrs="{'required':[('paytyp','=','type5')]}"/>
2804- </form>
2805- </field>
2806- </record>
2807- <record model="ir.ui.view" id="esale_oscom_pay_typ_tree">
2808- <field name="name">esale.oscom.pay.typ.tree</field>
2809- <field name="model">esale.oscom.paytype</field>
2810- <field name="type">tree</field>
2811- <field name="arch" type="xml">
2812- <tree string="Payment types">
2813- <field name="name" />
2814- <field name="payment_id" />
2815- <field name="paytyp" />
2816- <field name="journal_id" />
2817- </tree>
2818- </field>
2819- </record>
2820-<!-- ####################################################################################### -->
2821- <record model="ir.ui.view" id="esale_oscom_status_form">
2822- <field name="name">esale.oscom.status.form</field>
2823- <field name="model">esale.oscom.status</field>
2824- <field name="type">form</field>
2825- <field name="arch" type="xml">
2826- <form string="Osc status">
2827- <separator colspan="4" string="Oscommerce Status mapping"/>
2828- <field colspan="4" name="name" select="1" required="1"/>
2829- <field name="language_id" select="1"/>
2830- <field name="esale_oscom_id" readonly="1" select="1"/>
2831- <field name="download" select="1"/>
2832- </form>
2833- </field>
2834- </record>
2835- <record model="ir.ui.view" id="esale_oscom_status_tree">
2836- <field name="name">esale.oscom.status.tree</field>
2837- <field name="model">esale.oscom.status</field>
2838- <field name="type">tree</field>
2839- <field name="arch" type="xml">
2840- <tree string="Payment types">
2841- <field name="name" />
2842- <field name="language_id" />
2843- <field name="esale_oscom_id" />
2844- <field name="download" />
2845- </tree>
2846- </field>
2847- </record>
2848-
2849-
2850-<!-- ####################################################################################### -->
2851- <record model="ir.ui.view" id="esale_oscom_category_web_form">
2852- <field name="name">esale.oscom.category.web.form</field>
2853- <field name="model">esale.oscom.category</field>
2854- <field name="type">form</field>
2855- <field name="arch" type="xml">
2856- <form string="Categories">
2857- <separator colspan="4" string="taxes"/>
2858- <field name="name" select="1" colspan="4" required="1"/>
2859- <field name="category_id" select="1"/>
2860- <field name="esale_oscom_id" select="1" readonly="1"/>
2861- </form>
2862- </field>
2863- </record>
2864- <record model="ir.ui.view" id="esale_oscom_category_web_tree">
2865- <field name="name">esale.oscom.category.web.v</field>
2866- <field name="model">esale.oscom.category</field>
2867- <field name="type">tree</field>
2868- <field name="arch" type="xml">
2869- <tree string="Categories">
2870- <field name="name" />
2871- <field name="category_id" />
2872- </tree>
2873- </field>
2874- </record>
2875-
2876- <record model="ir.ui.view" id="esale_oscom_product_web_form">
2877- <field name="name">esale.oscom.product.web.form</field>
2878- <field name="model">esale.oscom.product</field>
2879- <field name="type">form</field>
2880- <field name="arch" type="xml">
2881- <form string="Product">
2882- <separator colspan="4" string="Product Information"/>
2883- <field name="name" colspan="4" select="1" required="1"/>
2884- <field name="product_id" on_change="onchange_product_id(product_id, web_id)" select="1" required="1"/>
2885- <field name="esale_oscom_id" readonly="1" select="1"/>
2886- </form>
2887- </field>
2888- </record>
2889+ <menuitem name="Sales Management/Internet Sales" id="menu_esale_oscom_root"/>
2890+
2891+ <record model="ir.ui.view" id="view_esale_oscom_form">
2892+ <field name="name">esale.oscom.web.form</field>
2893+ <field name="model">esale.oscom.web</field>
2894+ <field name="type">form</field>
2895+ <field name="arch" type="xml">
2896+ <form string="OScommerce Web Shop">
2897+ <notebook>
2898+ <page string="General Informations">
2899+ <separator string="esale_oscom Shop Info" colspan="4"/>
2900+ <field name="name" select="1"/>
2901+ <field name="admin_user" required="1"/>
2902+ <field name="url" widget="url" required="1"/>
2903+ <field name="admin_pass" required="1" password="True"/>
2904+ <newline/>
2905+ <field name="active" select="1"/>
2906+ <field name="shop_id" select="1" required="1"/>
2907+ <field name="default_partner_category" required="False"/>
2908+ <field name="price_type"/>
2909+ <field name="esale_account_id"/>
2910+ <newline/>
2911+ <label string="Proceed with the mappings before adding products!" colspan="2"/>
2912+ <field name="date_download_from" required="1"/>
2913+ <field name="download_number"/>
2914+ <field name="override_products_data"/>
2915+ <button name="product_import_create" string="Import all products from OSCommerce" colspan="2" type="object"/>
2916+ <separator string="Active Products" colspan="4"/>
2917+ <field name="product_ids" colspan="4" widget="one2many_list" nolabel="1" readonly="1"/>
2918+ </page>
2919+ <page string="Taxes Mapping">
2920+ <button type="object" string="Import Taxes" name="tax_import"/>
2921+ <field colspan="4" name="tax_ids" widget="one2many_list" nolabel="1"/>
2922+ </page>
2923+ <page string="Languages Mapping">
2924+ <button type="object" string="Import Languages" name="lang_import"/>
2925+ <field colspan="4" name="language_ids" widget="one2many_list" nolabel="1"/>
2926+ </page>
2927+ <page string="Categories Mapping">
2928+ <button type="object" string="Import Categories" name="category_import"/>
2929+ <button type="object" string="Import and create/update Categories" name="category_import_create"/>
2930+ <field colspan="4" name="category_ids" widget="one2many_list" nolabel="1"/>
2931+ </page>
2932+ <page string="Payment types Mapping">
2933+ <button type="object" string="Import Payment Methods" name="get_payment_methods"/>
2934+ <field colspan="4" name="pay_typ_ids" widget="one2many_list" nolabel="1"/>
2935+ </page>
2936+ <page string="Oscommerce Status Mapping">
2937+ <button type="object" string="Import Oscommerce Status" name="status_import" colspan="4"/>
2938+ <separator string="Status" colspan="4"/>
2939+ <field name="intermediate"/>
2940+ <field colspan="4" name="status_ids" widget="one2many_list" nolabel="1"/>
2941+ </page>
2942+ </notebook>
2943+ </form>
2944+ </field>
2945+ </record>
2946+ <record model="ir.ui.view" id="view_esale_oscom_tree">
2947+ <field name="name">esale.oscom.web.form</field>
2948+ <field name="model">esale.oscom.web</field>
2949+ <field name="type">tree</field>
2950+ <field name="arch" type="xml">
2951+ <tree string="OScommerce Web Shop">
2952+ <field name="name"/>
2953+ <field name="url"/>
2954+ <field name="active"/>
2955+ <field name="shop_id"/>
2956+ <field name="price_type"/>
2957+ <field name="esale_account_id"/>
2958+ </tree>
2959+ </field>
2960+ </record>
2961+ <record model="ir.actions.act_window" id="action_esale_oscom_form">
2962+ <field name="type">ir.actions.act_window</field>
2963+ <field name="res_model">esale.oscom.web</field>
2964+ <field name="view_type">form</field>
2965+ <field name="view_id" ref="view_esale_oscom_tree"/>
2966+ </record>
2967+
2968+ <menuitem name="Sales Management/Internet Sales/Websites" id="menu_action_esale_oscom_web" action="action_esale_oscom_form" groups="group_esale_oscom_user"/>
2969+
2970+ <record model="ir.ui.view" id="esale_oscom_language_web_form">
2971+ <field name="name">esale.oscom.language.web.form</field>
2972+ <field name="model">esale.oscom.lang</field>
2973+ <field name="type">form</field>
2974+ <field name="arch" type="xml">
2975+ <form string="Language">
2976+ <separator colspan="4" string="Language mapping"/>
2977+ <field colspan="4" name="name" select="1" required="1"/>
2978+ <field name="language_id" select="1"/>
2979+ <field name="esale_oscom_id" readonly="1" select="1"/>
2980+ </form>
2981+ </field>
2982+ </record>
2983+ <record model="ir.ui.view" id="esale_oscom_language_web_tree">
2984+ <field name="name">esale.oscom.language.web.tree</field>
2985+ <field name="model">esale.oscom.lang</field>
2986+ <field name="type">tree</field>
2987+ <field name="arch" type="xml">
2988+ <tree string="Language">
2989+ <field name="name" />
2990+ <field name="language_id" />
2991+ </tree>
2992+ </field>
2993+ </record>
2994+ <record model="ir.ui.view" id="esale_oscom_tax_web_form">
2995+ <field name="name">esale.oscom.tax.web.form</field>
2996+ <field name="model">esale.oscom.tax</field>
2997+ <field name="type">form</field>
2998+ <field name="arch" type="xml">
2999+ <form string="Taxes">
3000+ <separator colspan="4" string="Taxes mapping"/>
3001+ <field colspan="4" name="name" select="1" required="1"/>
3002+ <field name="tax_id" select="1"/>
3003+ <field name="esale_oscom_id" readonly="1" select="1"/>
3004+ </form>
3005+ </field>
3006+ </record>
3007+ <record model="ir.ui.view" id="esale_oscom_tax_web_tree">
3008+ <field name="name">esale.oscom.tax.web.tree</field>
3009+ <field name="model">esale.oscom.tax</field>
3010+ <field name="type">tree</field>
3011+ <field name="arch" type="xml">
3012+ <tree string="Taxes">
3013+ <field name="name" />
3014+ <field name="tax_id" />
3015+ </tree>
3016+ </field>
3017+ </record>
3018+
3019+<!-- ####################################################################################### -->
3020+ <record model="ir.ui.view" id="esale_oscom_pay_typ_form">
3021+ <field name="name">esale.oscom.pay.typ.form</field>
3022+ <field name="model">esale.oscom.paytype</field>
3023+ <field name="type">form</field>
3024+ <field name="arch" type="xml">
3025+ <form string="Payment types">
3026+ <separator colspan="4" string="Payment types mapping"/>
3027+ <field colspan="4" name="name" select="1" required="1"/>
3028+ <field name="payment_id" select="1"/>
3029+ <field name="esale_oscom_id" readonly="1" select="1"/>
3030+ <field name="paytyp" select="1"/>
3031+ <field name="journal_id" select="2" attrs="{'required':[('paytyp','=','type5')]}"/>
3032+ </form>
3033+ </field>
3034+ </record>
3035+ <record model="ir.ui.view" id="esale_oscom_pay_typ_tree">
3036+ <field name="name">esale.oscom.pay.typ.tree</field>
3037+ <field name="model">esale.oscom.paytype</field>
3038+ <field name="type">tree</field>
3039+ <field name="arch" type="xml">
3040+ <tree string="Payment types">
3041+ <field name="name" />
3042+ <field name="payment_id" />
3043+ <field name="paytyp" />
3044+ <field name="journal_id" />
3045+ </tree>
3046+ </field>
3047+ </record>
3048+<!-- ####################################################################################### -->
3049+ <record model="ir.ui.view" id="esale_oscom_status_form">
3050+ <field name="name">esale.oscom.status.form</field>
3051+ <field name="model">esale.oscom.status</field>
3052+ <field name="type">form</field>
3053+ <field name="arch" type="xml">
3054+ <form string="Osc status">
3055+ <separator colspan="4" string="Oscommerce Status mapping"/>
3056+ <field colspan="4" name="name" select="1" required="1"/>
3057+ <field name="language_id" select="1"/>
3058+ <field name="esale_oscom_id" readonly="1" select="1"/>
3059+ <field name="download" select="1"/>
3060+ </form>
3061+ </field>
3062+ </record>
3063+ <record model="ir.ui.view" id="esale_oscom_status_tree">
3064+ <field name="name">esale.oscom.status.tree</field>
3065+ <field name="model">esale.oscom.status</field>
3066+ <field name="type">tree</field>
3067+ <field name="arch" type="xml">
3068+ <tree string="Payment types">
3069+ <field name="name" />
3070+ <field name="language_id" />
3071+ <field name="esale_oscom_id" />
3072+ <field name="download" />
3073+ </tree>
3074+ </field>
3075+ </record>
3076+
3077+
3078+<!-- ####################################################################################### -->
3079+ <record model="ir.ui.view" id="esale_oscom_category_web_form">
3080+ <field name="name">esale.oscom.category.web.form</field>
3081+ <field name="model">esale.oscom.category</field>
3082+ <field name="type">form</field>
3083+ <field name="arch" type="xml">
3084+ <form string="Categories">
3085+ <separator colspan="4" string="taxes"/>
3086+ <field name="name" select="1" colspan="4" required="1"/>
3087+ <field name="category_id" select="1"/>
3088+ <field name="esale_oscom_id" select="1" readonly="1"/>
3089+ </form>
3090+ </field>
3091+ </record>
3092+ <record model="ir.ui.view" id="esale_oscom_category_web_tree">
3093+ <field name="name">esale.oscom.category.web.v</field>
3094+ <field name="model">esale.oscom.category</field>
3095+ <field name="type">tree</field>
3096+ <field name="arch" type="xml">
3097+ <tree string="Categories">
3098+ <field name="name" />
3099+ <field name="category_id" />
3100+ </tree>
3101+ </field>
3102+ </record>
3103+
3104+ <record model="ir.ui.view" id="esale_oscom_product_web_form">
3105+ <field name="name">esale.oscom.product.web.form</field>
3106+ <field name="model">esale.oscom.product</field>
3107+ <field name="type">form</field>
3108+ <field name="arch" type="xml">
3109+ <form string="Product">
3110+ <separator colspan="4" string="Product Information"/>
3111+ <field name="name" colspan="4" select="1" required="1"/>
3112+ <field name="product_id" on_change="onchange_product_id(product_id, web_id)" select="1" required="1"/>
3113+ <field name="esale_oscom_id" readonly="1" select="1"/>
3114+ </form>
3115+ </field>
3116+ </record>
3117
3118
3119 <!-- Web sale orders -->
3120- <record model="ir.ui.view" id="esale_oscom_saleorder_tree">
3121- <field name="name">esale.oscom.saleorder.tree</field>
3122- <field name="model">sale.order</field>
3123- <field name="type">tree</field>
3124- <field name="arch" type="xml">
3125- <tree string="Sales Orders">
3126+ <record model="ir.ui.view" id="esale_oscom_saleorder_tree">
3127+ <field name="name">esale.oscom.saleorder.tree</field>
3128+ <field name="model">sale.order</field>
3129+ <field name="type">tree</field>
3130+ <field name="arch" type="xml">
3131+ <tree string="Sales Orders">
3132 <field name="date_order"/>
3133 <field name="name" string="Reference"/>
3134- <field name="state"/>
3135- <field name="partner_id"/>
3136- <field name="partner_shipping_id"/>
3137- <field name="esale_oscom_web"/>
3138- <field name="esale_oscom_id"/>
3139- <field name="shipped"/>
3140- <field name="invoiced"/>
3141- <field name="orders_status"/>
3142- <field name="amount_untaxed"/>
3143- <field name="shipping_title"/>
3144- <field name="pay_met_title"/>
3145- </tree>
3146- </field>
3147- </record>
3148- <record model="ir.ui.view" id="esale_oscom_saleorder_form">
3149- <field name="name">esale.oscom.saleorder.form</field>
3150- <field name="model">sale.order</field>
3151- <field name="type">form</field>
3152- <field name="inherit_id" ref="sale.view_order_form" />
3153- <field name="arch" type="xml">
3154- <notebook>
3155- <page string="Os Commerce Information" position="inside">
3156- <separator string="OsCommerce" colspan="4"/>
3157- <group col="2" colspan="2">
3158- <field name="esale_oscom_id" readonly="1" select="1"/>
3159- <field name="esale_oscom_web" on_change="onchange_esale_oscom_web(esale_oscom_web)" select="1"/>
3160- </group>
3161- <group col="2" colspan="2">
3162- <field name="pay_met_title" readonly="1"/>
3163- <field name="shipping_title" readonly="1"/>
3164- </group>
3165- <field name="orders_status" readonly="1"/>
3166- <field name="shipping_agency"/>
3167- <field name="tracking_number"/>
3168- <field name="number_of_packages"/>
3169- <field name="volume"/>
3170- <separator string="Options selected will be applied on changing osc order status" colspan="4"/>
3171- <group col="2" colspan="2">
3172- <field name="update_comment"/>
3173- <field name="send_web_email"/>
3174- </group>
3175- <field colspan="4" name="status_comment"/>
3176- <field name="orders_status_id" on_change="onchange_esale_oscom_status(esale_oscom_web, esale_oscom_id, orders_status_id, status_comment, update_comment, send_web_email,tracking_number )" select="1"/>
3177- <field colspan="4" name="additional_info"/>
3178- </page>
3179- </notebook>
3180- </field>
3181- </record>
3182- <record model="ir.actions.act_window" id="action_saleorder_tree">
3183- <field name="type">ir.actions.act_window</field>
3184- <field name="res_model">sale.order</field>
3185- <field name="view_type">form</field>
3186- <field name="view_id" ref="esale_oscom_saleorder_tree"/>
3187- <field name="view_mode">tree,form</field>
3188- <field name="domain">[('esale_oscom_id','!=', 0)]</field>
3189- </record>
3190-
3191- <menuitem name="Sales Management/Internet Sales/Web sale orders" id="menu_action_esale_oscom_saleorder" action="action_saleorder_tree" groups="group_esale_oscom_user"/>
3192-
3193- <record model="ir.actions.act_window" id="action_saleorder_form">
3194- <field name="type">ir.actions.act_window</field>
3195- <field name="res_model">sale.order</field>
3196- <field name="view_type">form</field>
3197- <field name="view_id" ref="esale_oscom_saleorder_form"/>
3198- <field name="domain">[('esale_oscom_id','!=', 0)]</field>
3199- </record>
3200-
3201- <menuitem name="Sales Management/Internet Sales/Web sale orders/New order" id="menu_action_esale_oscom_saleorder_new" action="action_saleorder_form"/>
3202-
3203- <record model="ir.actions.act_window" id="action_saleorder_tree_draft">
3204- <field name="type">ir.actions.act_window</field>
3205- <field name="res_model">sale.order</field>
3206- <field name="view_type">form</field>
3207- <field name="view_id" ref="esale_oscom_saleorder_tree"/>
3208- <field name="view_mode">tree,form</field>
3209- <field name="domain">[('esale_oscom_web','!=', ''),('state','=','draft'),('user_id','=',uid)]</field>
3210- </record>
3211-
3212- <menuitem name="Sales Management/Internet Sales/Web sale orders/Request for quotation" id="menu_action_saleorder_tree_draft" action="action_saleorder_tree_draft"/>
3213-
3214- <record model="ir.actions.act_window" id="action_saleorder_tree_manual">
3215- <field name="type">ir.actions.act_window</field>
3216- <field name="res_model">sale.order</field>
3217- <field name="view_type">form</field>
3218- <field name="view_id" ref="esale_oscom_saleorder_tree"/>
3219- <field name="view_mode">tree,form</field>
3220- <field name="domain">[('esale_oscom_web','!=', ''),('state','=','manual'),('user_id','=',uid)]</field>
3221- </record>
3222-
3223- <menuitem name="Sales Management/Internet Sales/Web sale orders/Waiting invoice" id="menu_action_saleorder_tree_manual" action="action_saleorder_tree_manual"/>
3224-
3225- <record model="ir.actions.act_window" id="action_saleorder_tree_progress">
3226- <field name="type">ir.actions.act_window</field>
3227- <field name="res_model">sale.order</field>
3228- <field name="view_type">form</field>
3229- <field name="view_id" ref="esale_oscom_saleorder_tree"/>
3230- <field name="view_mode">tree,form</field>
3231- <field name="domain">[('esale_oscom_web','!=', ''),('state','=','progress'),('user_id','=',uid)]</field>
3232- </record>
3233-
3234- <menuitem name="Sales Management/Internet Sales/Web sale orders/In progress" id="menu_action_saleorder_tree_progress" action="action_saleorder_tree_progress"/>
3235+ <field name="state"/>
3236+ <field name="partner_id"/>
3237+ <field name="partner_shipping_id"/>
3238+ <field name="esale_oscom_web"/>
3239+ <field name="esale_oscom_id"/>
3240+ <field name="shipped"/>
3241+ <field name="invoiced"/>
3242+ <field name="orders_status"/>
3243+ <field name="amount_untaxed"/>
3244+ <field name="shipping_title"/>
3245+ <field name="pay_met_title"/>
3246+ </tree>
3247+ </field>
3248+ </record>
3249+ <record model="ir.ui.view" id="esale_oscom_saleorder_form">
3250+ <field name="name">esale.oscom.saleorder.form</field>
3251+ <field name="model">sale.order</field>
3252+ <field name="type">form</field>
3253+ <field name="inherit_id" ref="sale.view_order_form" />
3254+ <field name="arch" type="xml">
3255+ <notebook>
3256+ <page string="Os Commerce Information" position="inside">
3257+ <separator string="OsCommerce" colspan="4"/>
3258+ <group col="2" colspan="2">
3259+ <field name="esale_oscom_id" readonly="1" select="1"/>
3260+ <field name="esale_oscom_web" on_change="onchange_esale_oscom_web(esale_oscom_web)" select="1"/>
3261+ </group>
3262+ <group col="2" colspan="2">
3263+ <field name="pay_met_title" readonly="1"/>
3264+ <field name="shipping_title" readonly="1"/>
3265+ </group>
3266+ <field name="orders_status" readonly="1"/>
3267+ <field name="shipping_agency"/>
3268+ <field name="tracking_number"/>
3269+ <field name="number_of_packages"/>
3270+ <field name="volume"/>
3271+ <separator string="Options selected will be applied on changing osc order status" colspan="4"/>
3272+ <group col="2" colspan="2">
3273+ <field name="update_comment"/>
3274+ <field name="send_web_email"/>
3275+ </group>
3276+ <field colspan="4" name="status_comment"/>
3277+ <field name="orders_status_id" on_change="onchange_esale_oscom_status(esale_oscom_web, esale_oscom_id, orders_status_id, status_comment, update_comment, send_web_email,tracking_number )" select="1"/>
3278+ <field colspan="4" name="additional_info"/>
3279+ </page>
3280+ </notebook>
3281+ </field>
3282+ </record>
3283+ <record model="ir.actions.act_window" id="action_saleorder_tree">
3284+ <field name="type">ir.actions.act_window</field>
3285+ <field name="res_model">sale.order</field>
3286+ <field name="view_type">form</field>
3287+ <field name="view_id" ref="esale_oscom_saleorder_tree"/>
3288+ <field name="view_mode">tree,form</field>
3289+ <field name="domain">[('esale_oscom_id','!=', 0)]</field>
3290+ </record>
3291+
3292+ <menuitem name="Sales Management/Internet Sales/Web sale orders" id="menu_action_esale_oscom_saleorder" action="action_saleorder_tree" groups="group_esale_oscom_user"/>
3293+
3294+ <record model="ir.actions.act_window" id="action_saleorder_form">
3295+ <field name="type">ir.actions.act_window</field>
3296+ <field name="res_model">sale.order</field>
3297+ <field name="view_type">form</field>
3298+ <field name="view_id" ref="esale_oscom_saleorder_form"/>
3299+ <field name="domain">[('esale_oscom_id','!=', 0)]</field>
3300+ </record>
3301+
3302+ <menuitem name="Sales Management/Internet Sales/Web sale orders/New order" id="menu_action_esale_oscom_saleorder_new" action="action_saleorder_form"/>
3303+
3304+ <record model="ir.actions.act_window" id="action_saleorder_tree_draft">
3305+ <field name="type">ir.actions.act_window</field>
3306+ <field name="res_model">sale.order</field>
3307+ <field name="view_type">form</field>
3308+ <field name="view_id" ref="esale_oscom_saleorder_tree"/>
3309+ <field name="view_mode">tree,form</field>
3310+ <field name="domain">[('esale_oscom_web','!=', ''),('state','=','draft'),('user_id','=',uid)]</field>
3311+ </record>
3312+
3313+ <menuitem name="Sales Management/Internet Sales/Web sale orders/Request for quotation" id="menu_action_saleorder_tree_draft" action="action_saleorder_tree_draft"/>
3314+
3315+ <record model="ir.actions.act_window" id="action_saleorder_tree_manual">
3316+ <field name="type">ir.actions.act_window</field>
3317+ <field name="res_model">sale.order</field>
3318+ <field name="view_type">form</field>
3319+ <field name="view_id" ref="esale_oscom_saleorder_tree"/>
3320+ <field name="view_mode">tree,form</field>
3321+ <field name="domain">[('esale_oscom_web','!=', ''),('state','=','manual'),('user_id','=',uid)]</field>
3322+ </record>
3323+
3324+ <menuitem name="Sales Management/Internet Sales/Web sale orders/Waiting invoice" id="menu_action_saleorder_tree_manual" action="action_saleorder_tree_manual"/>
3325+
3326+ <record model="ir.actions.act_window" id="action_saleorder_tree_progress">
3327+ <field name="type">ir.actions.act_window</field>
3328+ <field name="res_model">sale.order</field>
3329+ <field name="view_type">form</field>
3330+ <field name="view_id" ref="esale_oscom_saleorder_tree"/>
3331+ <field name="view_mode">tree,form</field>
3332+ <field name="domain">[('esale_oscom_web','!=', ''),('state','=','progress'),('user_id','=',uid)]</field>
3333+ </record>
3334+
3335+ <menuitem name="Sales Management/Internet Sales/Web sale orders/In progress" id="menu_action_saleorder_tree_progress" action="action_saleorder_tree_progress"/>
3336
3337
3338 <!-- Web sale invoices -->
3339- <record model="ir.actions.act_window" id="action_oscom_invoice_tree">
3340- <field name="type">ir.actions.act_window</field>
3341- <field name="res_model">account.invoice</field>
3342- <field name="view_type">form</field>
3343- <field name="view_mode">tree,form</field>
3344- <field name="domain">[('esale_oscom_web','!=', False)]</field>
3345- </record>
3346-
3347- <menuitem name="Sales Management/Internet Sales/Invoices" id="menu_action_esale_oscom_invoices" action="action_oscom_invoice_tree" groups="group_esale_oscom_user"/>
3348-
3349- <record model="ir.actions.act_window" id="action_oscom_invoice_draft_tree">
3350- <field name="type">ir.actions.act_window</field>
3351- <field name="res_model">account.invoice</field>
3352- <field name="view_type">form</field>
3353- <field name="view_mode">tree,form</field>
3354- <field name="domain">[('esale_oscom_web','!=', False),('state','=','draft')]</field>
3355- </record>
3356-
3357- <menuitem name="Sales Management/Internet Sales/Invoices/Draft" id="menu_action_oscom_invoice_draft_tree" action="action_oscom_invoice_draft_tree"/>
3358-
3359- <record model="ir.actions.act_window" id="action_oscom_invoice_proforma">
3360- <field name="type">ir.actions.act_window</field>
3361- <field name="res_model">account.invoice</field>
3362- <field name="view_type">form</field>
3363- <field name="view_mode">tree,form</field>
3364- <field name="domain">[('esale_oscom_web','!=',False),('state','=','proforma')]</field>
3365- </record>
3366-
3367- <menuitem name="Sales Management/Internet Sales/Invoices/PRO-FORMA" id="menu_action_oscom_invoice_proforma_tree" action="action_oscom_invoice_proforma"/>
3368-
3369- <record model="ir.actions.act_window" id="action_oscom_invoice_open">
3370- <field name="type">ir.actions.act_window</field>
3371- <field name="res_model">account.invoice</field>
3372- <field name="view_type">form</field>
3373- <field name="view_mode">tree,form</field>
3374- <field name="domain">[('esale_oscom_web','!=', False),('state','=','open')]</field>
3375- </record>
3376-
3377- <menuitem name="Sales Management/Internet Sales/Invoices/Opened" id="menu_action_oscom_invoice_open_tree" action="action_oscom_invoice_open"/>
3378+ <record model="ir.actions.act_window" id="action_oscom_invoice_tree">
3379+ <field name="type">ir.actions.act_window</field>
3380+ <field name="res_model">account.invoice</field>
3381+ <field name="view_type">form</field>
3382+ <field name="view_mode">tree,form</field>
3383+ <field name="domain">[('esale_oscom_web','!=', False)]</field>
3384+ </record>
3385+
3386+ <menuitem name="Sales Management/Internet Sales/Invoices" id="menu_action_esale_oscom_invoices" action="action_oscom_invoice_tree" groups="group_esale_oscom_user"/>
3387+
3388+ <record model="ir.actions.act_window" id="action_oscom_invoice_draft_tree">
3389+ <field name="type">ir.actions.act_window</field>
3390+ <field name="res_model">account.invoice</field>
3391+ <field name="view_type">form</field>
3392+ <field name="view_mode">tree,form</field>
3393+ <field name="domain">[('esale_oscom_web','!=', False),('state','=','draft')]</field>
3394+ </record>
3395+
3396+ <menuitem name="Sales Management/Internet Sales/Invoices/Draft" id="menu_action_oscom_invoice_draft_tree" action="action_oscom_invoice_draft_tree"/>
3397+
3398+ <record model="ir.actions.act_window" id="action_oscom_invoice_proforma">
3399+ <field name="type">ir.actions.act_window</field>
3400+ <field name="res_model">account.invoice</field>
3401+ <field name="view_type">form</field>
3402+ <field name="view_mode">tree,form</field>
3403+ <field name="domain">[('esale_oscom_web','!=',False),('state','=','proforma')]</field>
3404+ </record>
3405+
3406+ <menuitem name="Sales Management/Internet Sales/Invoices/PRO-FORMA" id="menu_action_oscom_invoice_proforma_tree" action="action_oscom_invoice_proforma"/>
3407+
3408+ <record model="ir.actions.act_window" id="action_oscom_invoice_open">
3409+ <field name="type">ir.actions.act_window</field>
3410+ <field name="res_model">account.invoice</field>
3411+ <field name="view_type">form</field>
3412+ <field name="view_mode">tree,form</field>
3413+ <field name="domain">[('esale_oscom_web','!=', False),('state','=','open')]</field>
3414+ </record>
3415+
3416+ <menuitem name="Sales Management/Internet Sales/Invoices/Opened" id="menu_action_oscom_invoice_open_tree" action="action_oscom_invoice_open"/>
3417
3418 </data>
3419-</openerp>
3420-
3421+</openerp>
3422\ No newline at end of file
3423
3424=== removed file 'esale_osc/esale_oscom_workflow.xml'
3425--- esale_osc/esale_oscom_workflow.xml 2009-03-23 14:47:31 +0000
3426+++ esale_osc/esale_oscom_workflow.xml 1970-01-01 00:00:00 +0000
3427@@ -1,230 +0,0 @@
3428-<?xml version="1.0" encoding="utf-8"?>
3429-<openerp>
3430-<data>
3431- <record model="workflow" id="wkf_oscom_sale">
3432- <field name="name">esale_oscom.saleorder.basic</field>
3433- <field name="osv">esale_oscom.saleorder</field>
3434- <field name="on_create">True</field>
3435- </record>
3436-
3437- #----------------------------------------------
3438- # Activity
3439- #----------------------------------------------
3440- <record model="workflow.activity" id="act_draft">
3441- <field name="wkf_id" ref="wkf_oscom_sale"/>
3442- <field name="flow_start">True</field>
3443- <field name="name">draft</field>
3444- </record>
3445- <record model="workflow.activity" id="act_router">
3446- <field name="wkf_id" ref="wkf_oscom_sale"/>
3447- <field name="name">router</field>
3448- <field name="kind">function</field>
3449- <field name="action">action_wait()</field>
3450- <field name="split_mode">OR</field>
3451- </record>
3452- <record model="workflow.activity" id="act_wait_invoice">
3453- <field name="wkf_id" ref="wkf_oscom_sale"/>
3454- <field name="name">wait_invoice</field>
3455- </record>
3456- <record model="workflow.activity" id="act_wait_ship">
3457- <field name="wkf_id" ref="wkf_oscom_sale"/>
3458- <field name="name">wait_ship</field>
3459- </record>
3460-
3461- <record model="workflow.activity" id="act_done">
3462- <field name="wkf_id" ref="wkf_oscom_sale"/>
3463- <field name="name">done</field>
3464- <field name="flow_stop">True</field>
3465- <field name="kind">function</field>
3466- <field name="action">write({'state':'done'})</field>
3467- <field name="join_mode">AND</field>
3468- </record>
3469- <record model="workflow.activity" id="act_cancel">
3470- <field name="wkf_id" ref="wkf_oscom_sale"/>
3471- <field name="name">cancel</field>
3472- <field name="flow_stop">True</field>
3473- <field name="kind">stopall</field>
3474- <field name="action">action_cancel()</field>
3475- </record>
3476- <record model="workflow.activity" id="act_cancel2">
3477- <field name="wkf_id" ref="wkf_oscom_sale"/>
3478- <field name="name">cancel2</field>
3479- <field name="flow_stop">True</field>
3480- <field name="kind">stopall</field>
3481- <field name="action">action_cancel()</field>
3482- </record>
3483- <record model="workflow.activity" id="act_cancel3">
3484- <field name="wkf_id" ref="wkf_oscom_sale"/>
3485- <field name="name">cancel3</field>
3486- <field name="flow_stop">True</field>
3487- <field name="kind">stopall</field>
3488- <field name="action">action_cancel()</field>
3489- </record>
3490-
3491- <record model="workflow.activity" id="act_invoice">
3492- <field name="wkf_id" ref="wkf_oscom_sale"/>
3493- <field name="name">invoice</field>
3494- <field name="kind">subflow</field>
3495- <field name="subflow_id" search="[('name','=','account.invoice.basic')]"/>
3496- <field name="action">action_invoice_create()</field>
3497- </record>
3498- <record model="workflow.activity" id="act_invoice_except">
3499- <field name="wkf_id" ref="wkf_oscom_sale"/>
3500- <field name="name">invoice_except</field>
3501- <field name="kind">function</field>
3502- <field name="action">write({'state':'invoice_except', 'invoice_id':False})</field>
3503- </record>
3504- <record model="workflow.activity" id="act_invoice_end">
3505- <field name="wkf_id" ref="wkf_oscom_sale"/>
3506- <field name="name">invoice_end</field>
3507- <field name="kind">function</field>
3508- <field name="action">write({'invoiced':1})</field>
3509- </record>
3510- <record model="workflow.activity" id="act_invoice_cancel">
3511- <field name="wkf_id" ref="wkf_oscom_sale"/>
3512- <field name="name">invoice_cancel</field>
3513- <field name="flow_stop">True</field>
3514- <field name="kind">stopall</field>
3515- <field name="action">action_cancel()</field>
3516- </record>
3517-
3518- <record model="workflow.activity" id="act_ship">
3519- <field name="wkf_id" ref="wkf_oscom_sale"/>
3520- <field name="name">ship</field>
3521- <field name="kind">function</field>
3522- <!--
3523- <field name="kind">subflow</field>
3524- <field name="subflow_id" search="[('osv','=','stock.picking')]"/>
3525- -->
3526- <field name="action">action_ship_create()</field>
3527- </record>
3528- <record model="workflow.activity" id="act_ship_except">
3529- <field name="wkf_id" ref="wkf_oscom_sale"/>
3530- <field name="name">ship_except</field>
3531- <field name="kind">function</field>
3532- <field name="action">write({'state':'shipping_except'})</field>
3533- </record>
3534- <record model="workflow.activity" id="act_ship_end">
3535- <field name="wkf_id" ref="wkf_oscom_sale"/>
3536- <field name="name">ship_end</field>
3537- <field name="kind">function</field>
3538- <field name="action">action_ship_end()</field>
3539- </record>
3540- <record model="workflow.activity" id="act_ship_cancel">
3541- <field name="wkf_id" ref="wkf_oscom_sale"/>
3542- <field name="name">ship_cancel</field>
3543- <field name="flow_stop">True</field>
3544- <field name="kind">stopall</field>
3545- <field name="action">action_cancel()</field>
3546- </record>
3547-
3548- #----------------------------------------------
3549- # Transistion
3550- #----------------------------------------------
3551-
3552- <record model="workflow.transition" id="trans_invoice_end_done">
3553- <field name="act_from" ref="act_invoice_end"/>
3554- <field name="act_to" ref="act_done"/>
3555- </record>
3556- <record model="workflow.transition" id="trans_draft_router">
3557- <field name="act_from" ref="act_draft"/>
3558- <field name="act_to" ref="act_router"/>
3559- <field name="signal">order_confirm</field>
3560- </record>
3561- <record model="workflow.transition" id="trans_draft_cancel">
3562- <field name="act_from" ref="act_draft"/>
3563- <field name="act_to" ref="act_cancel"/>
3564- <field name="signal">cancel</field>
3565- </record>
3566- <record model="workflow.transition" id="trans_router_wait_invoice">
3567- <field name="act_from" ref="act_router"/>
3568- <field name="act_to" ref="act_wait_invoice"/>
3569- </record>
3570- <record model="workflow.transition" id="trans_router_wait_ship">
3571- <field name="act_from" ref="act_router"/>
3572- <field name="act_to" ref="act_wait_ship"/>
3573- </record>
3574- <record model="workflow.transition" id="trans_wait_invoice_cancel2">
3575- <field name="act_from" ref="act_wait_invoice"/>
3576- <field name="act_to" ref="act_cancel2"/>
3577- <field name="signal">cancel</field>
3578- </record>
3579- <record model="workflow.transition" id="trans_wait_ship_cancel3">
3580- <field name="act_from" ref="act_wait_ship"/>
3581- <field name="act_to" ref="act_cancel3"/>
3582- <field name="signal">cancel</field>
3583- </record>
3584- <record model="workflow.transition" id="trans_wait_ship_ship">
3585- <field name="act_from" ref="act_wait_ship"/>
3586- <field name="act_to" ref="act_ship"/>
3587- <field name="condition">(order_policy!='prepaid') or invoiced</field>
3588- </record>
3589- <record model="workflow.transition" id="trans_wait_invoice_invoice">
3590- <field name="act_from" ref="act_wait_invoice"/>
3591- <field name="act_to" ref="act_invoice"/>
3592- <field name="condition">(order_policy=='prepaid') or ((order_policy=='postpaid') and shipped)</field>
3593- </record>
3594- <record model="workflow.transition" id="trans_wait_invoice_invoice_manual">
3595- <field name="act_from" ref="act_wait_invoice"/>
3596- <field name="act_to" ref="act_invoice"/>
3597- <field name="signal">manual_invoice</field>
3598- </record>
3599- <record model="workflow.transition" id="trans_invoice_invoice_end">
3600- <field name="act_from" ref="act_invoice"/>
3601- <field name="act_to" ref="act_invoice_end"/>
3602- <field name="signal">subflow.paid</field>
3603- </record>
3604- <record model="workflow.transition" id="trans_invoice_invoice_except">
3605- <field name="act_from" ref="act_invoice"/>
3606- <field name="act_to" ref="act_invoice_except"/>
3607- <field name="signal">subflow.cancel</field>
3608- </record>
3609- <record model="workflow.transition" id="trans_invoice_except_invoice">
3610- <field name="act_from" ref="act_invoice_except"/>
3611- <field name="act_to" ref="act_invoice"/>
3612- <field name="signal">invoice_recreate</field>
3613- </record>
3614- <record model="workflow.transition" id="trans_invoice_except_invoice_end">
3615- <field name="act_from" ref="act_invoice_except"/>
3616- <field name="act_to" ref="act_invoice_end"/>
3617- <field name="signal">invoice_corrected</field>
3618- </record>
3619- <record model="workflow.transition" id="trans_invoice_except_invoice_cancel">
3620- <field name="act_from" ref="act_invoice_except"/>
3621- <field name="act_to" ref="act_invoice_cancel"/>
3622- <field name="signal">invoice_cancel</field>
3623- </record>
3624- <record model="workflow.transition" id="trans_ship_end_done">
3625- <field name="act_from" ref="act_ship_end"/>
3626- <field name="act_to" ref="act_done"/>
3627- </record>
3628- <record model="workflow.transition" id="trans_ship_ship_end">
3629- <field name="act_from" ref="act_ship"/>
3630- <field name="act_to" ref="act_ship_end"/>
3631- <field name="trigger_model">mrp.procurement</field>
3632- <field name="trigger_expr_id">procurement_lines_get()</field>
3633- <field name="condition">test_procurement_finnished()</field>
3634- </record>
3635- <record model="workflow.transition" id="trans_ship_ship_except">
3636- <field name="act_from" ref="act_ship"/>
3637- <field name="act_to" ref="act_ship_except"/>
3638- <field name="condition">test_procurement_finnished('cancel')</field>
3639- </record>
3640- <record model="workflow.transition" id="trans_ship_except_ship">
3641- <field name="act_from" ref="act_ship_except"/>
3642- <field name="act_to" ref="act_ship"/>
3643- <field name="signal">ship_recreate</field>
3644- </record>
3645- <record model="workflow.transition" id="trans_">
3646- <field name="act_from" ref="act_ship_except"/>
3647- <field name="act_to" ref="act_ship_end"/>
3648- <field name="signal">ship_corrected</field>
3649- </record>
3650- <record model="workflow.transition" id="trans_ship_except_ship_cancel">
3651- <field name="act_from" ref="act_ship_except"/>
3652- <field name="act_to" ref="act_ship_cancel"/>
3653- <field name="signal">ship_cancel</field>
3654- </record>
3655-
3656-</data>
3657-</openerp>
3658
3659=== renamed file 'esale_osc/i18n/es.po' => 'esale_osc/i18n/es.po.THIS'
3660=== modified file 'esale_osc/i18n/es_ES.po' (properties changed: -x to +x)
3661--- esale_osc/i18n/es_ES.po 2010-02-02 20:22:20 +0000
3662+++ esale_osc/i18n/es_ES.po 2010-07-21 10:31:39 +0000
3663@@ -6,14 +6,15 @@
3664 msgstr ""
3665 "Project-Id-Version: OpenERP Server 5.0.6\n"
3666 "Report-Msgid-Bugs-To: support@openerp.com\n"
3667-"POT-Creation-Date: 2009-12-30 02:38:48+0000\n"
3668-"PO-Revision-Date: 2009-12-30 03:47+0100\n"
3669-"Last-Translator: Ana Juaristi <ajuaristio@gmail.com>\n"
3670+"POT-Creation-Date: 2009-12-30 02:49+0000\n"
3671+"PO-Revision-Date: 2010-04-21 14:57+0100\n"
3672+"Last-Translator: ZhenIT Software <info@ZhenIT.com>\n"
3673 "Language-Team: \n"
3674 "MIME-Version: 1.0\n"
3675 "Content-Type: text/plain; charset=UTF-8\n"
3676 "Content-Transfer-Encoding: 8bit\n"
3677-"Plural-Forms: \n"
3678+"X-Launchpad-Export-Date: 2010-02-15 15:01+0000\n"
3679+"X-Generator: Launchpad (build Unknown)\n"
3680
3681 #. module: esale_osc
3682 #: view:esale.oscom.web:0
3683@@ -58,7 +59,7 @@
3684 #. module: esale_osc
3685 #: field:product.product,manufacturer_id:0
3686 msgid " Manufacturer"
3687-msgstr "Fabricante"
3688+msgstr " Fabricante"
3689
3690 #. module: esale_osc
3691 #: model:ir.ui.menu,name:esale_osc.menu_esale_oscom_products
3692@@ -520,7 +521,7 @@
3693 #. module: esale_osc
3694 #: help:sale.order,shipping_agency:0
3695 msgid " Include Carrier to delivery order with"
3696-msgstr "Incluya al transportista con el que enviará el pedido"
3697+msgstr " Incluya al transportista con el que enviará el pedido"
3698
3699 #. module: esale_osc
3700 #: help:sale.order,orders_status_id:0
3701@@ -862,3 +863,32 @@
3702 msgid "In/Out Stock"
3703 msgstr "Disponible/Agotado"
3704
3705+#. module: esale_osc
3706+#: field:esale.oscom.web,admin_user:0
3707+msgid "Admin User"
3708+msgstr "Usuario admin"
3709+
3710+#. module: esale_osc
3711+#: field:esale.oscom.web,admin_pass:0
3712+msgid "Admin Pass"
3713+msgstr "Clave admin"
3714+
3715+#. module: esale_osc
3716+#: field:esale.oscom.web,default_partner_category:0
3717+msgid "Customers partner category"
3718+msgstr "Categoría clientes"
3719+
3720+#. module: esale_osc
3721+#: field:esale.oscom.web,download_number:30
3722+msgid "Download number"
3723+msgstr "Descarga en bloques de"
3724+
3725+#. module: esale_osc
3726+#: field:esale.oscom.web,override_products_data:0
3727+msgid "Override Products Data"
3728+msgstr "Sobreescribir datos de productos"
3729+
3730+#. module: esale_osc
3731+#: help:esale.oscom.web,override_products_data:0
3732+msgid "Click if you want to Update products data on the shop with changes made in openerp."
3733+msgstr "Marca para actualizar los datos de los productos de la tienda cuando se modifiquen en openERP"
3734\ No newline at end of file
3735
3736=== modified file 'esale_osc/i18n/esale_osc.pot' (properties changed: -x to +x)
3737--- esale_osc/i18n/esale_osc.pot 2010-02-02 20:22:20 +0000
3738+++ esale_osc/i18n/esale_osc.pot 2010-07-21 10:31:39 +0000
3739@@ -1,252 +1,247 @@
3740-# Translation of OpenERP Server.
3741-# This file contains the translation of the following modules:
3742-# * esale_osc
3743-#
3744 msgid ""
3745 msgstr ""
3746-"Project-Id-Version: OpenERP Server 5.0.6\n"
3747-"Report-Msgid-Bugs-To: support@openerp.com\n"
3748-"POT-Creation-Date: 2009-12-30 02:49:33+0000\n"
3749-"PO-Revision-Date: 2009-12-30 02:49:33+0000\n"
3750-"Last-Translator: <>\n"
3751+"Project-Id-Version: \n"
3752+"POT-Creation-Date: \n"
3753+"PO-Revision-Date: \n"
3754+"Last-Translator: ZhenIT Software <info@ZhenIT.com>\n"
3755 "Language-Team: \n"
3756 "MIME-Version: 1.0\n"
3757-"Content-Type: text/plain; charset=UTF-8\n"
3758-"Content-Transfer-Encoding: \n"
3759-"Plural-Forms: \n"
3760+"Content-Type: text/plain; charset=iso-8859-1\n"
3761+"Content-Transfer-Encoding: 8bit\n"
3762
3763+#: view:esale.oscom.web:0
3764 #. module: esale_osc
3765-#: view:esale.oscom.web:0
3766 msgid "Taxes Mapping"
3767 msgstr ""
3768
3769-#. module: esale_osc
3770 #: model:ir.model,name:esale_osc.model_esale_oscom_paytype
3771+#. module: esale_osc
3772 msgid "esale_oscom PayType"
3773 msgstr ""
3774
3775-#. module: esale_osc
3776 #: field:esale.oscom.tax,name:0
3777+#. module: esale_osc
3778 msgid "Tax name"
3779 msgstr ""
3780
3781-#. module: esale_osc
3782 #: field:esale.oscom.status,download:0
3783+#. module: esale_osc
3784 msgid "Download Orders on Status"
3785 msgstr ""
3786
3787-#. module: esale_osc
3788 #: model:ir.model,name:esale_osc.model_esale_oscom_web
3789+#. module: esale_osc
3790 msgid "esale.oscom.web"
3791 msgstr ""
3792
3793-#. module: esale_osc
3794 #: constraint:ir.actions.act_window:0
3795+#. module: esale_osc
3796 msgid "Invalid model name in the action definition."
3797 msgstr ""
3798
3799+#: view:esale.oscom.status:0
3800 #. module: esale_osc
3801-#: view:esale.oscom.status:0
3802 msgid "Oscommerce Status mapping"
3803 msgstr ""
3804
3805+#: view:esale.oscom.web:0
3806 #. module: esale_osc
3807-#: view:esale.oscom.web:0
3808 msgid "Import Languages"
3809 msgstr ""
3810
3811-#. module: esale_osc
3812 #: field:product.product,manufacturer_id:0
3813+#. module: esale_osc
3814 msgid " Manufacturer"
3815 msgstr ""
3816
3817-#. module: esale_osc
3818 #: model:ir.ui.menu,name:esale_osc.menu_esale_oscom_products
3819+#. module: esale_osc
3820 msgid "Synchronize products and stocks to all OScommerce web shops"
3821 msgstr ""
3822
3823-#. module: esale_osc
3824 #: field:sale.order,orders_status_id:0
3825+#. module: esale_osc
3826 msgid "Osc Status Actual"
3827 msgstr ""
3828
3829-#. module: esale_osc
3830 #: model:ir.actions.wizard,name:esale_osc.wizard_esale_oscom_select_stocks
3831 #: model:ir.actions.wizard,name:esale_osc.wizard_esale_oscom_stocks
3832+#. module: esale_osc
3833 msgid "Update stocks"
3834 msgstr ""
3835
3836+#: view:product.product:0
3837 #. module: esale_osc
3838-#: view:product.product:0
3839 msgid "E-Sale Information"
3840 msgstr ""
3841
3842+#: view:esale.oscom.web:0
3843 #. module: esale_osc
3844-#: view:esale.oscom.web:0
3845 msgid "Oscommerce Status Mapping"
3846 msgstr ""
3847
3848+#: constraint:product.product:0
3849 #. module: esale_osc
3850-#: constraint:product.product:0
3851 msgid "You can not give other value in Special Price! Please enter number with % or decimal value"
3852 msgstr ""
3853
3854-#. module: esale_osc
3855 #: model:ir.ui.menu,name:esale_osc.menu_action_esale_oscom_product_manufacturer
3856+#. module: esale_osc
3857 msgid "Manufacturers"
3858 msgstr ""
3859
3860-#. module: esale_osc
3861 #: model:ir.actions.wizard,name:esale_osc.wizard_esale_oscom_products
3862 #: model:ir.actions.wizard,name:esale_osc.wizard_esale_oscom_select_products
3863+#. module: esale_osc
3864 msgid "Sync. products and stocks"
3865 msgstr ""
3866
3867-#. module: esale_osc
3868 #: model:ir.model,name:esale_osc.model_esale_oscom_product
3869+#. module: esale_osc
3870 msgid "esale_oscom Product"
3871 msgstr ""
3872
3873-#. module: esale_osc
3874 #: field:product.product,oscom_url:0
3875+#. module: esale_osc
3876 msgid "URL to OScommerce"
3877 msgstr ""
3878
3879+#: selection:product.product,spe_price_status:0
3880 #. module: esale_osc
3881-#: selection:product.product,spe_price_status:0
3882 msgid "On"
3883 msgstr ""
3884
3885-#. module: esale_osc
3886 #: field:esale.oscom.web,url:0
3887 #: field:product.manufacturer,manufacturer_url:0
3888 #: field:product.product,product_url:0
3889+#. module: esale_osc
3890 msgid "URL"
3891 msgstr ""
3892
3893-#. module: esale_osc
3894 #: model:ir.ui.menu,name:esale_osc.menu_esale_oscom_stocks
3895+#. module: esale_osc
3896 msgid "Update stocks to all OScommerce web shops"
3897 msgstr ""
3898
3899+#: selection:product.product,in_out_stock:0
3900 #. module: esale_osc
3901-#: selection:product.product,in_out_stock:0
3902 msgid "In Stock"
3903 msgstr ""
3904
3905-#. module: esale_osc
3906 #: model:ir.actions.wizard,name:esale_osc.wizard_esale_oscom_saleorders
3907+#. module: esale_osc
3908 msgid "Import sale orders"
3909 msgstr ""
3910
3911-#. module: esale_osc
3912 #: field:sale.order,shipping_title:0
3913+#. module: esale_osc
3914 msgid "Shipping"
3915 msgstr ""
3916
3917+#: view:esale.oscom.web:0
3918 #. module: esale_osc
3919-#: view:esale.oscom.web:0
3920 msgid "Import Oscommerce Status"
3921 msgstr ""
3922
3923-#. module: esale_osc
3924 #: help:sale.order,send_web_email:0
3925+#. module: esale_osc
3926 msgid "Click if you want Sending comments to customer from web. Requires modifying .php procedure"
3927 msgstr ""
3928
3929-#. module: esale_osc
3930 #: help:esale.oscom.web,intermediate:0
3931+#. module: esale_osc
3932 msgid "Select intermediate status for Osc downloaded Orders"
3933 msgstr ""
3934
3935+#: view:sale.order:0
3936 #. module: esale_osc
3937-#: view:sale.order:0
3938 msgid "Reference"
3939 msgstr ""
3940
3941-#. module: esale_osc
3942 #: help:sale.order,additional_info:0
3943+#. module: esale_osc
3944 msgid "Include any additional info you need internaly include on order"
3945 msgstr ""
3946
3947-#. module: esale_osc
3948 #: constraint:product.category:0
3949+#. module: esale_osc
3950 msgid "Error ! You can not create recursive categories."
3951 msgstr ""
3952
3953+#: view:esale.oscom.category:0
3954 #. module: esale_osc
3955-#: view:esale.oscom.category:0
3956 msgid "taxes"
3957 msgstr ""
3958
3959+#: view:esale.oscom.paytype:0
3960 #. module: esale_osc
3961-#: view:esale.oscom.paytype:0
3962 msgid "Payment types mapping"
3963 msgstr ""
3964
3965-#. module: esale_osc
3966 #: model:ir.ui.menu,name:esale_osc.menu_esale_oscom_root
3967+#. module: esale_osc
3968 msgid "Internet Sales"
3969 msgstr ""
3970
3971-#. module: esale_osc
3972 #: model:ir.model,name:esale_osc.model_product_manufacturer
3973+#. module: esale_osc
3974 msgid "Product Manufacturer that produces the product"
3975 msgstr ""
3976
3977+#: view:sale.order:0
3978 #. module: esale_osc
3979-#: view:sale.order:0
3980 msgid "OsCommerce"
3981 msgstr ""
3982
3983-#. module: esale_osc
3984 #: field:esale.oscom.status,language_id:0
3985+#. module: esale_osc
3986 msgid "Language Id"
3987 msgstr ""
3988
3989-#. module: esale_osc
3990 #: wizard_button:esale.oscom.products,init,end:0
3991 #: wizard_button:esale.oscom.saleorders,init,end:0
3992 #: wizard_button:esale.oscom.select.products,init,end:0
3993 #: wizard_button:esale.oscom.select.stocks,init,end:0
3994 #: wizard_button:esale.oscom.stocks,init,end:0
3995+#. module: esale_osc
3996 msgid "End"
3997 msgstr ""
3998
3999-#. module: esale_osc
4000 #: model:ir.module.module,shortdesc:esale_osc.module_meta_information
4001+#. module: esale_osc
4002 msgid "OScommerce Interface / ZenCart"
4003 msgstr ""
4004
4005-#. module: esale_osc
4006 #: wizard_view:esale.oscom.products,init:0
4007 #: wizard_view:esale.oscom.select.products,init:0
4008+#. module: esale_osc
4009 msgid "Products exported"
4010 msgstr ""
4011
4012-#. module: esale_osc
4013 #: field:esale.oscom.lang,language_id:0
4014+#. module: esale_osc
4015 msgid "OpenERP language"
4016 msgstr ""
4017
4018+#: view:product.product:0
4019 #. module: esale_osc
4020-#: view:product.product:0
4021 msgid "Special price information"
4022 msgstr ""
4023
4024-#. module: esale_osc
4025 #: field:sale.order,tracking_number:0
4026+#. module: esale_osc
4027 msgid "Num tracking"
4028 msgstr ""
4029
4030+#: selection:product.product,spe_price_status:0
4031 #. module: esale_osc
4032-#: selection:product.product,spe_price_status:0
4033 msgid "Off"
4034 msgstr ""
4035
4036-#. module: esale_osc
4037 #: model:ir.module.module,description:esale_osc.module_meta_information
4038-msgid "OSCommerce (Zencart) eCommerce interface synchronisation.\n"
4039+#. module: esale_osc
4040+msgid ""
4041+"OSCommerce (Zencart) eCommerce interface synchronisation.\n"
4042 "\n"
4043 "Syncro Oscommerce to Openerp\n"
4044 " 1. Import/upgrade categories.\n"
4045@@ -261,462 +256,461 @@
4046 "Developed by Tiny, Axelor, Zikzakmedia and Ana Juaristi"
4047 msgstr ""
4048
4049-#. module: esale_osc
4050 #: wizard_view:esale.oscom.saleorders,init:0
4051+#. module: esale_osc
4052 msgid "Sale orders succesfully imported"
4053 msgstr ""
4054
4055-#. module: esale_osc
4056 #: wizard_field:esale.oscom.products,init,prod_update:0
4057 #: wizard_field:esale.oscom.select.products,init,prod_update:0
4058+#. module: esale_osc
4059 msgid "Updated products"
4060 msgstr ""
4061
4062-#. module: esale_osc
4063 #: help:sale.order,volume:0
4064+#. module: esale_osc
4065 msgid "Include volume of packages to send"
4066 msgstr ""
4067
4068-#. module: esale_osc
4069 #: wizard_field:esale.oscom.products,init,prod_new:0
4070 #: wizard_field:esale.oscom.select.products,init,prod_new:0
4071+#. module: esale_osc
4072 msgid "New products"
4073 msgstr ""
4074
4075+#: view:esale.oscom.web:0
4076 #. module: esale_osc
4077-#: view:esale.oscom.web:0
4078 msgid "Active Products"
4079 msgstr ""
4080
4081+#: selection:esale.oscom.paytype,paytyp:0
4082 #. module: esale_osc
4083-#: selection:esale.oscom.paytype,paytyp:0
4084 msgid "SO in State Draft"
4085 msgstr ""
4086
4087-#. module: esale_osc
4088 #: field:esale.oscom.web,date_download_from:0
4089+#. module: esale_osc
4090 msgid "Date Download From"
4091 msgstr ""
4092
4093-#. module: esale_osc
4094 #: help:sale.order,status_comment:0
4095+#. module: esale_osc
4096 msgid "Write a comment to include on Osc order. It will be uploaded to Osc Web on changing actual osc status"
4097 msgstr ""
4098
4099+#: view:esale.oscom.web:0
4100 #. module: esale_osc
4101-#: view:esale.oscom.web:0
4102 msgid "General Informations"
4103 msgstr ""
4104
4105-#. module: esale_osc
4106 #: constraint:ir.ui.view:0
4107+#. module: esale_osc
4108 msgid "Invalid XML for View Architecture!"
4109 msgstr ""
4110
4111+#: constraint:product.template:0
4112 #. module: esale_osc
4113-#: constraint:product.template:0
4114 msgid "Error: UOS must be in a different category than the UOM"
4115 msgstr ""
4116
4117+#: view:esale.oscom.web:0
4118 #. module: esale_osc
4119-#: view:esale.oscom.web:0
4120 msgid "Proceed with the mappings before adding products!"
4121 msgstr ""
4122
4123-#. module: esale_osc
4124 #: model:ir.model,name:esale_osc.model_esale_oscom_tax
4125+#. module: esale_osc
4126 msgid "esale_oscom Tax"
4127 msgstr ""
4128
4129-#. module: esale_osc
4130 #: field:sale.order,esale_oscom_id:0
4131+#. module: esale_osc
4132 msgid "esale_oscom Id"
4133 msgstr ""
4134
4135-#. module: esale_osc
4136 #: help:sale.order,tracking_number:0
4137+#. module: esale_osc
4138 msgid "Include order trucking number given by carrier"
4139 msgstr ""
4140
4141-#. module: esale_osc
4142 #: field:sale.order,update_comment:0
4143+#. module: esale_osc
4144 msgid "Update Comment"
4145 msgstr ""
4146
4147-#. module: esale_osc
4148 #: model:ir.ui.menu,name:esale_osc.menu_action_esale_oscom_saleorder_new
4149+#. module: esale_osc
4150 msgid "New order"
4151 msgstr ""
4152
4153+#: view:esale.oscom.web:0
4154 #. module: esale_osc
4155-#: view:esale.oscom.web:0
4156 msgid "Payment types Mapping"
4157 msgstr ""
4158
4159+#: view:esale.oscom.web:0
4160 #. module: esale_osc
4161-#: view:esale.oscom.web:0
4162 msgid "OScommerce Web Shop"
4163 msgstr ""
4164
4165-#. module: esale_osc
4166 #: model:ir.ui.menu,name:esale_osc.menu_action_saleorder_tree_progress
4167+#. module: esale_osc
4168 msgid "In progress"
4169 msgstr ""
4170
4171-#. module: esale_osc
4172 #: model:ir.ui.menu,name:esale_osc.menu_esale_oscom_saleorders
4173+#. module: esale_osc
4174 msgid "Import sale orders from all OScommerce web shops"
4175 msgstr ""
4176
4177-#. module: esale_osc
4178 #: help:esale.oscom.web,esale_account_id:0
4179+#. module: esale_osc
4180 msgid "Payment account for web invoices."
4181 msgstr ""
4182
4183-#. module: esale_osc
4184 #: model:ir.ui.menu,name:esale_osc.menu_action_esale_oscom_invoices
4185+#. module: esale_osc
4186 msgid "Invoices"
4187 msgstr ""
4188
4189-#. module: esale_osc
4190 #: model:ir.ui.menu,name:esale_osc.menu_action_esale_oscom_saleorder
4191+#. module: esale_osc
4192 msgid "Web sale orders"
4193 msgstr ""
4194
4195-#. module: esale_osc
4196 #: field:esale.oscom.web,product_ids:0
4197+#. module: esale_osc
4198 msgid "Web products"
4199 msgstr ""
4200
4201-#. module: esale_osc
4202 #: help:sale.order,update_comment:0
4203+#. module: esale_osc
4204 msgid "Click if you want to Update comments on order"
4205 msgstr ""
4206
4207+#: selection:esale.oscom.web,price_type:0
4208 #. module: esale_osc
4209-#: selection:esale.oscom.web,price_type:0
4210 msgid "Taxed price"
4211 msgstr ""
4212
4213-#. module: esale_osc
4214 #: model:ir.model,name:esale_osc.model_esale_oscom_category
4215+#. module: esale_osc
4216 msgid "esale_oscom Category"
4217 msgstr ""
4218
4219-#. module: esale_osc
4220 #: model:ir.model,name:esale_osc.model_esale_oscom_status
4221+#. module: esale_osc
4222 msgid "esale_oscom Status"
4223 msgstr ""
4224
4225+#: view:esale.oscom.web:0
4226 #. module: esale_osc
4227-#: view:esale.oscom.web:0
4228 msgid "Languages Mapping"
4229 msgstr ""
4230
4231-#. module: esale_osc
4232 #: field:sale.order,volume:0
4233+#. module: esale_osc
4234 msgid "Volum"
4235 msgstr ""
4236
4237-#. module: esale_osc
4238 #: field:sale.order,number_of_packages:0
4239+#. module: esale_osc
4240 msgid "Num pack"
4241 msgstr ""
4242
4243+#: view:esale.oscom.web:0
4244 #. module: esale_osc
4245-#: view:esale.oscom.web:0
4246 msgid "Categories Mapping"
4247 msgstr ""
4248
4249-#. module: esale_osc
4250 #: model:ir.ui.menu,name:esale_osc.menu_action_oscom_invoice_open_tree
4251+#. module: esale_osc
4252 msgid "Opened"
4253 msgstr ""
4254
4255+#: selection:esale.oscom.paytype,paytyp:0
4256 #. module: esale_osc
4257-#: selection:esale.oscom.paytype,paytyp:0
4258 msgid "Invoice Payed"
4259 msgstr ""
4260
4261+#: constraint:product.template:0
4262 #. module: esale_osc
4263-#: constraint:product.template:0
4264 msgid "Error: The default UOM and the purchase UOM must be in the same category."
4265 msgstr ""
4266
4267-#. module: esale_osc
4268 #: field:esale.oscom.web,language_ids:0
4269+#. module: esale_osc
4270 msgid "Languages"
4271 msgstr ""
4272
4273-#. module: esale_osc
4274 #: model:ir.ui.menu,name:esale_osc.menu_action_oscom_invoice_draft_tree
4275+#. module: esale_osc
4276 msgid "Draft"
4277 msgstr ""
4278
4279-#. module: esale_osc
4280 #: wizard_view:esale.oscom.products,init:0
4281 #: wizard_view:esale.oscom.select.products,init:0
4282+#. module: esale_osc
4283 msgid "Product Export"
4284 msgstr ""
4285
4286-#. module: esale_osc
4287 #: field:esale.oscom.web,esale_account_id:0
4288+#. module: esale_osc
4289 msgid "Dest. account"
4290 msgstr ""
4291
4292-#. module: esale_osc
4293 #: field:esale.oscom.tax,tax_id:0
4294+#. module: esale_osc
4295 msgid "OpenERP tax"
4296 msgstr ""
4297
4298-#. module: esale_osc
4299 #: model:ir.ui.menu,name:esale_osc.menu_action_oscom_invoice_proforma_tree
4300+#. module: esale_osc
4301 msgid "PRO-FORMA"
4302 msgstr ""
4303
4304+#: selection:esale.oscom.paytype,paytyp:0
4305 #. module: esale_osc
4306-#: selection:esale.oscom.paytype,paytyp:0
4307 msgid "Invoice Draft"
4308 msgstr ""
4309
4310-#. module: esale_osc
4311 #: view:esale.oscom.web:0
4312 #: field:product.product,spe_price_status:0
4313+#. module: esale_osc
4314 msgid "Status"
4315 msgstr ""
4316
4317-#. module: esale_osc
4318 #: field:product.product,date_available:0
4319+#. module: esale_osc
4320 msgid "Available Date"
4321 msgstr ""
4322
4323+#: selection:esale.oscom.paytype,paytyp:0
4324 #. module: esale_osc
4325-#: selection:esale.oscom.paytype,paytyp:0
4326 msgid "SO Confirmed"
4327 msgstr ""
4328
4329-#. module: esale_osc
4330 #: field:esale.oscom.paytype,journal_id:0
4331+#. module: esale_osc
4332 msgid "OpenERP payment journal"
4333 msgstr ""
4334
4335-#. module: esale_osc
4336 #: wizard_field:esale.oscom.products,init,prod_delete:0
4337 #: wizard_field:esale.oscom.select.products,init,prod_delete:0
4338+#. module: esale_osc
4339 msgid "Deleted products"
4340 msgstr ""
4341
4342-#. module: esale_osc
4343 #: help:sale.order,shipping_agency:0
4344+#. module: esale_osc
4345 msgid " Include Carrier to delivery order with"
4346 msgstr ""
4347
4348-#. module: esale_osc
4349 #: help:sale.order,orders_status_id:0
4350+#. module: esale_osc
4351 msgid "Indicates the actual status of order on Osc Web"
4352 msgstr ""
4353
4354+#: view:esale.oscom.lang:0
4355 #. module: esale_osc
4356-#: view:esale.oscom.lang:0
4357 msgid "Language mapping"
4358 msgstr ""
4359
4360+#: view:esale.oscom.web:0
4361 #. module: esale_osc
4362-#: view:esale.oscom.web:0
4363 msgid "Import Taxes"
4364 msgstr ""
4365
4366-#. module: esale_osc
4367 #: view:esale.oscom.paytype:0
4368 #: view:esale.oscom.status:0
4369 #: field:esale.oscom.web,pay_typ_ids:0
4370+#. module: esale_osc
4371 msgid "Payment types"
4372 msgstr ""
4373
4374-#. module: esale_osc
4375 #: field:esale.oscom.web,active:0
4376+#. module: esale_osc
4377 msgid "Active"
4378 msgstr ""
4379
4380-#. module: esale_osc
4381 #: field:product.product,product_picture:0
4382+#. module: esale_osc
4383 msgid "Product Picture"
4384 msgstr ""
4385
4386-#. module: esale_osc
4387 #: field:esale.oscom.web,status_ids:0
4388+#. module: esale_osc
4389 msgid "Osc Status"
4390 msgstr ""
4391
4392-#. module: esale_osc
4393 #: view:product.manufacturer:0
4394+#. module: esale_osc
4395 msgid "Manufacturer"
4396 msgstr ""
4397
4398-#. module: esale_osc
4399 #: field:product.product,exp_date:0
4400+#. module: esale_osc
4401 msgid "Expiry date"
4402 msgstr ""
4403
4404+#: view:esale.oscom.web:0
4405 #. module: esale_osc
4406-#: view:esale.oscom.web:0
4407 msgid "esale_oscom Shop Info"
4408 msgstr ""
4409
4410+#: view:esale.oscom.lang:0
4411 #. module: esale_osc
4412-#: view:esale.oscom.lang:0
4413 msgid "Language"
4414 msgstr ""
4415
4416+#: view:esale.oscom.web:0
4417 #. module: esale_osc
4418-#: view:esale.oscom.web:0
4419 msgid "Import Payment Methods"
4420 msgstr ""
4421
4422-#. module: esale_osc
4423 #: field:esale.oscom.product,product_id:0
4424+#. module: esale_osc
4425 msgid "OpenERP product"
4426 msgstr ""
4427
4428-#. module: esale_osc
4429 #: model:ir.ui.menu,name:esale_osc.menu_action_esale_oscom_web
4430+#. module: esale_osc
4431 msgid "Websites"
4432 msgstr ""
4433
4434-#. module: esale_osc
4435 #: field:esale.oscom.product,esale_oscom_id:0
4436+#. module: esale_osc
4437 msgid "OScommerce product Id"
4438 msgstr ""
4439
4440-#. module: esale_osc
4441 #: help:esale.oscom.web,date_download_from:0
4442+#. module: esale_osc
4443 msgid "Specify date since you want to download modified or new products"
4444 msgstr ""
4445
4446+#: view:esale.oscom.web:0
4447 #. module: esale_osc
4448-#: view:esale.oscom.web:0
4449 msgid "Import Categories"
4450 msgstr ""
4451
4452-#. module: esale_osc
4453 #: field:esale.oscom.category,category_id:0
4454+#. module: esale_osc
4455 msgid "OpenERP category"
4456 msgstr ""
4457
4458+#: view:product.product:0
4459 #. module: esale_osc
4460-#: view:product.product:0
4461 msgid "Link to Oscommerce"
4462 msgstr ""
4463
4464-#. module: esale_osc
4465 #: field:esale.oscom.paytype,payment_id:0
4466+#. module: esale_osc
4467 msgid "OpenERP payment"
4468 msgstr ""
4469
4470-#. module: esale_osc
4471 #: model:product.template,name:esale_osc.product_product_discount_coupon_product_template
4472+#. module: esale_osc
4473 msgid "Discount Coupon"
4474 msgstr ""
4475
4476-#. module: esale_osc
4477 #: field:esale.oscom.web,intermediate:0
4478+#. module: esale_osc
4479 msgid "Intermediate Status"
4480 msgstr ""
4481
4482-#. module: esale_osc
4483 #: model:ir.ui.menu,name:esale_osc.menu_action_saleorder_tree_draft
4484+#. module: esale_osc
4485 msgid "Request for quotation"
4486 msgstr ""
4487
4488-#. module: esale_osc
4489 #: model:ir.ui.menu,name:esale_osc.menu_action_saleorder_tree_manual
4490+#. module: esale_osc
4491 msgid "Waiting invoice"
4492 msgstr ""
4493
4494-#. module: esale_osc
4495 #: model:product.template,name:esale_osc.product_product_cash_delivery_product_template
4496+#. module: esale_osc
4497 msgid "Cash On Delivery"
4498 msgstr ""
4499
4500+#: selection:product.product,in_out_stock:0
4501 #. module: esale_osc
4502-#: selection:product.product,in_out_stock:0
4503 msgid "Out Stock"
4504 msgstr ""
4505
4506-#. module: esale_osc
4507 #: model:product.category,name:esale_osc.cat_shipping_cost
4508 #: model:product.template,name:esale_osc.product_product_shipping_Cost_product_template
4509+#. module: esale_osc
4510 msgid "Shipping Cost"
4511 msgstr ""
4512
4513-#. module: esale_osc
4514 #: model:ir.model,name:esale_osc.model_esale_oscom_lang
4515+#. module: esale_osc
4516 msgid "esale_oscom Language"
4517 msgstr ""
4518
4519-#. module: esale_osc
4520 #: field:product.product,spe_price:0
4521+#. module: esale_osc
4522 msgid "Special price"
4523 msgstr ""
4524
4525+#: view:sale.order:0
4526 #. module: esale_osc
4527-#: view:sale.order:0
4528 msgid "Sales Orders"
4529 msgstr ""
4530
4531-#. module: esale_osc
4532 #: constraint:ir.model:0
4533+#. module: esale_osc
4534 msgid "The Object name must start with x_ and not contain any special character !"
4535 msgstr ""
4536
4537-#. module: esale_osc
4538 #: field:sale.order,shipping_agency:0
4539+#. module: esale_osc
4540 msgid "Carrier Partner"
4541 msgstr ""
4542
4543+#: view:esale.oscom.product:0
4544 #. module: esale_osc
4545-#: view:esale.oscom.product:0
4546 msgid "Product Information"
4547 msgstr ""
4548
4549-#. module: esale_osc
4550 #: view:esale.oscom.category:0
4551 #: field:esale.oscom.web,category_ids:0
4552+#. module: esale_osc
4553 msgid "Categories"
4554 msgstr ""
4555
4556+#: view:product.product:0
4557 #. module: esale_osc
4558-#: view:product.product:0
4559 msgid "Other information"
4560 msgstr ""
4561
4562+#: view:esale.oscom.status:0
4563 #. module: esale_osc
4564-#: view:esale.oscom.status:0
4565 msgid "Osc status"
4566 msgstr ""
4567
4568-#. module: esale_osc
4569 #: field:esale.oscom.web,price_type:0
4570+#. module: esale_osc
4571 msgid "Price type"
4572 msgstr ""
4573
4574+#: view:esale.oscom.product:0
4575 #. module: esale_osc
4576-#: view:esale.oscom.product:0
4577 msgid "Product"
4578 msgstr ""
4579
4580-#. module: esale_osc
4581 #: field:sale.order,pay_met_title:0
4582+#. module: esale_osc
4583 msgid "Payment Method"
4584 msgstr ""
4585
4586-#. module: esale_osc
4587 #: wizard_view:esale.oscom.select.stocks,init:0
4588 #: wizard_view:esale.oscom.stocks,init:0
4589+#. module: esale_osc
4590 msgid "Stock Update"
4591 msgstr ""
4592
4593-#. module: esale_osc
4594 #: field:esale.oscom.category,esale_oscom_id:0
4595 #: field:esale.oscom.lang,esale_oscom_id:0
4596 #: field:esale.oscom.paytype,esale_oscom_id:0
4597@@ -724,76 +718,76 @@
4598 #: field:esale.oscom.tax,esale_oscom_id:0
4599 #: field:res.partner,esale_oscom_id:0
4600 #: field:res.partner.address,esale_oscom_id:0
4601+#. module: esale_osc
4602 msgid "OScommerce Id"
4603 msgstr ""
4604
4605-#. module: esale_osc
4606 #: field:sale.order,orders_status:0
4607+#. module: esale_osc
4608 msgid "Osc Status Inic"
4609 msgstr ""
4610
4611+#: view:esale.oscom.web:0
4612 #. module: esale_osc
4613-#: view:esale.oscom.web:0
4614 msgid "Import and create/update Categories"
4615 msgstr ""
4616
4617+#: view:esale.oscom.web:0
4618 #. module: esale_osc
4619-#: view:esale.oscom.web:0
4620 msgid "Import all products from OSCommerce"
4621 msgstr ""
4622
4623-#. module: esale_osc
4624 #: field:sale.order,send_web_email:0
4625+#. module: esale_osc
4626 msgid "Send web E-mail"
4627 msgstr ""
4628
4629-#. module: esale_osc
4630 #: field:sale.order,additional_info:0
4631+#. module: esale_osc
4632 msgid "Aditional Info"
4633 msgstr ""
4634
4635+#: view:sale.order:0
4636 #. module: esale_osc
4637-#: view:sale.order:0
4638 msgid "Options selected will be applied on changing osc order status"
4639 msgstr ""
4640
4641-#. module: esale_osc
4642 #: help:sale.order,number_of_packages:0
4643+#. module: esale_osc
4644 msgid "Include number of packages to send"
4645 msgstr ""
4646
4647-#. module: esale_osc
4648 #: field:esale.oscom.category,name:0
4649 #: field:esale.oscom.lang,name:0
4650 #: field:esale.oscom.paytype,name:0
4651 #: field:esale.oscom.product,name:0
4652 #: field:esale.oscom.web,name:0
4653 #: field:product.manufacturer,name:0
4654+#. module: esale_osc
4655 msgid "Name"
4656 msgstr ""
4657
4658+#: selection:esale.oscom.paytype,paytyp:0
4659 #. module: esale_osc
4660-#: selection:esale.oscom.paytype,paytyp:0
4661 msgid "Invoice Confirmed"
4662 msgstr ""
4663
4664-#. module: esale_osc
4665 #: field:esale.oscom.paytype,paytyp:0
4666+#. module: esale_osc
4667 msgid "Payment type"
4668 msgstr ""
4669
4670-#. module: esale_osc
4671 #: view:esale.oscom.tax:0
4672 #: field:esale.oscom.web,tax_ids:0
4673+#. module: esale_osc
4674 msgid "Taxes"
4675 msgstr ""
4676
4677-#. module: esale_osc
4678 #: field:esale.oscom.web,shop_id:0
4679+#. module: esale_osc
4680 msgid "Sale shop"
4681 msgstr ""
4682
4683-#. module: esale_osc
4684 #: field:account.invoice,esale_oscom_web:0
4685 #: field:esale.oscom.category,web_id:0
4686 #: field:esale.oscom.lang,web_id:0
4687@@ -802,52 +796,88 @@
4688 #: field:esale.oscom.status,web_id:0
4689 #: field:esale.oscom.tax,web_id:0
4690 #: field:sale.order,esale_oscom_web:0
4691+#. module: esale_osc
4692 msgid "Website"
4693 msgstr ""
4694
4695+#: view:sale.order:0
4696 #. module: esale_osc
4697-#: view:sale.order:0
4698 msgid "Os Commerce Information"
4699 msgstr ""
4700
4701-#. module: esale_osc
4702 #: wizard_view:esale.oscom.select.stocks,init:0
4703 #: wizard_view:esale.oscom.stocks,init:0
4704+#. module: esale_osc
4705 msgid "Stock succesfully updated"
4706 msgstr ""
4707
4708+#: view:esale.oscom.tax:0
4709 #. module: esale_osc
4710-#: view:esale.oscom.tax:0
4711 msgid "Taxes mapping"
4712 msgstr ""
4713
4714-#. module: esale_osc
4715 #: field:esale.oscom.status,name:0
4716+#. module: esale_osc
4717 msgid "Status name"
4718 msgstr ""
4719
4720+#: selection:esale.oscom.web,price_type:0
4721 #. module: esale_osc
4722-#: selection:esale.oscom.web,price_type:0
4723 msgid "Untaxed price"
4724 msgstr ""
4725
4726-#. module: esale_osc
4727 #: help:sale.order,orders_status:0
4728+#. module: esale_osc
4729 msgid "Indicates the initial status of order on Osc Web"
4730 msgstr ""
4731
4732+#: constraint:product.product:0
4733 #. module: esale_osc
4734-#: constraint:product.product:0
4735 msgid "Error: Invalid ean code"
4736 msgstr ""
4737
4738-#. module: esale_osc
4739 #: field:sale.order,status_comment:0
4740+#. module: esale_osc
4741 msgid "Status Comment"
4742 msgstr ""
4743
4744-#. module: esale_osc
4745 #: field:product.product,in_out_stock:0
4746+#. module: esale_osc
4747 msgid "In/Out Stock"
4748 msgstr ""
4749
4750+#. module: esale_osc
4751+msgid ""
4752+"Default product named \'Shipping Cost\' will be used.\n"
4753+"In case it doesn\'t exist, please create it"
4754+msgstr ""
4755+
4756+#. module: esale_osc
4757+#: field:esale.oscom.web,admin_user:0
4758+msgid "Admin User"
4759+msgstr ""
4760+
4761+#. module: esale_osc
4762+#: field:esale.oscom.web,admin_pass:0
4763+msgid "Admin Pass"
4764+msgstr ""
4765+
4766+#. module: esale_osc
4767+#: field:esale.oscom.web,default_partner_category:0
4768+msgid "Customers partner category"
4769+msgstr ""
4770+
4771+#. module: esale_osc
4772+#: field:esale.oscom.web,download_number:30
4773+msgid "Download number"
4774+msgstr ""
4775+
4776+#. module: esale_osc
4777+#: field:esale.oscom.web,override_products_data:0
4778+msgid "Override Products Data"
4779+msgstr ""
4780+
4781+#. module: esale_osc
4782+#: help:esale.oscom.web,override_products_data:0
4783+msgid "Click if you want to Update products data on the shop with changes made in openerp."
4784+msgstr ""
4785\ No newline at end of file
4786
4787=== modified file 'esale_osc/wizard/wizard_esale_oscom_update_select_stocks.py'
4788--- esale_osc/wizard/wizard_esale_oscom_update_select_stocks.py 2010-01-21 09:33:17 +0000
4789+++ esale_osc/wizard/wizard_esale_oscom_update_select_stocks.py 2010-07-21 10:31:39 +0000
4790@@ -1,3 +1,4 @@
4791+# -*- coding: utf-8 -*-
4792 # -*- encoding: utf-8 -*-
4793 ##############################################################################
4794 #