[tryton-dev] PEP-0008 Dunder names

2018-05-24 Thread Vincent Bastos
Hi,

Just wondering why Tryton does not follow one of the points in PEP-0008[1]?

[1] - https://www.python.org/dev/peps/pep-0008/#id24

-- 
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/5eecb64d-550d-4722-bc91-964d3b919a7f%40googlegroups.com.


Re: [tryton-dev] Should Date.today() in account.invoice use company timezone?

2017-05-12 Thread Vincent Bastos
On Fri, May 12, 2017 at 5:10 PM, Cédric Krier <cedric.kr...@b2ck.com> wrote:

> On 2017-05-11 21:40, Vincent Bastos wrote:
> > Hi,
> >
> > I am curious as to why the module account.invoice does not use the
> timezone
> > variable from company if it has been set when calling Date.today()?
>
> It does http://hg.tryton.org/modules/company/file/5b8a0005ebf9/
> company.py#l314
>

I knew it! :)



-- 
*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/CACLX58Aa-pnu3GuuY1jF9G0deoLUhfJw0w%2BObXJdS0bYGVKTqQ%40mail.gmail.com.


Re: [tryton-dev] Best way to test for a date in a date field

2017-05-05 Thread Vincent Bastos


On Wednesday, May 3, 2017 at 5:31:49 PM UTC+10, Sergi Almacellas Abellana 
wrote:
>
> El 02/05/17 a les 07:59, Vincent Bastos ha escrit: 
> > Hi, 
> > 
> > I wanted to know what the best way to write a domain for a search call 
> > to test for records that have a date in a particular field. 
> > 
> > My idea is something like this: 
> > 
> > nodate = Date(0) 
> > 
> > invoices = Invoice.search([ 
> > ('lease', '=', self.id), 
> > ('state', '!=', 'paid'), 
> > ('mydate', '!=', nodate), 
> > ], order=[('invoice_date', 'ASC')]) 
> Not sure to understand, but if you want to search for invoices where the 
> mydate field is empty you can search for None as values. The clause will 
> be: 
>
> ('mydate', '=', None) 
>

Thanks ... I realised after asking the question ...

-- 
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/fc5d84c2-dce6-4648-957d-5e2850f4855d%40googlegroups.com.


[tryton-dev] Best way to test for a date in a date field

2017-05-03 Thread Vincent Bastos
Hi,

I wanted to know what the best way to write a domain for a search call to 
test for records that have a date in a particular field.

My idea is something like this:

nodate = Date(0)

invoices = Invoice.search([
('lease', '=', self.id),
('state', '!=', 'paid'),
('mydate', '!=', nodate),
], order=[('invoice_date', 'ASC')])

-- 
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/8355fce6-1a12-45e8-be59-b963d4fc3909%40googlegroups.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 <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?

-- 
*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-02 Thread Vincent Bastos


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?

-- 
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/b9ec2a2b-b685-4d3f-b71d-95ba42ac19f7%40googlegroups.com.


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

2017-03-02 Thread Vincent Bastos
On Sun, Feb 19, 2017 at 9:40 AM, Cédric Krier <cedric.kr...@b2ck.com> wrote:

> 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.


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.

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?

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


Re: [tryton-dev] module for an SMS queue

2017-02-23 Thread Vincent Bastos
On Thu, Feb 23, 2017 at 7:45 PM, Cédric Krier <cedric.kr...@b2ck.com> wrote:

> On 2017-02-23 18:53, Vincent Bastos wrote:
> > On Thu, Feb 23, 2017 at 6:39 PM, Cédric Krier <cedric.kr...@b2ck.com>
> wrote:
> > The way the Twilio API works is that you send it a request to send a
> > message and it manages the queue. In effect, The queue is not in Tryton,
> > but in Twilio, but Tryton has a record of what messages were sent to
> Twilio.
> >
> > When you send a "request to send an sms" to Twilio it allows you to add a
> > call back url that Twilio will call when the state of the message
> changes.
>
> This will be doable if twilio support 2 phase commit and if it retries
> the callback if they failed.
> But I do not see a generic design here, at best a twilio module.
>

