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

2017-03-03 Thread Sergi Almacellas Abellana

El 03/03/17 a les 08:42, Vincent Bastos ha escrit:



On Saturday, February 18, 2017 at 10:20:07 PM UTC+10, Cédric Krier wrote:

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


I suppose I also have to create Configuration class that extends a Wizard?


No you have to create a record in ir.module.config_wizard.item that 
references the wizard you want to call when your module is installed. 
You can have a look at the company module as reference:


http://hg.tryton.org/modules/company/file/052e36889d49/company.xml#l167

Hope it helps.


--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk

--
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/57dacdce-7921-e68a-6450-c1be71476f97%40koolpi.com.


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

2017-03-03 Thread Vincent Bastos
On Fri, Mar 3, 2017 at 6:23 PM, Sergi Almacellas Abellana 
wrote:

> El 03/03/17 a les 08:42, Vincent Bastos ha escrit:
>
>>
>>
>> On Saturday, February 18, 2017 at 10:20:07 PM UTC+10, Cédric Krier wrote:
>>
>> 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
>>
>>
>> I suppose I also have to create Configuration class that extends a Wizard?
>>
>
> No you have to create a record in ir.module.config_wizard.item that
> references the wizard you want to call when your module is installed. You
> can have a look at the company module as reference:
>
> http://hg.tryton.org/modules/company/file/052e36889d49/company.xml#l167
>
> Hope it helps.
>

Yes, I saw this. But this has a reference to the record above it:


Configure Company
company.company.config


Which references the wizard class company.company.config - so I do have to
create this configuration class for my module no?

-- 
*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/CACLX58AGinYsJQNQSXT9tVFx4X2xUy6hi1z7qNy34kRgrR3wTA%40mail.gmail.com.


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

2017-03-03 Thread Sergi Almacellas Abellana

El 03/03/17 a les 09:38, Vincent Bastos ha escrit:



On Fri, Mar 3, 2017 at 6:23 PM, Sergi Almacellas Abellana
mailto:se...@koolpi.com>> wrote:

El 03/03/17 a les 08:42, Vincent Bastos ha escrit:



On Saturday, February 18, 2017 at 10:20:07 PM UTC+10, Cédric
Krier wrote:

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


I suppose I also have to create Configuration class that extends
a Wizard?


No you have to create a record in ir.module.config_wizard.item that
references the wizard you want to call when your module is
installed. You can have a look at the company module as reference:

http://hg.tryton.org/modules/company/file/052e36889d49/company.xml#l167


Hope it helps.


Yes, I saw this. But this has a reference to the record above it:


Configure Company
company.company.config


Which references the wizard class company.company.config - so I do have
to create this configuration class for my module no?



Yes, you have to register the new wizard on the database if you create one.

Note: You can use launch an existing wizard by using an existing xml_id 
on the ir.module.config_wizard.item but I can not imagine any use case.




--
*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/CACLX58AGinYsJQNQSXT9tVFx4X2xUy6hi1z7qNy34kRgrR3wTA%40mail.gmail.com
.



--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk

--
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/0c448b9c-1941-e7e9-04b5-faa7fc63d87d%40koolpi.com.


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

2017-03-03 Thread Cédric Krier
On 2017-03-03 13:56, Vincent Bastos wrote:
> On Sun, Feb 19, 2017 at 9:40 AM, Cédric Krier  wrote:
> I tried this module, but it's not what I am trying to achieve. In my module
> I have a function which automatically sends parties invoices by email
> or/and post depending on what the party has selected. The module is setup
> to automatically charge a party a fee if they have selected to receive an
> invoice by post.
> 
> At the moment the way I am solving this is by using a couple of fields on
> the configuration of the module:
> 
> lease_postage_notice_fee_amount = fields.Numeric(
> 'Postage Notice Fee Amount',
> digits=(16, Eval('currency_digits', 2)),
> depends=['currency_digits']
> )
> lease_postage_notice_fee_account = fields.Many2One(
> 'account.account', 'Postage Notice Fee Account',
> required=False
> )
> 
> When the module creates the invoice it checks on the party if they have
> selected to receive by post and adds an invoice line to reflect this.

This sounds good. You could also use a link to a service product and
store use the revenue account and the list price. This will replace the
two fields by a single one.

> PS I tested the module sale_shipment_cost and the field "Sale Shipment Cost
> Method" on the sale configuration is set to "On Order", but I noticed in
> the code that the function default_sale_shipment_cost returns 'shipment'.
> Can you explain why this is?

The default method is for the configuration but the sale default method
use the configured value.

-- 
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/20170303141849.GP36856%40tetsuo.