Merge lp:~gbaconnier-c2c/openobject-addons/extra-6.0-c2c-magento-improvements into lp:openobject-addons/extra-6.0

Proposed by Guewen Baconnier @ Camptocamp
Status: Rejected
Rejected by: Guewen Baconnier @ Camptocamp
Proposed branch: lp:~gbaconnier-c2c/openobject-addons/extra-6.0-c2c-magento-improvements
Merge into: lp:openobject-addons/extra-6.0
Diff against target: 70 lines (+20/-1) (has conflicts)
2 files modified
base_sale_multichannels/sale.py (+18/-1)
base_sale_multichannels/sale_view.xml (+2/-0)
Text conflict in base_sale_multichannels/sale.py
To merge this branch: bzr merge lp:~gbaconnier-c2c/openobject-addons/extra-6.0-c2c-magento-improvements
Reviewer Review Type Date Requested Status
OpenERP Committers Pending
Review via email: mp+59336@code.launchpad.net
To post a comment you must log in.

Unmerged revisions

5353. By Guewen Baconnier @ CampToCamp <email address hidden>

[FIX] base_sale_payment_type: returns the good payment's settings when multiple codes match

5351. By Lorenzo Battistini

[FIX] AgileBG authors

5350. By Jordi Esteve (www.zikzakmedia.com)

[IMP+FIX] Internet Domain:
- Domain Report (rml)
- Example webservice or send email expiration
- [FIX] Duplicity emails when run_mail_scheduler
- Redesing wizard osv_memory

5349. By Launchpad Translations on behalf of openerp-commiter

Launchpad automatic translations update.

5348. By Raphaël Valyi - http://www.akretion.com

[FIX] kettle_connector: fixed issue with param replacement

5347. By Lorenzo Battistini

[FIX] product_pricelist_fixed_price translation

5346. By Launchpad Translations on behalf of openerp-commiter