Twilio just provides an HTTP restful API.

I was thinking of sending a request inside the create method and saving the
record with a different value depending on whether the request was
successful or not.

Thanks

-- 
*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/CACLX58A%3DvSBAiAWfwqhaMzCBnCvF6nAFxmMYMt_FgJ9h%2BZQVAg%40mail.gmail.com.


[tryton-dev] module for an SMS queue

2017-02-22 Thread Vincent Bastos
I would like to suggest a module to manage an SMS queue. I am interested to 
get feedback/comments.

I need to create a module to send SMS's via an SMS gateway provider called 
Twilio [1]. The reason for this queue is because users should be able to 
tell if messages have been sent or not without having to access another 
system.

The idea is that we could have a generic SMS queue module which is 
basically a single model: SMSQueue.

sms.queue:

   - to: {phone number}
   - from: {from number}
   - body: text field
   - SMSStatus: selection

I also envisaged a second object to relate to any model:
sms.queue-models:

   - sms: Many2One to sms.queue
   - ref: Reference


A provider/gateway specific module would simply use the model above to 
store messages etc ...

[1] www.twillio.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/50338f8a-6dcc-4964-b13d-4a705958787a%40googlegroups.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 <cedric.kr...@b2ck.com>
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.


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

2017-02-17 Thread Vincent Bastos
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.

-- 
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/275d44f5-20de-4132-8db8-ad8a5ecabd42%40googlegroups.com.


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

2017-02-17 Thread Vincent Bastos
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?

-- 
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/aa0febb5-edae-4e43-8cb9-edf4582cfc97%40googlegroups.com.


[tryton-dev] Re: More comment on "UPDATE FOR" patch

2017-01-15 Thread Vincent Bastos
I don't understand what assignation is?

-- 
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/e0faa75a-7a68-401a-9a74-202f67cb86fd%40googlegroups.com.


[tryton-dev] Tryton cookiecutter error

2017-01-12 Thread Vincent Bastos
Hey,

I thought I would try to use the Tryton cookiecutter, but I am getting the 
following error:

(tryton38testmodule)*➜  **tryton38testmodule* cookiecutter 
https://hg.tryton.org/cookiecutter

Traceback (most recent call last):

  File "/usr/local/bin/cookiecutter", line 11, in 

sys.exit(main())

  File "/Library/Python/2.7/site-packages/click/core.py", line 610, in 
__call__

return self.main(*args, **kwargs)

  File "/Library/Python/2.7/site-packages/click/core.py", line 590, in main

rv = self.invoke(ctx)

  File "/Library/Python/2.7/site-packages/click/core.py", line 782, in 
invoke

return ctx.invoke(self.callback, **ctx.params)

  File "/Library/Python/2.7/site-packages/click/core.py", line 416, in 
invoke

return callback(*args, **kwargs)

  File "/Library/Python/2.7/site-packages/cookiecutter/cli.py", line 70, in 
main

cookiecutter(template, checkout, no_input)

  File "/Library/Python/2.7/site-packages/cookiecutter/main.py", line 79, 
in cookiecutter

no_input=no_input

  File "/Library/Python/2.7/site-packages/cookiecutter/vcs.py", line 97, in 
clone

repo_type, repo_url = identify_repo(repo_url)

  File "/Library/Python/2.7/site-packages/cookiecutter/vcs.py", line 69, in 
identify_repo

raise UnknownRepoType

cookiecutter.exceptions.UnknownRepoType

-- 
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/2476cf53-b3e2-463d-adbf-d05f956cbba6%40googlegroups.com.


[tryton-dev] Re: log details from 500 ( Internal Server Error )

2017-01-04 Thread Vincent Bastos
I didn't find the error messages, but I did find out that one error was 
caused by doing an RPC on a non-existing method and the other RPC was 
missing some parameters

-- 
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/dba4aa32-bf39-41f3-9306-4e62b6088fd2%40googlegroups.com.


[tryton-dev] log details from 500 ( Internal Server Error )

2017-01-04 Thread Vincent Bastos
Hi,

