openerp-connector-community team mailing list archive
-
openerp-connector-community team
-
Mailing list archive
-
Message #00093
Re: Multi-company and update stock level
Guewen,
Thank you very much for your insight.
In Magento, we have 2 websites and they don't share any data.
Each site has its own set of :
* partner groups
* partners
* product categories
* products
One site is for B2C and the other for B2B.
Stock level is not a problem, because one product has no inventory in the other company.
Regards,
--
Maxime Chambreuil
+1 (514) 276-5468 #126
----- Mail original -----
Hi,
At least for sales orders, we can use the company on the magento.store
(thus sale.shop), it would simplify the configuration. If the company
is necessary for models which are not linked to a store but only to a
website, the company would become necessary on the website though. Do
you know which models may need a company?
I had this exact same problem on a custom connector recently, and I
think it can be resolved in a generic manner. Here is an excerpt of
this connector with the interesting parts:
http://hastebin.com/copageqodo.py
What you will see:
- I added a 'connector_user_id' m2o on company to a user
- In the base importer, I extracted an '_import()' method so I can inherit it
- And the clever part: in the importers requiring to import records
in the context of a company, I switch to the user configured on the
company (with self.session.change_user(user.id):)
I think that we need to have dedicated users for the companies so we
are sure that the appropriate properties, record rules and so on are
applied. It needs a bit of configuration though.
To be generic, we would need to allow to have *no* connector user
configured on companies, in that case it would mean that we are not in
a multi-company environment (simple case).
Regarding the export of stock level, each time it is ran, it updates a
field on magento.product.product with the current quantity and if it
has changed since the last update, it delays an export job. I don't
remember exactly but as I write it now, it seems related to 1 company
(warehouse configured on the magento backend?), but it also seems to
me that Magento only accept one global stock level.
Wish you a happy new year,
Guewen
Guewen Baconnier
Business Solutions Software Developer
Camptocamp SA
PSE A, CH-1015 Lausanne
Phone: +41 21 619 10 39
Office: +41 21 619 10 10
http://www.camptocamp.com/
On Thu, Jan 2, 2014 at 2:07 PM, Maxime Chambreuil
<maxime.chambreuil@xxxxxxxxxxxxxxxxxxxx> wrote:
> Hello Éric and Happy New Year to everyone!
>
> We are planning to relate a website to a company and use this company to
> import the rest of the data (partner and product categories, partners,
> products and sales orders) as everything seems to be linked to a website in
> Magento.
>
> If there is a better strategy, please let us know.
>
> Thanks.
>
> --
> Maxime Chambreuil
> +1 (514) 276-5468 #126
>
> ________________________________
> Hi Maxime,
> We have developed and successfully set up 3 Magento website (in store) in
> one backend, each one of them is linked to a specific company in OE.
> Current connector will not directly allow this kind of set up so we have had
> to make custom modules. We had no plan to really publish because they would
> require some rework to make them generic (+ we had to change Magento API).
> Besides every product can be published to each store independently through
> category management and sales orders and carts are sync'ed to their own
> company.
> In our case we link stock level from different companies to specific website
> and we update the stock every time a SM is confirmed or set as done in the
> given company. Stock methods are linked to product mappers and methods in
> our case.
>
> In summary this is possible but requires additional work from standard
> Magento connector. Not sure we can really publish in short term something
> but you can contact us for direction if necessary!
>
> Best wishes!
>
> Eric Caudal
> CEO
> --
> Elico Corporation, Shanghai branch
> OpenERP Premium Certified Training Partner
> Cell: + 86 186 2136 1670
> Office: + 86 21 6211 8017/27/37
> Skype: elico.corp
> eric.caudal@xxxxxxxxxxxxxx
> http://www.elico-corp.com
>
> On 12/31/2013 11:59 PM, Maxime Chambreuil wrote:
>
> Hello everyone,
>
> We are currently working on our first OpenERP 7 / Magento 1.7 deployment
> with the new connector. We've managed to make everything working as stated
> in the documentation. Thank you very much for this great work.
>
> There is one thing I would like to confirm. Is the "update stock level"
> suppose to create job(s) in the queue ?
>
> In our project, we are in a multi-company environment :
>
> Company A has 2 store views in Magento : A1 in french and A2 in english.
> Company B has 2 store views in the same Magento : B1 in french and B2 in
> english.
>
> How do I relate 2 store views of the same backend with 2 different companies
> and make sure sales orders are imported in the right company ?
>
> Thank you very much and have a happy New Year's eve.
>
> See you in 2014!
> --
> Maxime Chambreuil
> +1 (514) 276-5468 #126
>
>
>
>
>
> --
> Mailing list: https://launchpad.net/~openerp-connector-community
> Post to : openerp-connector-community@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~openerp-connector-community
> More help : https://help.launchpad.net/ListHelp
>
>
> --
> Mailing list: https://launchpad.net/~openerp-connector-community
> Post to : openerp-connector-community@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~openerp-connector-community
> More help : https://help.launchpad.net/ListHelp
>
Follow ups
References