Re: [tryton-contrib] network vs. asset module

55 views
Skip to first unread message

Albert Cervera i Areny

unread,
Jul 16, 2014, 7:49:39 PM7/16/14
to tryto...@googlegroups.com
2014-07-16 22:39 GMT+02:00 Cédric Krier <cedric...@b2ck.com>:
> On 10 Jul 16:39, Albert Cervera i Areny wrote:
>> Hi,
>> we just did the first commit of a new module named 'network' [1]. The
>> module is intended to allow describing the IT infrastructure with the
>> flexibility of having physical machines, virtual machines inside them,
>> applications, services, raids, hard drives and relate them easily with
>> the same mechanism provided by the party_relationship module. Things
>> are not always hierarchical: for example, a server can have two hard
>> drives but they are also shared by the RAID of the server so you need
>> links between all elements (RAID, hard drives and server).
>>
>> It also allows the user to define attributes to each network item
>> acording to its type. For example, "eth0 from server X" will be of
>> type "Network Interface" and as such can have IPs, Card Model, Serial
>> number, whatever.. This' been implemented with the dict field (just
>> like product_attribute module).
>>
>> The thing is that the resulting module is very generic and I'm
>> thinking that it might make sense to name it "asset" and use it to
>> define not only IT elements but any kind of asset of a company.
>> Indeed, I'd say it's very similar to the basic structure a CMMS [2]
>> provides. I'm thinking each asset could have (with an extra module) a
>> m2o to stock.lot and (with another module) a o2m to account.asset.
>>
>> Thoughts?
>
> OK let's move the discussion to tryton-dev@ and start a blueprint.
> Initial thoughts are there should be at least two modules:
>
> - asset (probably with possible link with account_asset)
> - asset_relationship

As suggested by Cédric I move the discussion to tryton-dev. I just
created a wiki page with the initial blueprint and model definitions
just like they currently look in the network module [1] only replacing
"network.item" by "asset".


[1] https://bitbucket.org/nantic/trytond-network


--
Albert Cervera i Areny
Tel. 93 553 18 03
@albertnan
www.NaN-tic.com

Cédric Krier

unread,
Jul 17, 2014, 9:43:49 AM7/17/14
to tryto...@googlegroups.com
Base on https://code.google.com/p/tryton/wiki/Assets

I think it should be more integrated with account_asset.
So for me, asset should be linked to a product of type asset (not
necesseray depreciable) and the account_asset should link to this asset
instead of product.

I will reuse the same terms for Dict stuffs as in product_attribute and
move it to a module asset_attribute

The icon stuff should be in a separate module and even perhaps for
custom module.

name and code seem redondant
notes should be replaced by
https://code.google.com/p/tryton/wiki/StickyNote

The linkage with stock_lot doesn't seem to me as a real benefit. But it
could be a simple informational link if both modules are installed.

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

Albert Cervera i Areny

unread,
Jul 17, 2014, 10:16:47 AM7/17/14
to tryto...@googlegroups.com
In fact, maybe we could even remove the m2o to asset.type and replace
it with the link to product.product. So we simply drop the asset.type
model.

> I will reuse the same terms for Dict stuffs as in product_attribute and
> move it to a module asset_attribute

Agreed and relates with my comment above.

> The icon stuff should be in a separate module and even perhaps for
> custom module.

Ok.

> name and code seem redondant

I don't think they're redundant. I see it just like party and product
which both have product and code. Though maybe we could make it work
like in party, by default. So the sequence is not required.

> notes should be replaced by
> https://code.google.com/p/tryton/wiki/StickyNote

Ok.

> The linkage with stock_lot doesn't seem to me as a real benefit. But it
> could be a simple informational link if both modules are installed.

It should not be a requirement but it has some use cases. For example,
a company who sells a large machine for which it later manages its
maintenance for the customer. When sold, it should use the lot as a
serial number but as soon as it starts doing the maintenance it will
need to create the asset.

I think that whereas the relationship between asset and account.asset
should be o2m (you can have different depreciation tables because the
asset is paid in several invoices) I think the link between stock.lot
and asset it would be a o2o. At least I cannot imagine a reason for
o2m or m2o here.