I am currently testing a custom javascript application and I am getting 500 
( Internet Server Error ) responses, but I don't know where to get details 
of the error.

I am running the server (4.2) with -v and --dev, but this just outputs:

NFO werkzeug 127.0.0.1 - - [05/Jan/2017 04:50:33] "POST / HTTP/1.1" 500 -


I have installed trytond inside a virtualenv.


Thanks

-- 
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/6407ac59-1f25-4353-956a-79d28696f479%40googlegroups.com.


Re: [tryton-dev] non authenticated end point

2016-11-28 Thread Vincent Bastos


On Thursday, November 24, 2016 at 11:20:02 PM UTC+10, Cédric Krier wrote:
>
> On 2016-11-24 22:44, Vincent Bastos wrote: 
> >  ok, so for now I can create an sms_queue module but without updating 
> the 
> > status of an sms. 
>
> I do not think you need a queue [1]. You can also use the 2 phase commit 
> like the sendmail_transactional does. 
>
> [1] 
> https://mikehadlow.blogspot.nl/2012/04/database-as-queue-anti-pattern.html 
>

Yeah, I meant to follow this pattern rather than a queue, but then 
shouldn't I handle the case where Twilio is not reachable?

Btw Twilio provides a way to validate their requrests [1]

[1] - https://www.twilio.com/docs/api/security#validating-requests 

-- 
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/d6101be7-e7f3-47f8-a3bf-ae786da65ea6%40googlegroups.com.


Re: [tryton-dev] non authenticated end point

2016-11-24 Thread Vincent Bastos
On Thu, Nov 24, 2016 at 10:34 PM, Cédric Krier <cedric.kr...@b2ck.com>
wrote:

> On 2016-11-24 22:22, Vincent Bastos wrote:
> > On Thu, Nov 24, 2016 at 10:17 PM, Sergi Almacellas Abellana <
> > se...@koolpi.com> wrote:
> >
> > > Hi Vincent,
> > >
> > > El 24/11/16 a les 13:11, Vincent Bastos ha escrit:
> > >
> > >> Is it possible to create an end point on the server that does not
> > >> require authentication?
> > >>
> > >> I would like to implement a queue to send SMS's using the Twilio API.
> > >> When you send a request to send a message, it is possible to set a
> > >> callback url [1] with a parameter in the domain rather than as a
> > >> parameter.
> > >>
> > >>
> > > You can use flask_tryton [1] to create a custom endpoint that conects
> to
> > > the database and processes the requests. This request won't require any
> > > authentication.
> > >
> > > Hope it helps,
> > >
> > > [1] https://pypi.python.org/pypi/flask_tryton/0.6
> >
> > ok thanks. I had not thought of this.
> >
> > I'm not sure how to actually implement this in terms of putting it
> together
> > in a module - if that even makes sense. Can I simple create a flask
> > application in my module?
>
> Indeed I think it will be better in 4.2 to use a route without the
> user_application decorator but of course you must be careful about the
> process because your endpoint will be exposed to anyone.


 ok, so for now I can create an sms_queue module but without updating the
status of an sms.

-- 
*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/CACLX58BXWxUbcRmp9O%3DZRtmD4xYf_KKitpAEmw7MSLK%2B1wcWUA%40mail.gmail.com.


Re: [tryton-dev] non authenticated end point

2016-11-24 Thread Vincent Bastos
On Thu, Nov 24, 2016 at 10:17 PM, Sergi Almacellas Abellana <
se...@koolpi.com> wrote:

> Hi Vincent,
>
> El 24/11/16 a les 13:11, Vincent Bastos ha escrit:
>
>> Is it possible to create an end point on the server that does not
>> require authentication?
>>
>> I would like to implement a queue to send SMS's using the Twilio API.
>> When you send a request to send a message, it is possible to set a
>> callback url [1] with a parameter in the domain rather than as a
>> parameter.
>>
>>
> You can use flask_tryton [1] to create a custom endpoint that conects to
> the database and processes the requests. This request won't require any
> authentication.
>
> Hope it helps,
>
> [1] https://pypi.python.org/pypi/flask_tryton/0.6



ok thanks. I had not thought of this.