Launchpad automatic translations update.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'base_sale_multichannels/sale.py'
--- base_sale_multichannels/sale.py 2011-04-20 11:34:11 +0000
+++ base_sale_multichannels/sale.py 2011-04-28 09:28:28 +0000
@@ -289,6 +289,7 @@
289 }289 }
290290
291 def payment_code_to_payment_settings(self, cr, uid, payment_code, context=None):291 def payment_code_to_payment_settings(self, cr, uid, payment_code, context=None):
292<<<<<<< TREE
292 pay_type_obj = self.pool.get('base.sale.payment.type')293 pay_type_obj = self.pool.get('base.sale.payment.type')
293 payment_setting_ids = pay_type_obj.search(cr, uid, [['name', 'like', payment_code]])294 payment_setting_ids = pay_type_obj.search(cr, uid, [['name', 'like', payment_code]])
294 payment_setting_id = False295 payment_setting_id = False
@@ -296,6 +297,18 @@
296 if payment_code in [x.strip() for x in type['name'].split(';')]:297 if payment_code in [x.strip() for x in type['name'].split(';')]:
297 payment_setting_id = type['id']298 payment_setting_id = type['id']
298 return payment_setting_id and pay_type_obj.browse(cr, uid, payment_setting_id, context) or False299 return payment_setting_id and pay_type_obj.browse(cr, uid, payment_setting_id, context) or False
300=======
301 payment_setting_ids = self.pool.get('base.sale.payment.type').search(cr, uid, [['name', 'ilike', payment_code]])
302 # it can happens that a payment_code match 2 payment types like: bank and bankcr.
303 # in such case, we have to search which one is the good one by splitting the payment types and search for the exact match
304 if len(payment_setting_ids) > 1:
305 for payment_setting_id in payment_setting_ids[:]:
306 name = self.pool.get('base.sale.payment.type').read(cr, uid, payment_setting_id, ['name'])['name']
307 if payment_code.lower() in [exact_payment_name.strip().lower() for exact_payment_name in name.split(';')]:
308 payment_setting_ids = [payment_setting_id]
309 break
310 return payment_setting_ids and self.pool.get('base.sale.payment.type').browse(cr, uid, payment_setting_ids[0], context) or False
311>>>>>>> MERGE-SOURCE
299312
300 def generate_payment_with_pay_code(self, cr, uid, payment_code, partner_id, amount, payment_ref, entry_name, date, paid, context):313 def generate_payment_with_pay_code(self, cr, uid, payment_code, partner_id, amount, payment_ref, entry_name, date, paid, context):
301 payment_settings = self.payment_code_to_payment_settings(cr, uid, payment_code, context)314 payment_settings = self.payment_code_to_payment_settings(cr, uid, payment_code, context)
@@ -341,7 +354,10 @@
341 order = self.browse(cr, uid, order_id, context)354 order = self.browse(cr, uid, order_id, context)
342 payment_settings = self.payment_code_to_payment_settings(cr, uid, order.ext_payment_method, context)355 payment_settings = self.payment_code_to_payment_settings(cr, uid, order.ext_payment_method, context)
343 356
344 if payment_settings: 357 if payment_settings:
358 if payment_settings.payment_term_id:
359 self.write(cr, uid, order.id, {'payment_term': payment_settings.payment_term_id.id})
360
345 if payment_settings.check_if_paid and not paid:361 if payment_settings.check_if_paid and not paid:
346 if order.state == 'draft' and datetime.strptime(order.date_order, '%Y-%m-%d') < datetime.now() - relativedelta(days=payment_settings.days_before_order_cancel or 30):362 if order.state == 'draft' and datetime.strptime(order.date_order, '%Y-%m-%d') < datetime.now() - relativedelta(days=payment_settings.days_before_order_cancel or 30):
347 wf_service.trg_validate(uid, 'sale.order', order.id, 'cancel', cr)363 wf_service.trg_validate(uid, 'sale.order', order.id, 'cancel', cr)
@@ -444,6 +460,7 @@
444 'check_if_paid': fields.boolean('Check if Paid?'),460 'check_if_paid': fields.boolean('Check if Paid?'),
445 'days_before_order_cancel': fields.integer('Days Delay before Cancel', help='number of days before an unpaid order will be cancelled at next status update from Magento'),461 'days_before_order_cancel': fields.integer('Days Delay before Cancel', help='number of days before an unpaid order will be cancelled at next status update from Magento'),
446 'invoice_date_is_order_date' : fields.boolean('Force Invoice Date?', help="If it's check the invoice date will be the same as the order date"),462 'invoice_date_is_order_date' : fields.boolean('Force Invoice Date?', help="If it's check the invoice date will be the same as the order date"),
463 'payment_term_id': fields.many2one('account.payment.term', 'Payment Term'),
447 }464 }
448 465
449 _defaults = {466 _defaults = {
450467
=== modified file 'base_sale_multichannels/sale_view.xml'
--- base_sale_multichannels/sale_view.xml 2011-04-15 20:07:38 +0000
+++ base_sale_multichannels/sale_view.xml 2011-04-28 09:28:28 +0000
@@ -97,6 +97,7 @@
97 <field name="picking_policy"/>97 <field name="picking_policy"/>
98 <field name="order_policy"/>98 <field name="order_policy"/>
99 <field name="invoice_quantity"/>99 <field name="invoice_quantity"/>
100 <field name="payment_term_id"/>
100 <separator string="Worflow Option" colspan="4" />101 <separator string="Worflow Option" colspan="4" />
101 <field name="validate_order"/>102 <field name="validate_order"/>
102 <field name="validate_picking"/>103 <field name="validate_picking"/>
@@ -124,6 +125,7 @@
124 <field name="picking_policy"/>125 <field name="picking_policy"/>
125 <field name="order_policy"/>126 <field name="order_policy"/>
126 <field name="invoice_quantity"/>127 <field name="invoice_quantity"/>
128 <field name="payment_term_id"/>
127 <field name="is_auto_reconcile"/>129 <field name="is_auto_reconcile"/>
128 <field name="validate_order"/>130 <field name="validate_order"/>
129 <field name="validate_payment"/>131 <field name="validate_payment"/>