272 |
else: |
else: |
273 |
productBlock.commit() |
productBlock.commit() |
274 |
</trigger> |
</trigger> |
275 |
|
|
276 |
|
|
277 |
<trigger name="productDeleteTrigger" type="NAMED"> |
<trigger name="productDeleteTrigger" type="NAMED"> |
278 |
import hack |
import hack |
282 |
<trigger name="productRollbackTrigger" type="NAMED"> |
<trigger name="productRollbackTrigger" type="NAMED"> |
283 |
import hack |
import hack |
284 |
hack.rollback(productBlock) |
hack.rollback(productBlock) |
|
hack.rollback(showDescriptionsBlock) |
|
285 |
</trigger> |
</trigger> |
286 |
|
|
287 |
<trigger name="askForChangesTrigger" type="NAMED"> |
<trigger name="askForChangesTrigger" type="NAMED"> |
325 |
productBlock.productIdEntry = ("%s" % productResultBlock.productIdREntry) |
productBlock.productIdEntry = ("%s" % productResultBlock.productIdREntry) |
326 |
productBlock.processQuery() |
productBlock.processQuery() |
327 |
</trigger> |
</trigger> |
328 |
<block name="productSearchBlock" datasource="searchDataSource" transparentBlock=""> |
<block name="productSearchBlock" datasource="searchDataSource" transparentBlock="y"> |
329 |
<label text="Ingrese los datos del producto a buscar:" x="1" y="1"/> |
<label text="Ingrese los datos del producto a buscar:" x="1" y="1"/> |
330 |
<label text="el Nombre (canónico):" x="1" y="2"/> |
<label text="el Nombre (canónico):" x="1" y="2"/> |
331 |
<entry name="searchNameEntry" x="23" y="2" width="35"/> |
<entry name="searchNameEntry" x="23" y="2" width="35"/> |
337 |
name="searchBtn" height="1"/> |
name="searchBtn" height="1"/> |
338 |
<entry name="funnyLabel" width="40" x="40" y="4" style="label"/> |
<entry name="funnyLabel" width="40" x="40" y="4" style="label"/> |
339 |
</block> |
</block> |
340 |
<block name="productResultBlock" datasource="productResultDataSource"> |
<block name="productResultBlock" datasource="productResultDataSource" transparentBlock="y"> |
341 |
<entry name="productIdREntry" field="product.id" hidden="y" x="1" y="1" width="20" /> |
<entry name="productIdREntry" field="product.id" hidden="y" x="1" y="1" width="20" /> |
342 |
<label text="Resultado" x="1" y="4"/> |
<label text="Resultado" x="1" y="4"/> |
343 |
<entry name="codeListEntry" field="_product_code_data.code" |
<entry name="codeListEntry" field="_product_code_data.code" |
370 |
x="1" y="1" hidden="y"/> |
x="1" y="1" hidden="y"/> |
371 |
</block> |
</block> |
372 |
<trigger type="Pre-Focusin"> |
<trigger type="Pre-Focusin"> |
373 |
showDescriptionsBlock.newRecord () |
if str(productBlock.product_classificationIdEntry)!='': |
|
|
|
|
if str(productBlock.product_classificationEntry)!='': |
|
374 |
searchingProductClassificationBlock.processRollback () |
searchingProductClassificationBlock.processRollback () |
375 |
searchingProductClassificationBlock.initQuery () |
searchingProductClassificationBlock.initQuery () |
376 |
searchingProductClassificationBlock.idEntry= str(productBlock.product_classificationEntry) |
searchingProductClassificationBlock.idEntry= str(productBlock.product_classificationIdEntry) |
377 |
searchingProductClassificationBlock.processQuery () |
searchingProductClassificationBlock.processQuery () |
378 |
showDescriptionsBlock.classificationEntry= str(searchingProductClassificationBlock.nameEntry) |
productBlock.product_classificationNameEntry= str(searchingProductClassificationBlock.nameEntry) |
379 |
else: |
else: |
380 |
showDescriptionsBlock.classificationEntry= '' |
productBlock.product_classificationEntry= '' |
381 |
|
|
382 |
if str(productBlock.physical_structureEntry)!='': |
if str(productBlock.physical_structureIdEntry)!='': |
383 |
searchingPhysicalStructureBlock.processRollback () |
searchingPhysicalStructureBlock.processRollback () |
384 |
searchingPhysicalStructureBlock.initQuery () |
searchingPhysicalStructureBlock.initQuery () |
385 |
searchingPhysicalStructureBlock.idEntry= str(productBlock.physical_structureEntry) |
searchingPhysicalStructureBlock.idEntry= str(productBlock.physical_structureIdEntry) |
386 |
searchingPhysicalStructureBlock.processQuery () |
searchingPhysicalStructureBlock.processQuery () |
387 |
showDescriptionsBlock.storeEntry= str(searchingPhtsicalStructureBlock.nameEntry) |
productBlock.physical_structureNameEntry= str(searchingPhtsicalStructureBlock.nameEntry) |
388 |
else: |
else: |
389 |
showDescriptionsBlock.storeEntry= '' |
productBlock.physical_structureEntry= '' |
390 |
|
|
391 |
if str(productBlock.countryEntry)!='': |
if str(productBlock.countryIdEntry)!='': |
392 |
searchingCountryBlock.processRollback () |
searchingCountryBlock.processRollback () |
393 |
searchingCountryBlock.initQuery () |
searchingCountryBlock.initQuery () |
394 |
searchingCountryBlock.idEntry= str(productBlock.countryEntry) |
searchingCountryBlock.idEntry= str(productBlock.countryIdEntry) |
395 |
searchingCountryBlock.processQuery () |
searchingCountryBlock.processQuery () |
396 |
showDescriptionsBlock.countryCodeEntry= str(searchingCountryBlock.iso3Entry) |
productBlock.countryIso3Entry= str(searchingCountryBlock.iso3Entry) |
397 |
showDescriptionsBlock.countryNameEntry= str(searchingCountryBlock.nameEntry) |
productBlock.countryNameEntry= str(searchingCountryBlock.nameEntry) |
398 |
else: |
else: |
399 |
showDescriptionsBlock.countryCodeEntry= '' |
productBlock.countryIso3Entry= '' |
400 |
showDescriptionsBlock.countryNameEntry= '' |
productBlock.countryNameEntry= '' |
|
|
|
|
showDescriptionsBlock.commit () |
|
401 |
</trigger> |
</trigger> |
402 |
<!-- new_schema_end --> |
<!-- new_schema_end --> |
403 |
|
|
404 |
<trigger type="pre-Focusout" src="askForChangesTrigger"/> |
<trigger type="pre-Focusout" src="askForChangesTrigger"/> |
405 |
<box label="Datos" x="0" y="0" height="20" width="70"> |
<box label="Datos" x="0" y="0" height="20" width="70"> |
406 |
<block name="productBlock" datasource="productDataSource" restrictInsert="y"> |
<block name="productBlock" datasource="productDataSource" restrictInsert="y" transparentBlock="y"> |
407 |
<entry x="0" y="0" name="priceTypeEntry" |
<entry x="0" y="0" name="priceTypeEntry" |
408 |
field="_price_data.price_type" hidden="y"/> |
field="_price_data.price_type" hidden="y"/> |
409 |
<entry x="0" y="0" name="productCodeTypeEntry" |
<entry x="0" y="0" name="productCodeTypeEntry" |
420 |
</trigger> |
</trigger> |
421 |
</button> |
</button> |
422 |
<label text="Clasificación:" x="1" y="3"/> |
<label text="Clasificación:" x="1" y="3"/> |
423 |
<entry name="product_classificationEntry" field="_product_data.product_classification" |
<entry name="product_classificationIdEntry" field="_product_data.product_classification" |
424 |
x="1" y="1" hidden="y"/> |
x="1" y="1" hidden="y"/> |
425 |
<!-- new_schema_begin --> |
<!-- new_schema_begin --> |
426 |
|
<entry name="product_classificationNameEntry" |
427 |
|
x="2" y="4" width="40"/> |
428 |
<button name="searchClassificationButton" label="Buscar" trigger="searchClassificationTrigger" |
<button name="searchClassificationButton" label="Buscar" trigger="searchClassificationTrigger" |
429 |
x="42" y="4" width="10" height="1"> |
x="42" y="4" width="10" height="1"> |
430 |
<trigger name="searchClassificationTrigger" type="NAMED"> |
<trigger name="searchClassificationTrigger" type="NAMED"> |
439 |
def setClassification (recNo): |
def setClassification (recNo): |
440 |
if recNo>=0: |
if recNo>=0: |
441 |
searchingProductClassificationBlock.jumpRecord (recNo) |
searchingProductClassificationBlock.jumpRecord (recNo) |
442 |
productBlock.product_classificationEntry= str(searchingProductClassificationBlock.idEntry) |
productBlock.product_classificationIdEntry= str(searchingProductClassificationBlock.idEntry) |
443 |
showDescriptionsBlock.classificationEntry= str(searchingProductClassificationBlock.nameEntry) |
productBlock.product_classificationNameEntry= str(searchingProductClassificationBlock.nameEntry) |
444 |
|
|
445 |
# look for the name... |
# look for the name... |
446 |
searchingProductClassificationBlock.processRollback () |
searchingProductClassificationBlock.processRollback () |
447 |
searchingProductClassificationBlock.initQuery () |
searchingProductClassificationBlock.initQuery () |
448 |
searchingProductClassificationBlock.nameEntry= str(showDescriptionsBlock.classificationEntry)+'%' |
searchingProductClassificationBlock.nameEntry= str(productBlock.product_classificationNameEntry)+'%' |
449 |
searchingProductClassificationBlock.processQuery () |
searchingProductClassificationBlock.processQuery () |
450 |
|
|
451 |
# are there too much results? |
# are there too much results? |
456 |
'data': searchingProductClassificationBlock, |
'data': searchingProductClassificationBlock, |
457 |
'callback': setClassification |
'callback': setClassification |
458 |
}) |
}) |
459 |
|
setStatusText('Ok') |
460 |
elif resultCount==1: |
elif resultCount==1: |
461 |
setClassification (0) |
setClassification (0) |
462 |
|
setStatusText('Ok') |
463 |
|
else: |
464 |
|
setStatusText(' no se encontraron registros') |
465 |
|
|
|
setStatusText('Ok') |
|
466 |
self._object.dispatchEvent(GFEvent('endWAIT')) |
self._object.dispatchEvent(GFEvent('endWAIT')) |
467 |
</trigger> |
</trigger> |
468 |
</button> |
</button> |
474 |
</trigger> |
</trigger> |
475 |
</button> |
</button> |
476 |
<label text="Ubicación:" x="1" y="5"/> |
<label text="Ubicación:" x="1" y="5"/> |
477 |
<entry name="physical_structureEntry" field="_product_data.location" |
<entry name="physical_structureIdEntry" field="_product_data.location" |
478 |
x="1" y="1" hidden="y"/> |
x="1" y="1" hidden="y"/> |
479 |
<!-- new_schema_begin --> |
<!-- new_schema_begin --> |
480 |
|
<entry name="physical_structureNameEntry" |
481 |
|
x="2" y="6" width="40"/> |
482 |
<button name="searchLocationButton" label="Buscar" trigger="searchLocationTrigger" |
<button name="searchLocationButton" label="Buscar" trigger="searchLocationTrigger" |
483 |
x="42" y="6" width="10" height="1"> |
x="42" y="6" width="10" height="1"> |
484 |
<trigger name="searchLocationTrigger" type="NAMED"> |
<trigger name="searchLocationTrigger" type="NAMED"> |
485 |
|
# aca deberia haber algo parecido a lo que hay en los otros trigger similares. |
486 |
self.genericBox('No implementado', ['Ok']); |
self.genericBox('No implementado', ['Ok']); |
|
<!-- doesn't work; wait till is implemented. |
|
|
try: |
|
|
from gnue.forms.GFEvent import GFEvent |
|
|
except ImportError: |
|
|
from gnue.common.events.Event import Event as GFEvent |
|
|
|
|
|
setStatusText('buscando...') |
|
|
self._object.dispatchEvent(GFEvent('beginWAIT')) |
|
|
|
|
|
def setClassification (recNo): |
|
|
if recNo>=0: |
|
|
searchingProducClassificationBlock.jumpRecord (recNo) |
|
|
productBlock.product_classificationEntry= str(searchingProductClassificationBlock.idEntry) |
|
|
showDescriptionsBlock.classificationEntry= str(searchingProductClassificationBlock.nameEntry) |
|
|
|
|
|
# look for the name... |
|
|
searchingProducClassificationBlock.processRollback () |
|
|
searchingProducClassificationBlock.initQuery () |
|
|
searchingProducClassificationBlock.nameEntry= str(showDescriptionsBlock.calssificationEntry)+'%' |
|
|
searchingProducClassificationBlock.processQuery () |
|
|
|
|
|
# are there too much results? |
|
|
resultCount= searchingProducClassificationBlock.getRecordCount () |
|
|
if resultCount>1: |
|
|
# do the select-man |
|
|
runForm ('productClassificationSelect.gfd', { |
|
|
'data': searchingProducClassificationBlock, |
|
|
'callback': setClassification |
|
|
}) |
|
|
elif resultCount==1: |
|
|
setClassification (0) |
|
|
|
|
|
setStatusText('Ok') |
|
|
self._object.dispatchEvent(GFEvent('endWAIT')) --> |
|
487 |
</trigger> |
</trigger> |
488 |
</button> |
</button> |
489 |
<!-- new_schema_end --> |
<!-- new_schema_end --> |
494 |
</trigger> |
</trigger> |
495 |
</button> |
</button> |
496 |
<label text="País de Origen:" x="1" y="7"/> |
<label text="País de Origen:" x="1" y="7"/> |
497 |
<entry name="countryEntry" field="_product_data.country" |
<entry name="countryIdEntry" field="_product_data.country" |
498 |
x="1" y="1" hidden="y"/> |
x="1" y="1" hidden="y"/> |
499 |
<!-- new_schema_begin --> |
<!-- new_schema_begin --> |
500 |
|
<entry name="countryIso3Entry" |
501 |
|
x="2" y="8" width="4"/> |
502 |
|
<entry name="countryNameEntry" |
503 |
|
x="6" y="8" width="36"/> |
504 |
<button name="searchCountryButton" label="Buscar" trigger="searchCountryTrigger" |
<button name="searchCountryButton" label="Buscar" trigger="searchCountryTrigger" |
505 |
x="42" y="8" width="10" height="1"> |
x="42" y="8" width="10" height="1"> |
506 |
<trigger name="searchCountryTrigger" type="NAMED"> |
<trigger name="searchCountryTrigger" type="NAMED"> |
515 |
def setCountry (recNo): |
def setCountry (recNo): |
516 |
if recNo>=0: |
if recNo>=0: |
517 |
searchingCountryBlock.jumpRecord (recNo) |
searchingCountryBlock.jumpRecord (recNo) |
518 |
productBlock.countryEntry= str(searchingCountryBlock.idEntry) |
productBlock.countryIdEntry= str(searchingCountryBlock.idEntry) |
519 |
showDescriptionsBlock.countryCodeEntry= str(searchingCountryBlock.iso3Entry) |
productBlock.countryIso3Entry= str(searchingCountryBlock.iso3Entry) |
520 |
showDescriptionsBlock.countryNameEntry= str(searchingCountryBlock.nameEntry) |
productBlock.countryNameEntry= str(searchingCountryBlock.nameEntry) |
521 |
|
|
522 |
# look for the name... |
# look for the name... |
523 |
searchingCountryBlock.processRollback () |
searchingCountryBlock.processRollback () |
524 |
searchingCountryBlock.initQuery () |
searchingCountryBlock.initQuery () |
525 |
searchingCountryBlock.iso3Entry= str(showDescriptionsBlock.countryCodeEntry)+'%' |
searchingCountryBlock.iso3Entry= str(productBlock.countryIso3Entry)+'%' |
526 |
searchingCountryBlock.nameEntry= str(showDescriptionsBlock.countryNameEntry)+'%' |
searchingCountryBlock.nameEntry= str(productBlock.countryNameEntry)+'%' |
527 |
searchingCountryBlock.processQuery () |
searchingCountryBlock.processQuery () |
528 |
|
|
529 |
# are there too much results? |
# are there too much results? |
534 |
'data': searchingCountryBlock, |
'data': searchingCountryBlock, |
535 |
'callback': setCountry |
'callback': setCountry |
536 |
}) |
}) |
537 |
|
setStatusText('Ok') |
538 |
elif resultCount==1: |
elif resultCount==1: |
539 |
setCountry (0) |
setCountry (0) |
540 |
|
setStatusText('Ok') |
541 |
|
else: |
542 |
|
setStatusText(' no se encontraron registros') |
543 |
|
|
|
setStatusText('Ok') |
|
544 |
self._object.dispatchEvent(GFEvent('endWAIT')) |
self._object.dispatchEvent(GFEvent('endWAIT')) |
545 |
</trigger> |
</trigger> |
546 |
</button> |
</button> |
570 |
<button x="21" y="17" trigger="productRollbackTrigger" width="9" label="Cancelar" |
<button x="21" y="17" trigger="productRollbackTrigger" width="9" label="Cancelar" |
571 |
name="productRollbackBtn" height="1"/> |
name="productRollbackBtn" height="1"/> |
572 |
</block> |
</block> |
|
|
|
|
<!-- new_schema_begin --> |
|
|
<datasource name="showNames" cache="1"/> |
|
|
<block name="showDescriptionsBlock" datasource="showNames"> |
|
|
<entry name="classificationEntry" field="classificationDesc" |
|
|
x="2" y="4" width="40"/> |
|
|
<entry name="storeEntry" field="storeDesc" |
|
|
x="2" y="6" width="40"/> |
|
|
<entry name="countryCodeEntry" field="countryCode" |
|
|
x="2" y="8" width="4"/> |
|
|
<entry name="countryNameEntry" field="countryName" |
|
|
x="6" y="8" width="36"/> |
|
|
</block> |
|
|
<!-- new_schema_end --> |
|
573 |
</box> |
</box> |
574 |
</page> |
</page> |
575 |
|
|