Carrier Exchange specification
Blueprint information
- Status:
- Not started
- Approver:
- None
- Priority:
- Undefined
- Drafter:
- David BEAL (ak)
- Direction:
- Needs approval
- Assignee:
- None
- Definition:
- New
- Series goal:
- None
- Implementation:
- Unknown
- Milestone target:
- None
- Started by
- Completed by
Related branches
Related bugs
Sprints
Whiteboard
Account / sub account in multi-companies context
=======
postlogistics, coliposte, chronoposte, gls use this concept. name is licence for postlogistics but appeared like the same concept.
For companies with multi-company implementation it seems to be mandatory
Surely we can share the implementation (at least some fields) and basic behavior.
I suggest to define the chronopost implementation on this matter turn in generic way and check if we could go in this way for odoo version 8 or 7
florian-dacosta : Chronopost Case
-------
I have to handle multi-accounts and subaccount. For that, Instead of implementing my config fields (account, password, etc...) directly on res.company, I create a new object (chronopost.
For the sub account, I just add a field parent_id on my relation (chronopost.
Ideas to make it generic
-------
1) (florian) Put a one2many on res.company, relation with a new class carrier.
In the specific carrier modules, we would have to inherit this new class to add the fields custom for our carrier. A normal account would not have parent_id. A sub account would have a parent_id.
==> The problem I see, is that if many carrier are implemented, the class will have a lot of fields, usefull only for 1 carrier. But we could handle the view hiding fields depending of the type.
Also, I am not sure thise is easy for postlogistics which have licence instead of subaccount.
(yannick) could be a xml view nightmare to ensure a field is visible for carrier A & B but not C.
2) (florian) Add a new abstract class carrier.
In the specifics carrier modules, we would have to inherits this class with specific-
==> The main problem is, this way, we can't define the one2many relation on res.company in the base_delivery_
(yannick) this one make more sens to me than (1) you will already need to add fields specific to your carrier. Adding a one2many to the right classes on res_company in each module looks good.
3) (david) Implement a full flexible management of this concept (a bit complex but few redondancy) :
- have a model 'carrier.account' (in base_delivery_
- have a model to store specific carrier fields which inherits from 'carrier.account'
It also allows to store account and subaccount (or licence) if any
Fields repartition could be : fields used by 80% of carriers are in 'carrier.account' others in inherits (20-80% rule)
We can use 'carrier.account' model to share default behaviors in methods or use method like an interface to uses cases
In first look, in general, things are not generic (especially with carrier) but if you have a flexible way to store/define objects, common rules can be shared.
Global remarks:
- (yannick)
file_format: in postlogistics file_format is an option as depending on delivery method I could want a specific file format. This is maybe caused by the multiple possibilities of service for one license. one license -> multiple format. Thus I would prefer not having it there.
- type: I wish inherits were simplier to use... this needs to be defined by view and could be invisible.
- 2 and 3 are != ?
Carriers Options Management
=======
Up to now delivery methods options have 3 states : optional, optional by default and mandatory. It's not sufficient.
Things that can be done :
- allow to have select field or other field type.
(yannick) Selection field would solve the need of optionnal mandatory option. I mean you need at least option A or option B.
- split optional and optional state : developper might define optional option and user/admin could choose 'by default' or not
(yannick) what you mean is that you want to be able to set which options are mandatory and which ones are optional in XML file. Then let the "delivery method configuration manager" (who ever could this user be) define which option should be added by default. And this should only be possible for optionnal option thus hidden for mandatory options.
I think things what have be done in postlogistics for options management could be useful in base module or at least concept
(yannick) about options one thing which is important in postlogistics is which option depends on other. That's why a template option comes with fields like 'postlogistics_
(yannick) GUI: I wonder if anything could be done to show those option by forging the view of delivery.method a bit like in user access right panel. It could makes things simplier for the user.
Thanks for your comments
Work Items
Work items:
[florian-dacosta] (akretion) propose a generic implementation: DONE
[yvaucher-c2c] : give feedback on proposal: DONE