thaond / magento-openerp-smile-synchro

Automatically exported from code.google.com/p/magento-openerp-smile-synchro
0 stars 0 forks source link

allow per record Magento synch; usefull when many records (like products to upload) #10

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Ideally, uploadable records such as products that can be many should have a
wizard button in their OpenERP form view so that one can update the edited
record on Magento in a single click.

Ideally, the upload wizard would take an 'ids' argument that would be only
[the_current_id] when displaying a specific record (form view) or a list of
several ids if selecting the records to update from a list view.
This is provided by the standard OpenERP system. Only the upload action
should be coded with the appropriate signature.

Also, that upload action should actually have most of its code multualized
with the already existing mass upload wizard that upload all products fro
instance without getting the ids passed currently.

So for instance, to upload selected products, one would use most of the
code of the def _do_export(self, cr, uid, data, context) method in wizard/
magento_product_synchronize.py
but instead of getting products ids with prod_ids =
pool.get('product.product').search(cr, uid, [('exportable','=',True)]) , we
would use the passed ids in the wizard method signature.

That wouldn't make uploading 25 000 products any faster, but that could
make it easier to maintain them in synch.

Any taker?

Original issue reported on code.google.com by rva...@gmail.com on 17 Sep 2008 at 11:04

GoogleCodeExporter commented 8 years ago

Original comment by rva...@gmail.com on 17 Sep 2008 at 11:35

GoogleCodeExporter commented 8 years ago
Yes I agree this is exactly the kind of approach we should be taken. Modularize 
the
code a bit better so the core syncing code is written once and used in several
different ways.

I am still a fan of updates happening automatically on save if they are flagged 
to
sync with Magento though, so this would happen transparently.

But there may also be the need to sync from Magento to OpenERP (in other words 
drive
the updates from Magento, so we should keep that in mind. Maybe support both?

Original comment by nip...@gmail.com on 18 Sep 2008 at 1:44

GoogleCodeExporter commented 8 years ago
Also, if we add a per record upload feature, then we can trigger it by XML/RPC 
from
Magento in a single (or so) call. Indeed, every wizard action can be called as
XML/RPC. A good way to see how the OpenERP GTK client communicate to the server 
with
XML/RPC and thus automate part of GUI actions in any remote language, is to 
start
your GTK client with the following options:
tinyerp-client.py --log=rpc --log-level=debug

Then just fire the appropriate XML/RPC call. So actually, this is only:
* a per record update to refactor
* an extra wizard button to trigger the record update from the GTK client
* an on_update (or alike) callback to implement to trigger the update on save
* an XML/RPC trigger from Magento to the per record synch action with an 
appropriate
product id and OpenERP login parameters.

Original comment by rva...@gmail.com on 18 Sep 2008 at 3:48

GoogleCodeExporter commented 8 years ago
Guys, we also need to give an answer to this one:
If we code such an easy OpenERP multi-selection product synch button that can
eventually be used for a signle record, is there a point having that button for 
a
single record (eg in the product from view) if we override the product_product 
save
function so that it trigger the update anyway after any change?
On the other side, I don't see yet how we can easily have multi product 
selection
synch feature (in the OpenERP product list view) without having the button on 
every
single product form. So at worse that would only mean a button that is sometimes
useless, not that bad. Anybody has a better idea?

Raphaël Valyi.

Original comment by rva...@gmail.com on 19 Sep 2008 at 9:35

GoogleCodeExporter commented 8 years ago
I don't think it's needed for a single record, but can see a use for selecting 
a few
to perform it on. Isn't there an easy way to do this with the action links that 
can
appear next to screens?

charles

Original comment by nip...@gmail.com on 21 Sep 2008 at 9:34

GoogleCodeExporter commented 8 years ago
Hi
the lastest version on trunk allow you to update categories and products on 
Magento
on 3 ways :
- On the main menu, the wizard will synch all of your categories and products
- On a tree view of the categories and products, the wizard will take only the
selected items.
- On a form view of the categories and products, the wizard will take the 
current item.

Now we will see about a automatic update of the items when they are saved..

Original comment by GrouhPamart on 25 Sep 2008 at 1:12

GoogleCodeExporter commented 8 years ago
Before you do any coding for the automatic updates of items when they are saved,
please look at the module I created for the Magento side. I believe the 
direction we
should take is to add controllers to this module for all the major pieces 
(products,
categories, etc) and add xmlrpc support to those controllers to do the work if 
not
supported natively by xmlrpc/web services, or requires more logic than a few 
simple
web calls. 

thanks,
charles

Original comment by nip...@gmail.com on 25 Sep 2008 at 1:32

GoogleCodeExporter commented 8 years ago
Oh, and I should have mentioned that one approach would be to add our own apis
(extend the existing api) for the missing functionality which might lead to it 
being
adopted by magento into the core if it is general enough.

http://www.magentocommerce.com/wiki/doc/webservices-api/custom-api

Original comment by nip...@gmail.com on 25 Sep 2008 at 1:42

GoogleCodeExporter commented 8 years ago
We'll look at this closely for orders treatment.

Since products and categories APIs are native in Magento,
we have made that automatic update.

Original comment by GrouhPamart on 26 Sep 2008 at 5:40

GoogleCodeExporter commented 8 years ago

Original comment by GrouhPamart on 26 Sep 2008 at 5:41

GoogleCodeExporter commented 8 years ago
OK, done in version 0.9.8

Charles, we are now merging your sale order push feature by the way, but I 
think this
is just an other topic, let's close that RFE then.

Raphaël Valyi

Original comment by rva...@gmail.com on 28 Oct 2008 at 10:24

GoogleCodeExporter commented 8 years ago

Original comment by rva...@gmail.com on 28 Oct 2008 at 10:24