Re: Iterate over grid items on pre-foucsout event for the block.

Reinhard Mueller <[email protected]> Mon, 28 Feb 2011 19:31:52 +0100
Newsgroups gmane.comp.gnu.enterprise.general
Organization Free Software Foundation Europe
Message-ID <1298917912.1741.33.camel@dublin>
--===============0265940511==
Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-BADvz0yuTrUw0+Am4XGi"


--=-BADvz0yuTrUw0+Am4XGi
Content-Type: text/plain; charset="ISO-8859-15"
Content-Transfer-Encoding: quoted-printable

Hi,

Am Sonntag, den 27.02.2011, 22:14 +0530 schrieb Kishan Bhat:
> 1. How can I create invoice item record from values in po item record.

Basically, you can create a new record with:

my_block.new_record()
my_block.field_1.value =3D 'foo'
my_block.field_2.value =3D 17
my_block.field_3.value =3D other_block.some_field.value

You can commit the transaction with
form.commit()

>  2. Instead of a per field trigger based action, how can I do a button
> based trigger and loop over the items in the displayed gridline and
> programmatically create new invoice item record one-by-one.=20

data_available =3D my_block.first_record()
while data_available:
    process_whatever_you_want()
    data_available =3D my_block.next_record()

This iterates through the block, also visible on the screen. If you
don't want this, you can create a second block and a second datasource
for the same table, but if you do that, don't forget to form.commit()
things first and do a second_block.set_filter() so the second block has
up to date data.

Thanks,
Reinhard

--=-BADvz0yuTrUw0+Am4XGi
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Dies ist ein digital signierter Nachrichtenteil

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iJwEAAECAAYFAk1r6hcACgkQKm/Tcod8puNvKgP/YiGTgcjYFChqnJVZcAVsdX4O
MOIQj5fzl0DrBww7E3Cst8FEdiCLmN5CSigg/uP2NaHJE1hPFxwy3QnGsmw6hGzB
dc7jvI+h2UKxUgO+kn/uJzE2FHo0CNm4k7gE15CfkQt2YWxYLrO3PakXhyX2y4md
JPVqIwY2tP9YVdl9Ytk=
=1PUB
-----END PGP SIGNATURE-----

--=-BADvz0yuTrUw0+Am4XGi--



--===============0265940511==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
gnue mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnue

--===============0265940511==--