I'm not sure how to actually implement this in terms of putting it together
in a module - if that even makes sense. Can I simple create a flask
application in my module?

-- 
*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/CACLX58Ad%2BJ1fnVOUdABWd8ER3iz71yzed%2BECbXrP8T%3Df7RZ%3DQQ%40mail.gmail.com.


[tryton-dev] non authenticated end point

2016-11-24 Thread Vincent Bastos
Is it possible to create an end point on the server that does not require 
authentication?

I would like to implement a queue to send SMS's using the Twilio API. When 
you send a request to send a message, it is possible to set a callback url 
[1] with a parameter in the domain rather than as a parameter.

[1] 
- https://www.twilio.com/docs/guides/sms/how-to-confirm-delivery-in-python

-- 
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/0e3541d0-469e-49a5-a97a-bcfe4702c1fc%40googlegroups.com.


Re: [tryton-dev] read order by create_date

2016-11-24 Thread Vincent Bastos
On Thu, Nov 24, 2016 at 6:42 PM, Cédric Krier <cedric.kr...@b2ck.com> wrote:

> On 2016-11-23 22:16, Vincent Bastos wrote:
> > Is there any reason why ordering by create_date wouldn't work?
> >
> > Can't I use the following domain - 'create_date', 'DESC'?
>
> You can but if you have an issue please provide the traceback.
>
> --
> Cédric Krier - B2CK SPRL
> Email/Jabber: cedric.kr...@b2ck.com
> Tel: +32 472 54 46 59
> Website: http://www.b2ck.com/


Sorry for wasting both your times.

I didn't have an error, the ordering was just not working. In case you were
wondering; I removed the following statements from the model and it has
fixed my issue:

cls._order.insert(0, ('create_date', 'DESC'))
cls._order.insert(1, ('number', 'DESC'))
    cls._order.insert(2, ('id', 'DESC'))

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


Re: [tryton-dev] Limit of One2Many

2016-11-24 Thread Vincent Bastos
On Thu, Nov 24, 2016 at 6:37 PM, Nicolas Évrard <nicolas.evr...@b2ck.com>
wrote:

> * Vincent Bastos  [2016-11-24 01:38 +0100]:
>
>> How can I see what the maximum number of id's a One2Many field returns?
>>
>
> Just specify size=… in the definition of the One2Many
>
> http://doc.tryton.org/4.0/trytond/doc/ref/models/fields.html
> #trytond.model.fields.One2Many.size


I thought that field was used to limit the number of records?

I didn't want to limit the number of child records. I wanted to limit the
number of id's returned in a model.x.read call.

It's ok though, I am no longer using the one2many field to get some ids'.

Cheers

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


[tryton-dev] read order by create_date

2016-11-23 Thread Vincent Bastos
Is there any reason why ordering by create_date wouldn't work?

Can't I use the following domain - 'create_date', 'DESC'?

Thanks

-- 
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/c7567849-5731-4632-9fa8-27ba79e75b60%40googlegroups.com.


[tryton-dev] Limit of One2Many

2016-11-23 Thread Vincent Bastos
How can I see what the maximum number of id's a One2Many field returns?

-- 
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/9b026ef5-39b5-4c8b-b147-e75a7685dbbc%40googlegroups.com.


Re: [tryton-dev] Where is _get_taxes() defined in invoice.py

2016-11-01 Thread Vincent Bastos
On Tue, Nov 1, 2016 at 9:27 PM, Cédric Krier <cedric.kr...@b2ck.com> wrote:

