Re: [tryton-dev] Force an account on a product in a configuration form

2017-02-18 Thread Cédric Krier
On 2017-02-19 06:00, Vincent Bastos wrote:
> For this module there is a function which automatically applies a charge
> based on certain conditions. So I guess the right way of implementing this
> is actually to create a product record in XML in the module already.

I do not recommend to create product (or any non standardized data) via
XML because this removes the possibility to the user to customize it.

I guess you have a model that defines the condition to apply the charge
so on this model you can link to a product. There you could have any
sort of validation to ensure the product is correctly configured.

I suggest you to look at the module sale_shipment_cost which does
probably something similar to yours.

-- 
Cédric Krier - B2CK SPRL
Email/Jabber: cedric.kr...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

-- 
You received this message because you are subscribed to the Google Groups 
"tryton-dev" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton-dev/20170218234055.GD24040%40tetsuo.


[tryton-dev] Un-assigned Tryton issue tracker requests

2017-02-18 Thread Tryton issue tracker
Created ID   Activity   Title
===
 bug
2 weeks ago 6234 1 week ago Handling shipment exception on Purchas ...
 bug
4 months ago 5905 4 months ago Display bug in tryton client with ubun ...
 bug
6 months ago 5810 6 months ago Client crash when user name on Windows ...
 bug
16 months ago 5030 7 months ago Error connecting with Tryton client fr ...
 bug
24 months ago 4582 24 months ago Display datetime before epoch on windows  
 bug
27 months ago 4359 27 months ago Windows client error when image size i ...

To view or respond to any of the requests listed above, visit the URL

   https://bugs.tryton.org/

and click on "Show Unassigned". Do NOT respond to this message.

-- 
You received this message because you are subscribed to the Google Groups 
"tryton-dev" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton-dev/20170218230003.15784118007D%40moretus.b2ck.com.


Re: [tryton-dev] Force an account on a product in a configuration form

2017-02-18 Thread Vincent Bastos
On Sat, Feb 18, 2017 at 10:13 PM, Cédric Krier 
wrote:

> On 2017-02-17 20:37, Vincent Bastos wrote:
> > Hi,
> >
> > I would like to create a Configuration form for a module that has a
> > mandatory field for a product and I would like this form to force the
> user
> > to create a product with accounts being setup.
> >
> > Is this possible? How would I do this?
>
> This is a strange idea because product is referential data so it is
> created prior to operations.
> So with this in mind, the product should be created with the required
> accounts depending of its configuration. This is like that sale (and
> purchase) does, it adds a check box defining if the product can be used
> for a sale and if checked the revenue account is required.
> But this is not enough because we have this feature to inherit from the
> accounting category. So we still have to check and raise an error when
> we need an account from a product.
>

Thanks for your comment. It has made me rethink my design.

For this module there is a function which automatically applies a charge
based on certain conditions. So I guess the right way of implementing this
is actually to create a product record in XML in the module already.

-- 
*Vincent Bastos*
*Lava Lab Software*

-- 
You received this message because you are subscribed to the Google Groups 
"tryton-dev" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton-dev/CACLX58D3X_WBMnxGrp_-yKZ382hyOaerevT5znppuND%2B2BQtQQ%40mail.gmail.com.


Re: [tryton-dev] How to add to the configuration wizard when a new module is installed

2017-02-18 Thread Cédric Krier
On 2017-02-17 22:42, Vincent Bastos wrote:
> Hi,
> 
> I am unable to figure out how modules are able to "append" to the 
> configuration wizard when a new module is installed.
> 
> I have created a configuration.py file and configuration.xml file with a 
> form, but this does not come up when I install my module.
> 
> I thought that Tryton automatically added configuration files to the 
> wizard, but I was unable to find this in the code.

Explicit is better than implicit.
You have to create an entry in ir.module.config_wizard.item

-- 
Cédric Krier - B2CK SPRL
Email/Jabber: cedric.kr...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

-- 
You received this message because you are subscribed to the Google Groups 
"tryton-dev" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton-dev/20170218121515.GC24040%40tetsuo.


Re: [tryton-dev] Force an account on a product in a configuration form

2017-02-18 Thread Cédric Krier
On 2017-02-17 20:37, Vincent Bastos wrote:
> Hi,
> 
> I would like to create a Configuration form for a module that has a 
> mandatory field for a product and I would like this form to force the user 
> to create a product with accounts being setup.
> 
> Is this possible? How would I do this?

This is a strange idea because product is referential data so it is
created prior to operations.
So with this in mind, the product should be created with the required
accounts depending of its configuration. This is like that sale (and
purchase) does, it adds a check box defining if the product can be used
for a sale and if checked the revenue account is required.
But this is not enough because we have this feature to inherit from the
accounting category. So we still have to check and raise an error when
we need an account from a product.

-- 
Cédric Krier - B2CK SPRL
Email/Jabber: cedric.kr...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

-- 
You received this message because you are subscribed to the Google Groups 
"tryton-dev" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton-dev/20170218121328.GB24040%40tetsuo.