[tryton-dev] Remove constrainte
Hello, Is there a way to remove constrainte put by a required clause ? In details, I have a field that have a constrainte put by the required clause and i want to remove this constainte by overload of the class. it-is possible ? Regards. -- Christophe CRIER Adiczion (www.adiczion.com)
Re: [tryton-dev] Remove constrainte
El 05/12/14 a les 15:41, Christophe ha escrit: Hello, Is there a way to remove constrainte put by a required clause ? In details, I have a field that have a constrainte put by the required clause and i want to remove this constainte by overload of the class. it-is possible ? Yes, it's possible. You have to do the following things. 1. Update fields definition to set required to false. 2. Drop the not null constraint on the database. BTW: Can you tell us which is the field you want to remove the constraint? This will help us to prevent having to much constraints on base modules. -- Sergi Almacellas Abellana www.koolpi.com Twitter: @pokoli_srk
Re: [tryton-dev] Remove constrainte
On 05/12/14 10:16, Sergi Almacellas Abellana wrote: El 05/12/14 a les 15:41, Christophe ha escrit: Hello, Is there a way to remove constrainte put by a required clause ? In details, I have a field that have a constrainte put by the required clause and i want to remove this constainte by overload of the class. it-is possible ? Yes, it's possible. You have to do the following things. 1. Update fields definition to set required to false. 2. Drop the not null constraint on the database. BTW: Can you tell us which is the field you want to remove the constraint? This will help us to prevent having to much constraints on base modules. Or better, you can use register method (overloading the class) and to apply python-sql commands
Re: [tryton-dev] Remove constrainte
On 05 Dec 15:41, Christophe wrote: Hello, Is there a way to remove constrainte put by a required clause ? In details, I have a field that have a constrainte put by the required clause and i want to remove this constainte by overload of the class. it-is possible ? There is method in TableHandler to manage that [1] but it is intended to be used for migration because on the next update Tryton will try first to re-add the constraint. Indeed, it is probably a bad idea to remove a required from a parent module because if it is set it is because it is strictly required for the module to work properly (but maybe the module is buggy and it is not strictly required if so you should ask the author to fix his module). [1] http://hg.tryton.org/trytond/file/569dd5d4d9e1/trytond/backend/table.py#l167 -- Cédric Krier - B2CK SPRL Email/Jabber: cedric.kr...@b2ck.com Tel: +32 472 54 46 59 Website: http://www.b2ck.com/ pgpBjCTQLyzqL.pgp Description: PGP signature
Re: [tryton-dev] Remove constrainte
Le 05/12/2014 16:16, Sergi Almacellas Abellana a écrit : El 05/12/14 a les 15:41, Christophe ha escrit: Hello, Is there a way to remove constrainte put by a required clause ? In details, I have a field that have a constrainte put by the required clause and i want to remove this constainte by overload of the class. it-is possible ? Yes, it's possible. You have to do the following things. 1. Update fields definition to set required to false. 2. Drop the not null constraint on the database. BTW: Can you tell us which is the field you want to remove the constraint? This will help us to prevent having to much constraints on base modules. I have made (1) for (2) i try with __register__ method but it don't work (or i have made a mistake) @classmethod def __register__(cls, module_name): super(Article, cls).__register__(module_name) TableHandler = backend.get('TableHandler') cursor = Transaction().cursor table = TableHandler(cursor, cls, module_name) table.not_null_action('content', action='remove') For BTW : I try to remove constrainte from 'content' field because in my overload this field is not necessary (it is replaced by another). PS : I also view the Cedric response and what I want to do is perhaps not be possible. -- Christophe CRIER Adiczion (www.adiczion.com)
Re: [tryton-es] Rotación de productos
2014-12-05 1:15 GMT+01:00 Luis Deiana luis.deian...@gmail.com: Buenas noches, hay algún modulo o forma de ver la rotación de los productos en un plazo determinado? a que te refieres a rotación?
Re: [tryton-es] Rotación de productos
El viernes, 5 de diciembre de 2014 05:46:25 UTC-3, raimonesteve escribió: 2014-12-05 1:15 GMT+01:00 Luis Deiana luis.d...@gmail.com javascript:: Buenas noches, hay algún modulo o forma de ver la rotación de los productos en un plazo determinado? a que te refieres a rotación? Me refiero a la cantidad que se vendió de un producto o varios en un cierto periodo.
[tryton] Re: Thank you for TUL 2014
+1 On Monday, December 1, 2014 3:53:48 PM UTC+10, Sharoon Thomas wrote: Jan, On behalf of the Tryton Software Foundation (and the Tryton community), I would like to thank you for organizing a great unconference. We enjoyed the days we were at the unconference. The unconference would not have been as successful without your tireless efforts. You have set another benchmark for the next unconference organizers. And one last thing: Thank you for leading the way in Trytonizing automobiles [1] ;-) [1] https://plus.google.com/+SharoonThomas/posts/AzXMNheea3F?pid=6087740346516994210oid=105569540231974609186 Thanks Regards -- -- Sharoon Thomas Openlabs Technologies Consulting (P) Limited w: http://www.openlabs.co.in m: +1 813.793.6736 (OPEN) Extn. 200 t: @sharoonthomas - We Win When our Customers Win
Re: [tryton] RfC: maning of new state of stock move
On 05 Dec 11:57, Mathias Behrle wrote: Hi all, I would like to pull a little bit of your attention to the following issue: For [1] there is coming a new state for stock moves, for which the current proposal [2] is 'None'. My point of view is: there shouldn't be a state of None. As soon as an object has a state, it has one and 'None' is misleading. This is different from selections, where you can can make a selection or not. I don't understand this thought. state field can only have one of the value of the selection so there is no misleading by naming one of the selection 'None'. I proposed several alternatives: 'Preliminary', 'Preparative', 'Provisional', 'Tentative' What would be your prefered name just in case? Cheers, Mathias [1] https://bugs.tryton.org/issue4362 [2] http://codereview.tryton.org/5811002/diff/20001/CHANGELOG#newcode1 -- Cédric Krier - B2CK SPRL Email/Jabber: cedric.kr...@b2ck.com Tel: +32 472 54 46 59 Website: http://www.b2ck.com/ pgpqDqW3JRUV8.pgp Description: PGP signature
Re: [tryton] RfC: maning of new state of stock move
* Cédric Krier: Re: [tryton] RfC: maning of new state of stock move (Fri, 5 Dec 2014 12:07:54 +0100): On 05 Dec 11:57, Mathias Behrle wrote: Hi all, I would like to pull a little bit of your attention to the following issue: For [1] there is coming a new state for stock moves, for which the current proposal [2] is 'None'. My point of view is: there shouldn't be a state of None. As soon as an object has a state, it has one and 'None' is misleading. This is different from selections, where you can can make a selection or not. I don't understand this thought. state field can only have one of the value of the selection so there is no misleading by naming one of the selection 'None'. A state of 'None' logically is not at all a state , so if choosen the state should disappear from the object. It would be way easier for our users to have a meaningful name instead of a logical clash. A selection is different. Not doing a selection is an empty selection. I proposed several alternatives: 'Preliminary', 'Preparative', 'Provisional', 'Tentative' What would be your prefered name just in case? Cheers, Mathias [1] https://bugs.tryton.org/issue4362 [2] http://codereview.tryton.org/5811002/diff/20001/CHANGELOG#newcode1 -- Mathias Behrle MBSolutions Gilgenmatten 10 A D-79114 Freiburg Tel: +49(761)471023 Fax: +49(761)4770816 http://m9s.biz UStIdNr: DE 142009020 PGP/GnuPG key availabable from any keyserver, ID: 0x8405BBF6 pgphv026qRm0N.pgp Description: Digitale Signatur von OpenPGP
Re: [tryton] RfC: maning of new state of stock move
On 05 Dec 12:34, Mathias Behrle wrote: * Cédric Krier: Re: [tryton] RfC: maning of new state of stock move (Fri, 5 Dec 2014 12:07:54 +0100): On 05 Dec 11:57, Mathias Behrle wrote: Hi all, I would like to pull a little bit of your attention to the following issue: For [1] there is coming a new state for stock moves, for which the current proposal [2] is 'None'. My point of view is: there shouldn't be a state of None. As soon as an object has a state, it has one and 'None' is misleading. This is different from selections, where you can can make a selection or not. I don't understand this thought. state field can only have one of the value of the selection so there is no misleading by naming one of the selection 'None'. A state of 'None' logically is not at all a state , For me this is wrong, it is a state. so if choosen the state should disappear from the object. I don't understand. It would be way easier for our users to have a meaningful name instead of a logical clash. What best meaning that the move has no state because it has a state that does nothing. A selection is different. Not doing a selection is an empty selection. Wrong. This is not how Tryton works. If there is not a selection entry for 'Empty', it is not possible to not select something. -- Cédric Krier - B2CK SPRL Email/Jabber: cedric.kr...@b2ck.com Tel: +32 472 54 46 59 Website: http://www.b2ck.com/ pgpYWWaEs58Gr.pgp Description: PGP signature
Re: [tryton] RfC: maning of new state of stock move
* Cédric Krier: Re: [tryton] RfC: maning of new state of stock move (Fri, 5 Dec 2014 13:17:03 +0100): On 05 Dec 12:34, Mathias Behrle wrote: * Cédric Krier: Re: [tryton] RfC: maning of new state of stock move (Fri, 5 Dec 2014 12:07:54 +0100): On 05 Dec 11:57, Mathias Behrle wrote: Hi all, I would like to pull a little bit of your attention to the following issue: For [1] there is coming a new state for stock moves, for which the current proposal [2] is 'None'. My point of view is: there shouldn't be a state of None. As soon as an object has a state, it has one and 'None' is misleading. This is different from selections, where you can can make a selection or not. I don't understand this thought. state field can only have one of the value of the selection so there is no misleading by naming one of the selection 'None'. A state of 'None' logically is not at all a state , For me this is wrong, it is a state. so if choosen the state should disappear from the object. I don't understand. If you choose to set a state to 'None', you could expect to remove it. It would be way easier for our users to have a meaningful name instead of a logical clash. What best meaning that the move has no state because it has a state that does nothing. So give it a meaningful name describing its purpose: 'Preliminary', 'Preparative', 'Provisional', 'Tentative' A selection is different. Not doing a selection is an empty selection. Wrong. This is not how Tryton works. If there is not a selection entry for 'Empty', it is not possible to not select something. It is logic for selections to contain an empty item, if the selection is not required. It is not logic for a state to be not a state, because as soon as something is in a state, it has one, but not none. -- Mathias Behrle MBSolutions Gilgenmatten 10 A D-79114 Freiburg Tel: +49(761)471023 Fax: +49(761)4770816 http://m9s.biz UStIdNr: DE 142009020 PGP/GnuPG key availabable from any keyserver, ID: 0x8405BBF6 pgp1n44sNO8Ij.pgp Description: Digitale Signatur von OpenPGP
Re: [tryton] RfC: maning of new state of stock move
On 05 Dec 13:54, Mathias Behrle wrote: * Cédric Krier: Re: [tryton] RfC: maning of new state of stock move (Fri, 5 Dec 2014 13:17:03 +0100): On 05 Dec 12:34, Mathias Behrle wrote: * Cédric Krier: Re: [tryton] RfC: maning of new state of stock move (Fri, 5 Dec 2014 12:07:54 +0100): On 05 Dec 11:57, Mathias Behrle wrote: Hi all, I would like to pull a little bit of your attention to the following issue: For [1] there is coming a new state for stock moves, for which the current proposal [2] is 'None'. My point of view is: there shouldn't be a state of None. As soon as an object has a state, it has one and 'None' is misleading. This is different from selections, where you can can make a selection or not. I don't understand this thought. state field can only have one of the value of the selection so there is no misleading by naming one of the selection 'None'. A state of 'None' logically is not at all a state , For me this is wrong, it is a state. so if choosen the state should disappear from the object. I don't understand. If you choose to set a state to 'None', you could expect to remove it. To remove what? It would be way easier for our users to have a meaningful name instead of a logical clash. What best meaning that the move has no state because it has a state that does nothing. So give it a meaningful name describing its purpose: 'Preliminary', 'Preparative', 'Provisional', 'Tentative' All sounds like for the current 'Draft'. A selection is different. Not doing a selection is an empty selection. Wrong. This is not how Tryton works. If there is not a selection entry for 'Empty', it is not possible to not select something. It is logic for selections to contain an empty item, if the selection is not required. False assumption. It is not logic for a state to be not a state, Who says it is not a state? because as soon as something is in a state, it has one, but not none. There is always something in a field. -- Cédric Krier - B2CK SPRL Email/Jabber: cedric.kr...@b2ck.com Tel: +32 472 54 46 59 Website: http://www.b2ck.com/ pgppeelVIdsf3.pgp Description: PGP signature
Re: [tryton] RfC: maning of new state of stock move
* Cédric Krier: Re: [tryton] RfC: maning of new state of stock move (Fri, 5 Dec 2014 14:27:08 +0100): On 05 Dec 13:54, Mathias Behrle wrote: * Cédric Krier: Re: [tryton] RfC: maning of new state of stock move (Fri, 5 Dec 2014 13:17:03 +0100): On 05 Dec 12:34, Mathias Behrle wrote: * Cédric Krier: Re: [tryton] RfC: maning of new state of stock move (Fri, 5 Dec 2014 12:07:54 +0100): On 05 Dec 11:57, Mathias Behrle wrote: Hi all, I would like to pull a little bit of your attention to the following issue: For [1] there is coming a new state for stock moves, for which the current proposal [2] is 'None'. My point of view is: there shouldn't be a state of None. As soon as an object has a state, it has one and 'None' is misleading. This is different from selections, where you can can make a selection or not. I don't understand this thought. state field can only have one of the value of the selection so there is no misleading by naming one of the selection 'None'. A state of 'None' logically is not at all a state , For me this is wrong, it is a state. so if choosen the state should disappear from the object. I don't understand. If you choose to set a state to 'None', you could expect to remove it. To remove what? It would be way easier for our users to have a meaningful name instead of a logical clash. What best meaning that the move has no state because it has a state that does nothing. So give it a meaningful name describing its purpose: 'Preliminary', 'Preparative', 'Provisional', 'Tentative' All sounds like for the current 'Draft'. A selection is different. Not doing a selection is an empty selection. Wrong. This is not how Tryton works. If there is not a selection entry for 'Empty', it is not possible to not select something. It is logic for selections to contain an empty item, if the selection is not required. False assumption. It is not logic for a state to be not a state, Who says it is not a state? You. Citing you from [1] | But for me, None is clearly defining what it is. A move with no state. because as soon as something is in a state, it has one, but not none. There is always something in a field. Cédric, I know that we disagree. It doesn't make much sense to me that we both repeat arguments again and again. That's why I just would like to hear from others, how they think about the matter. -- Mathias Behrle MBSolutions Gilgenmatten 10 A D-79114 Freiburg Tel: +49(761)471023 Fax: +49(761)4770816 http://m9s.biz UStIdNr: DE 142009020 PGP/GnuPG key availabable from any keyserver, ID: 0x8405BBF6 pgpJBlnL9aXdj.pgp Description: Digitale Signatur von OpenPGP
[tryton] Product supplier currency through proteus
Hello, I am using Tryton 3.4 and i try to add a product supplier for a product via proteus. Everything is going smooth and i take no errors. But for the currency (even if my app's log tells i have pass the correct one) in Tryton i get the default currency of my company... For example I create a product supplier which I want him to use USD, in my Tryton it passes like EUR. As my default companies currency. This is my code: def add_supplier(c_dict): product_id = c_dict['product'] print 'add_supplier:', c_dict print 'product_id:', product_id obj = Model.get('product.template') pprint(obj) rv = obj.find([('id', '=', product_id)]) pprint(rv) product = rv[0] pprice = Model.get('purchase.product_supplier') pp = pprice() pp.delivery_time = c_dict['delivery_time'] pp.product = product pp.currency = c_dict['currency'] pp.party = c_dict['party'] pp.name = c_dict['name'] pp.code = c_dict['code'] res = pp.save() return res And this is the printed output: add_supplier: {'delivery_time': 1, 'product': 1632, 'code': u'PL-08', 'name': u'PL-08', 'currency': proteus.Model.get('currency.currency')(152), 'party': proteus.Model.get('party.party')(4182)} product_id: 1632