OCA / l10n-china

Chinese localization of Odoo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[8.0] Hong Kong SpeedPost & Hong Kong Post - How To Submit Module/PR?

lukebranch opened this issue · comments

@pedrobaeza @elicoidal ,

I'm working on packaging the table rates for Hong Kong SpeedPost and Hong Kong Post into a module for shipping from Hong Kong to the rest of the world via those two carriers.

These two carriers do not offer an API connection (as far as i'm aware) and rates are submitted as PDF documents annually to the public.

I'm wondering if there is already any pre-determined OCA/Odoo format or method for packaging these types of localised shipping rates into a module, as I would like to make this my first submission to the OCA if this is suitable for this repo or carrier-delivery.

Please let me know what would be a suitable format for me to create a PR to this repo or carrier-delivery and i'll work on a PR over the course of this month.

Standard module delivery provide the data model for this kind of pricelists, but I'm not sure if they're the same for all the customers. If there are discounts involved depending on the customer, this forces to rewrite the entire grid, so I'm not sure if your efforts worth the while. Anyway, if you think so, you don't need anything more as I say.

@pedrobaeza ,

For these two providers the rates are fixed. I will be doing this for our company internally so I thought it would be worthwhile to package it into a module for submission to some kind of HK localisation, or similar.

If it's not worthwhile for the OCA that's fine, I just wanted to check if it was worthwhile me submitting this to the OCA, and if so, in what format.

@lukebranch I would use the Odoo standard delivery module as a model for the data. Then you would have to create the data as XML file and embed them into a module that would preload the data (and any additional method.
We could add that module to the l10n-china repo. I can add you in the PSC which has been dormant lately but for which we have as many pending contribution (not yet out for lack of time): wechat payment, alipay payment, some baidu map or ICP certificate for China.
It is not so much about if it worthwhile for the OCA but more: do you think it can be useful for other Hong Kong companies.

@elicoidal ,

Thanks for the explanation, i'll look into packaging the data as XML and add it to the standard delivery grid rates.

For reference these are the rates i'll be including for HK SpeedPost:

http://www.hongkongpost.hk/filemanager/common/forms/pos15a_rate_plan.pdf

In terms of usefulness I know a few hundred others in our industry that are using manually generated delivery grid rates for these carriers for Magento and other platforms, so I think it will definitely be useful for any retail business that ships from Hong Kong.

We will be using this internally for our own group of companies, so I assume it would be useful for others in Hong Kong as well.

I plan to extend this to some other Hong Kong couriers as well. Do you have any preference on the naming designation for the modules?

I was thinking:
delivery_carrier_hkspeedpost
delivery_carrier_hkpost
delivery_carrier_sfexpress
delivery_carrier_...

Is this suitable for you or would you prefer some other naming convention due to the fact these will basically be data modules to add delivery rates to Odoo for Hong Kong based businesses?

@lukebranch
I think this is very localized data so I would tend to l10n-hk_delivery_carrier_hkspeedpost etc
@pedrobaeza any good idea?
BTW: you can check how the demo data is packaged for the standard code.

@elicoidal ,

Thanks, i'll take a look. I'll start working on it with your naming convention and wait for Pedro in case there are changes before submitting a PR.

My name suggestion is l10n_hk_delivery_hkspeedpost.

@elicoidal @pedrobaeza ,

I'll use:

l10n_hk_delivery_hkspeedpost

as this:

10n-hk_delivery_carrier_hkspeedpost

won't be visible in modules list with the hyphenation. If any changes need to be made to this module name please let me know.

In regards to submitting a PR, i'll follow these guidelines:

https://odoo-community.org/page/code

are there any other formatting considerations I need to keep in mind before I submit to make sure it passes automated testing?

No that I think just right now, but the review process can say it later.

@pedrobaeza ,

Thanks, i'll fork it now and get started. I'll close this issue and just comment on the PR once submitted.

For anyone else that comes across this thread, development will be happening here:

https://github.com/OdooCommunityWidgets/l10n-china/tree/8.0

Fine by me. Thanks @lukebranch for the contribution!

@elicoidal @pedrobaeza ,

Thanks for your help with the submission process!

@elicoidal @pedrobaeza ,

I've put together most of the framework for the module and separated rates by country into separate xml files to allow for some modularity later on down the line if necessary.

If you have a spare minute would you mind taking a look at (the only complete rates file - the rest are just placeholders at the moment):

https://github.com/OdooCommunityWidgets/l10n-china/blob/8.0/l10n_hk_delivery_hkspeedpost/__openerp__.py

https://github.com/OdooCommunityWidgets/l10n-china/blob/8.0/l10n_hk_delivery_hkspeedpost/rates/delivery_rates_us.xml

to see if i'm on the right track in terms of what the OCA will accept as a submission?

I'm adding delivery grid and grid lines like this:

        <record id="delivery_grid_us" model="delivery.grid">
            <field name="name">HK SpeedPost (美國 United States of America)</field>
            <field name="carrier_id" ref="delivery_carrier"/>
            <field model="res.country" name="country_id" search="[('code','ilike','us')]"/>
        </record>
        <!--  delivery charge of product if weight less than or equal 0.5kg-->
        <record id="delivery_grid_line12421" model="delivery.grid.line">
            <field name="grid_id" ref="delivery_grid_us"/>
            <field name="operator">&lt;=</field>
            <field name="type">weight</field>
            <field name="price_type">fixed</field>
            <field name="sequence">10</field>
            <field name="name">Weight &lt;= 0.5kg</field>
            <field eval="0.5" name="max_value"/>
            <field eval="176" name="list_price"/>
            <field eval="176" name="standard_price"/>
        </record>

Before I tackle the 200+ rates xml files i'd just like to check and see if i'm on the right track, or if some tweaks need to be made to be in line with OCA submission requirements.

After i'm done with HK SpeedPost and HK Post, i'll work on some other courier modules for the HK Localisation.

@elicoidal on another unrelated note I can't seem to find the HK COA created by BrowseInfo in this repo, did they ever make a submission to the OCA?

If not, I'm considering working with some other HK-based partners/developers on submitting an alternative to this l10n-china repo if BrowseInfo are no longer interested in submitting one specifically for inclusion in this repo.

I see no special problem with the XML, so go ahead.

@lukebranch For the HK CoA, I have had no news lately indeed. The project was (almost) finished: I will ask them again and if no real reply we can just fork if necessary to the OCA.

@lukebranch Well surprise: the repo is not here anymore... Asking them...
Anyway I must have a branch which is quite up to date

@pedrobaeza ,

Thanks, i'll continue as is with the rest of the rates files.

@elicoidal ,

They seem to have moved it to bitbucket for some reason:

https://apps.openerp.com/apps/modules/8.0/l10n_hk/

Either way if they decide they don't want to go the OCA route I think @yostashiro was interested in collaborating on this (HK COA) when the topic was first brought up in the community mailing lists. Between you both you probably have the accounting stuff sorted, but if there's any contribution I can make i'd be more than happy to help out.

@lukebranch good catch. Unfortunately the repository is private (main reason to go to bitbucket I think) even if it is not a real issue as the license is AGPL and module is available for download.
I am waiting for their feedback and will keep you posted.

@elicoidal ,

Thanks, i'll keep an eye on this (l10n-china) repository for updates on the COA.