> On 2016-11-01 21:06, Vincent Bastos wrote:
> > On Tue, Nov 1, 2016 at 6:42 PM, Cédric Krier <cedric.kr...@b2ck.com>
> wrote:
> >
> > > On 2016-10-31 23:27, Vincent Bastos wrote:
> > > > I don't know why but I can't find _get_taxes() in invoice.py for an
> > > invoice.
> > > >
> > > > For example at line 514 [1] in invoice.py of account_invoice. I am
> > > assuming
> > > > that there should be a line starting with def _get_taxes(?
> > >
> > > It comes from the TaxableMixin defined in account/tax.py
> >
> >
> > How does invoice.py know about TaxableMixin?
>
> It is imported and inherited.


My bad, I was searching in the wrong file just then. I should stop opening
so many tabs in my browser ...

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


Re: [tryton-dev] Where is _get_taxes() defined in invoice.py

2016-11-01 Thread Vincent Bastos
On Tue, Nov 1, 2016 at 6:42 PM, Cédric Krier <cedric.kr...@b2ck.com> wrote:

> On 2016-10-31 23:27, Vincent Bastos wrote:
> > I don't know why but I can't find _get_taxes() in invoice.py for an
> invoice.
> >
> > For example at line 514 [1] in invoice.py of account_invoice. I am
> assuming
> > that there should be a line starting with def _get_taxes(?
>
> It comes from the TaxableMixin defined in account/tax.py


How does invoice.py know about TaxableMixin?


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


[tryton-dev] Where is _get_taxes() defined in invoice.py

2016-11-01 Thread Vincent Bastos
I don't know why but I can't find _get_taxes() in invoice.py for an invoice.

For example at line 514 [1] in invoice.py of account_invoice. I am assuming 
that there should be a line starting with def _get_taxes(?

[1] 
- 
https://bitbucket.org/tryton/account_invoice/src/5a47902594a6f0c8b206f1e2cfe0b6968f94d9e5/invoice.py?at=default=file-view-default#invoice.py-514

-- 
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/d325fb11-f04e-45b6-8226-83506e68dd03%40googlegroups.com.


Re: [tryton-dev] Account Payments

2016-10-12 Thread Vincent Bastos
On Wed, Oct 12, 2016 at 5:05 PM, Vincent Bastos <vinc...@lavalab.com.au>
wrote:

>
> On Tue, Oct 11, 2016 at 5:33 PM, Cédric Krier <cedric.kr...@b2ck.com>
> wrote:
>
>> On 2016-10-10 23:19, Vincent Bastos wrote:
>> > Hi,
>> >
>> > We had a bit of a discussion on discuss.tryton.org [1], but the topic
>> of of
>> > the discuss post is note mainly about account payments so I am
>> continuing
>> > this conversation here.
>>
>> Why not a new topic there with a reference?20161011073354.
>> GY99626%40tetsuo
>> <https://groups.google.com/d/msgid/tryton-dev/20161011073354.GY99626%40tetsuo>
>> .
>>
>
> I don't know what I was thinking ... I'll create a new post there so we
> can continue the conversation and add some comments we had yesterday.
>


Actually, there is nothing to add because you updated the behaviour in 4.2
[1]

[1] -
https://bitbucket.org/tryton/account_payment/commits/4cfa613ca3d338dba4bff5b4f8c48736f68e93ca


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


[tryton-dev] Account Payments

2016-10-11 Thread Vincent Bastos
Hi,

We had a bit of a discussion on discuss.tryton.org [1], but the topic of of 
the discuss post is note mainly about account payments so I am continuing 
this conversation here. 

So, in regards to Account Payments, maybe I am missing something, but it 
seems that payment lines are not linked to invoices in anyway even though 
the user actually creates payments from invoice lines using the view "Lines 
to Pay".

I was wondering whether I am the only one who finds this not intuitive?

[1] https://discuss.tryton.org/t/minimal-e-shop-for-tryton/217/7

-- 
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/d9325b79-18a3-45ce-8b3d-31f89dbeae11%40googlegroups.com.


[tryton-dev] formating string in Relatorio

2016-10-10 Thread Vincent Bastos
Hi,

I was wondering if it is possible to format a string in Relatorio "inline"?

-- 
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/87edbba0-2bf4-45db-a14f-161f831b0e20%40googlegroups.com.


[tryton-dev] Re: New wiki

2016-01-27 Thread Vincent Bastos
Hey,

Not sure if you wanted another suggestion, but if you did here is one:

http://waliki.pythonanywhere.com/

But MoinMoin is definitely a proven solution.

-- 
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/79418360-ae1e-4665-a451-0024be2190f4%40googlegroups.com.


[tryton-dev] modules in trytond modules directory

2016-01-19 Thread Vincent Bastos
Hi,

I noticed that if you create a Python module with a name that does not 
start with the word "trytond", its files are not copied to the modules 
directory inside the trytond python package directory.

Why does Trytond copy the files to this directory? What is the purpose of 
this?

NOTE - I have seen this in version 3.4. I don't know how this works in 
later versions.

Thanks

-- 
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/61364e0e-1109-4976-a74f-723a8fb8fde3%40googlegroups.com.


[tryton-dev] Re: Cookiecutter for Tryton modules

2016-01-17 Thread Vincent Bastos
Excellent!

-- 
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/03a4c96e-0402-460c-b08a-71e99d06a799%40googlegroups.com.


Re: [tryton-dev] Create a new item under an existing menu

2015-12-29 Thread Vincent Bastos
The error was a "development workflow" error. Earlier, I had run >python
setup.py install and lately I was using develop. The develop function does
not update/override the module directory under the trytond directory.

On Tue, Dec 29, 2015 at 5:59 PM, Guillem Barba Domingo <
guillemba...@gmail.com> wrote:

>
> El 24/12/2015 7:50 a. m., "Raimon Esteve" <rest...@zikzakmedia.com>
> escribió:
> >
> >
> > El dia 24/12/2015 6.28, "Vincent Bastos" <vinc...@lavalab.com.au> va
> escriure:
> >
> > >
> > > Hey,
> > >
> > > I am trying to create a new item under the Party menu.
> > >
> > > I thought that this would work but it does not seem to work as no item
> appears in the menu:
> > >
> > >> >   id="menu_badge_window" sequence="20" />
> > >
> > > Having said that after I run the command to update Tryton ( -u
>  ) I don't see a menu entry in the menu table of Postgres, so
> perhaps my issue is not with the programming/syntax but more about updating
> the module for some reason.
> >
> > In tryton.cfg file, do you added your filename in xml section?
>
> Do you have permissions over the model that is opened from this menu?
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "tryton-dev" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tryton-dev/CAMgcrAw52VearYHHu2ysg3hLg%2B2WDvLiAx1a7njtM5%3DEX%2BgJdg%40mail.gmail.com
> <https://groups.google.com/d/msgid/tryton-dev/CAMgcrAw52VearYHHu2ysg3hLg%2B2WDvLiAx1a7njtM5%3DEX%2BgJdg%40mail.gmail.com?utm_medium=email_source=footer>
> .
>



-- 
*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/CACLX58BYGhwFCaBmTnsnZXXmEA%3DMEVTVZifOZnRYmFZvar-AAQ%40mail.gmail.com.


[tryton-dev] how to add unique contraint on char field

2015-12-08 Thread Vincent Bastos
Hi,

How do you add a unique constraint on a char field?

-- 
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/5c3b718d-1e3a-47b3-bf28-76b54906c044%40googlegroups.com.


Re: [tryton-dev] Ubuntu Upstart script

2015-10-14 Thread Vincent Bastos
Thank you for that. After I send the email I did end up going with
supervisor.

On Mon, Oct 12, 2015 at 11:47 PM, hyan...@gmail.com <hyan...@gmail.com>
wrote:

> Hi Vincent,
>
> You can use @reboot with cron
>
> https <https://help.ubuntu.com/community/CronHowto>://
> <https://help.ubuntu.com/community/CronHowto>help.ubuntu.com
> <https://help.ubuntu.com/community/CronHowto>/
> <https://help.ubuntu.com/community/CronHowto>community
> <https://help.ubuntu.com/community/CronHowto>/
> <https://help.ubuntu.com/community/CronHowto>CronHowto
> <https://help.ubuntu.com/community/CronHowto>
>
> Or autostart=true with supervisord
>
>
> https://www.digitalocean.com/community/tutorials/how-to-install-and-manage-supervisor-on-ubuntu-and-debian-vps
>
> Best,
>
> Humberto
> Hi,
>
> I was wondering if anyone had a good example of a simple Upstart script
> for Ubuntu 14.04?
>



-- 
*Vincent Bastos*
*Lava Lab Software*


[tryton-dev] Ubuntu Upstart script

2015-10-12 Thread Vincent Bastos
Hi,

I was wondering if anyone had a good example of a simple Upstart script for 
Ubuntu 14.04?


[tryton-dev] Need more tests

2015-10-04 Thread Vincent Bastos
Still need more tests?

[tryton-dev] Re: Expenses on project

2015-09-09 Thread Vincent Bastos


On Wednesday, September 2, 2015 at 1:20:06 AM UTC+10, Cédric Krier wrote:
>
> Hi, 
>
> I'm looking for a way to put expenses (purchases) into the cost of a 
> project. 
> The usual way I have seen in similar software is to use analytic account 
> but I think it is not the correct way for 2 reasons:  


> - analytic accounting almost always misses the employee cost 
>   (because it is too much work) 
>
> - analytic accounting is a normally tool design to allow users to 
>   create its own/custom accounting view (not for developers) 
>
> So for now, the project_revenue module computes a theoretical revenue 
> (list price * effort) and a cost (timesheet * employee cost). 
> It is only missing the expenses to get the complete picture of the 
> profitability of a project/task. If we use the project_invoice module to 
> know the real/invoiced revenue. 
>
> So my proposal is to add on project_revenue an extra_depends on purchase 
> which will add a many2one field on purchase line to a project (with 
> possibility to add line to project later via a one2many on it). 
> With this link we could include the invoiced amount of those purchase 
> line to the cost of the project. 
>
> Of course some could say that sometimes a purchase line is linked to 2 
> projects. I think it is a very rare case that could be solved by 
> splitting the line in two. 
>
> So what do you think? 
>
> Thanks, 
> -- 
> Cédric Krier - B2CK SPRL 
> Email/Jabber: cedric...@b2ck.com  
> Tel: +32 472 54 46 59 
> Website: http://www.b2ck.com/ 
>

Could you explain how the analytic account method is implemented? Or point 
to a good documentation?

I will also need to investigate how Tryton manages projects and costs, but 
I am familiar with implementations from other accounting software where it 
is possible to report on specific groups of expenses as well as sale lines.

1. The one I like best is Saasu which allows the user to add and create 
tags on each line of a purchase or sale. As it is possible to have more 
than one tag, lines can be associated with more than one "project". These 
tags can be used in reports such as Profit and Loss to show only values 
from specified tags.
2. Xero has a similar concept but they call it categories rather than tags.

This solution would avoid splitting the line in 2 except when the actual 
amounts need to be specifically linked to only one project. But there is 
also the scenario where expenses need to be linked to 2 different 
"projects" because of requirements from different government departments. 
It's like having more than one Chart of Accounts. This is relevant in the 
mining industry here in Australia where companies need to report to the 
mining departments based on mining licences. Instead of having deep trees 
where every expense account has sub accounts for each project it is better 
to have 2 separate chart of accounts. I have seen companies simply manage 2 
copies of their accounting files: one for tax office and one for the mining 
department.


Re: [tryton-dev] Taking picture from Camera

2015-07-13 Thread Vincent Bastos



 Even more, if a tablet or phone is used it is already possible to take 
 a picture simply using the file selection widget already used in 
 attachments, for example. 


Albert,

Only with the web client right?


[tryton-dev] network

2014-12-10 Thread Vincent Bastos
Hi,

I was wondering whether there was an old thread regarding the core design 
choice for the amount of network requests made by the GTK client?

I feel that this is a relevant question in light of the fact that the 
community is pushing for a generic web client.

I noticed that for each view the client makes many calls to the server, I 
find that this goes against best practice principals as network requests 
are expensive.

Is the answer simply that it is much easier to develop a generic client in 
this way?

To be honest I have not monitored the GTK network requests; I am actually 
going off what I noticed in the SAO client.

I noticed that for the party view for example lots of calls are made for 
each of the different models requests.

Wouldn't it be better to have a single end point for party that would 
provide all the required data in a single response rather than a number of 
response.

I have not had a look at the code for the GTK client at all, so I guess my 
next step is to look at that first to understand how it works.

Cheers,