Merge lp:~akretion-team/openerp-connector-magento/7-flag-sync-in-storeview-cde into lp:~openerp-connector-core-editors/openerp-connector-magento/7.0-next-release

Proposed by Chafique DELLI
Status: Merged
Approved by: Guewen Baconnier @ Camptocamp
Approved revision: 990
Merged at revision: 988
Proposed branch: lp:~akretion-team/openerp-connector-magento/7-flag-sync-in-storeview-cde
Merge into: lp:~openerp-connector-core-editors/openerp-connector-magento/7.0-next-release
Diff against target: 69 lines (+18/-2)
2 files modified
magentoerpconnect/magento_model.py (+14/-1)
magentoerpconnect/magento_model_view.xml (+4/-1)
To merge this branch: bzr merge lp:~akretion-team/openerp-connector-magento/7-flag-sync-in-storeview-cde
Reviewer Review Type Date Requested Status
David BEAL (ak) (community) Approve
Guewen Baconnier @ Camptocamp code review Approve
Review via email: mp+219694@code.launchpad.net

Commit message

add synchronization flag for sale order import from a Storeview

Description of the change

add synchronization flag for sale order import from a Storeview
concrete use cases: a Storeview is active on Magento but we do not want to manage the orders of this Storeview on OpenERP.

To post a comment you must log in.
989. By Chafique DELLI

[IMP] add help on field no_import_sync

Revision history for this message
David BEAL (ak) (davidbeal) wrote :

LGTM to me, no test

Thanks for the contribution

review: Approve
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Hi,

thanks for the proposal.

A field named 'no_import_sync' should deactivate *all* the synchros of the store view, in that case, I wonder if it could have more impact and the help message should now be focused on the import of sales orders.

If it should really disable only the sales orders, the name should be more specific, like 'no_sales_order_sync'.

review: Needs Fixing
990. By Chafique DELLI

[IMP] modification of the fields named "no_import_sync" for a more specific name "no_sales_order_sync"

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

LGTM
Thanks

review: Approve (code review)
Revision history for this message
David BEAL (ak) (davidbeal) wrote :

LGTM
Thanks

review: Approve
Revision history for this message
Chafique DELLI (chafique-delli) wrote :

Thank you Guewen and David for the Review.

Regards

Le 26/05/2014 09:59, Guewen Baconnier @ Camptocamp a écrit :
> Review: Approve code review
>
> LGTM
> Thanks

--
Chafique DELLI
www.akretion.com/fr
intégration OpenERP
35B rue Montgolfier
69100 Villeurbanne
Email: <email address hidden>
Tél.+33 (0)4 82 53 84 61

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'magentoerpconnect/magento_model.py'
2--- magentoerpconnect/magento_model.py 2014-05-06 09:33:40 +0000
3+++ magentoerpconnect/magento_model.py 2014-05-23 14:36:06 +0000
4@@ -287,7 +287,7 @@
5 def _scheduler_import_product_categories(self, cr, uid, domain=None, context=None):
6 self._magento_backend(cr, uid, self.import_product_categories,
7 domain=domain, context=context)
8-
9+
10 def _scheduler_import_product_product(self, cr, uid, domain=None, context=None):
11 self._magento_backend(cr, uid, self.import_product_product,
12 domain=domain, context=context)
13@@ -484,6 +484,14 @@
14 'Import sale orders from date',
15 help='do not consider non-imported sale orders before this date. '
16 'Leave empty to import all sale orders'),
17+ 'no_sales_order_sync': fields.boolean(
18+ 'No Sales Order Synchronization',
19+ help='Check if the storeview is active in Magento '
20+ 'but its sales orders should not be imported.'),
21+ }
22+
23+ _defaults = {
24+ 'no_sales_order_sync': False,
25 }
26
27 _sql_constraints = [
28@@ -495,6 +503,11 @@
29 session = ConnectorSession(cr, uid, context=context)
30 import_start_time = datetime.now().strftime(DEFAULT_SERVER_DATETIME_FORMAT)
31 for storeview in self.browse(cr, uid, ids, context=context):
32+ if storeview.no_sales_order_sync:
33+ _logger.debug("The storeview '%s' is active in Magento "
34+ "but its sales orders should not be imported." %
35+ storeview.name)
36+ continue
37 backend_id = storeview.backend_id.id
38 if storeview.import_orders_from_date:
39 from_date = datetime.strptime(
40
41=== modified file 'magentoerpconnect/magento_model_view.xml'
42--- magentoerpconnect/magento_model_view.xml 2014-04-04 08:46:16 +0000
43+++ magentoerpconnect/magento_model_view.xml 2014-05-23 14:36:06 +0000
44@@ -309,6 +309,7 @@
45 <field name="store_id"/>
46 <field name="sort_order"/>
47 <field name="enabled"/>
48+ <field name="no_sales_order_sync"/>
49 </group>
50 <group string="Options">
51 <field name="lang_id" widget="selection"/>
52@@ -326,7 +327,8 @@
53 <button name="import_sale_orders"
54 type="object"
55 class="oe_highlight"
56- string="Import Sale Orders"/>
57+ string="Import Sale Orders"
58+ attrs="{'invisible': [('no_sales_order_sync', '=', True)]}"/>
59
60 </group>
61 </page>
62@@ -346,6 +348,7 @@
63 <field name="name"/>
64 <field name="code"/>
65 <field name="enabled"/>
66+ <field name="no_sales_order_sync"/>
67 <field name="sort_order"/>
68 <field name="store_id"/>
69 </tree>

Subscribers

People subscribed via source and target branches