Cédric Krier

unread,
Jul 17, 2014, 10:46:28 AM7/17/14
to tryto...@googlegroups.com
On 17 Jul 16:16, Albert Cervera i Areny wrote:
> > name and code seem redondant
>
> I don't think they're redundant. I see it just like party and product
> which both have product and code. Though maybe we could make it work
> like in party, by default. So the sequence is not required.

It is. You will have generated code or custom name but not both.
So I guess it should be possible to do it like for party code.

> > The linkage with stock_lot doesn't seem to me as a real benefit. But it
> > could be a simple informational link if both modules are installed.
>
> It should not be a requirement but it has some use cases. For example,
> a company who sells a large machine for which it later manages its
> maintenance for the customer. When sold, it should use the lot as a
> serial number but as soon as it starts doing the maintenance it will
> need to create the asset.

I think it is wrong. Something you have sold can not be an asset.

> I think that whereas the relationship between asset and account.asset
> should be o2m (you can have different depreciation tables because the
> asset is paid in several invoices).

I don't agree. You don't have many depreciation for the same asset. If
you have many invoices for the same asset, you just don't link the asset
to any invoice line and manage the amount manually.

> I think the link between stock.lot
> and asset it would be a o2o. At least I cannot imagine a reason for
> o2m or m2o here.

I think o2o is wrong, it should be many2one. Because a lot is not
necessary a unique serial number. So with a many2one, it will be more
flexible.

Albert Cervera i Areny

unread,
Jul 17, 2014, 11:28:19 AM7/17/14
to tryto...@googlegroups.com
2014-07-17 16:46 GMT+02:00 Cédric Krier <cedric...@b2ck.com>:
> On 17 Jul 16:16, Albert Cervera i Areny wrote:
>> > name and code seem redondant
>>
>> I don't think they're redundant. I see it just like party and product
>> which both have product and code. Though maybe we could make it work
>> like in party, by default. So the sequence is not required.
>
> It is. You will have generated code or custom name but not both.
> So I guess it should be possible to do it like for party code.

Maybe not name but I think that a 'description' not required field
makes a lot of sense.

>> > The linkage with stock_lot doesn't seem to me as a real benefit. But it
>> > could be a simple informational link if both modules are installed.
>>
>> It should not be a requirement but it has some use cases. For example,
>> a company who sells a large machine for which it later manages its
>> maintenance for the customer. When sold, it should use the lot as a
>> serial number but as soon as it starts doing the maintenance it will
>> need to create the asset.
>
> I think it is wrong. Something you have sold can not be an asset.

I understand you mean that the asset must be owned by the company but
I don't see a reason for limiting this. The activity of a company can
be managing other companies assets.

>> I think that whereas the relationship between asset and account.asset
>> should be o2m (you can have different depreciation tables because the
>> asset is paid in several invoices).
>
> I don't agree. You don't have many depreciation for the same asset. If
> you have many invoices for the same asset, you just don't link the asset
> to any invoice line and manage the amount manually.

What's the problem with managing it this way? Anyway I think your idea
is to add a m2o from account.asset to asset, so it is up to the user
if he wants to create one or several account assets.

>
>> I think the link between stock.lot
>> and asset it would be a o2o. At least I cannot imagine a reason for
>> o2m or m2o here.
>
> I think o2o is wrong, it should be many2one. Because a lot is not
> necessary a unique serial number. So with a many2one, it will be more
> flexible.

Good point.

Sergi Almacellas Abellana

unread,
Aug 7, 2014, 3:58:40 AM8/7/14
to tryto...@googlegroups.com

El dijous 17 de juliol de 2014 17:28:19 UTC+2, Albert Cervera i Areny va escriure:
May this field be required or optional?
>
>> I think the link between stock.lot
>> and asset it would be a o2o. At least I cannot imagine a reason for
>> o2m or m2o here.
>
> I think o2o is wrong, it should be many2one. Because a lot is not
> necessary a unique serial number. So with a many2one, it will be more
> flexible.

Good point.

I just uploaded a review that implements it:

http://codereview.tryton.org/8501002/
-- 
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk
Reply all
Reply to author
Forward
0 new messages