~sebastien.beau/e-commerce-addons/oerp6.1-stable-improve-shipping-export

« back to all changes in this revision

Viewing changes to product_links_sync/sale.py

  • Committer: sebastien beau
  • Date: 2012-05-12 23:06:47 UTC
  • Revision ID: sebastien.beau@akretion.com.br-20120512230647-ugjygn7y942avr8l
[ADD] add product_link_sync abstract module for syncronizing product_link with external system

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# -*- encoding: utf-8 -*-
 
2
###############################################################################
 
3
#                                                                             #
 
4
#   product_links_sync for OpenERP                                  #
 
5
#   Copyright (C) 2012 Akretion Sébastien BEAU <sebastien.beau@akretion.com>   #
 
6
#                                                                             #
 
7
#   This program is free software: you can redistribute it and/or modify      #
 
8
#   it under the terms of the GNU Affero General Public License as            #
 
9
#   published by the Free Software Foundation, either version 3 of the        #
 
10
#   License, or (at your option) any later version.                           #
 
11
#                                                                             #
 
12
#   This program is distributed in the hope that it will be useful,           #
 
13
#   but WITHOUT ANY WARRANTY; without even the implied warranty of            #
 
14
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             #
 
15
#   GNU Affero General Public License for more details.                       #
 
16
#                                                                             #
 
17
#   You should have received a copy of the GNU Affero General Public License  #
 
18
#   along with this program.  If not, see <http://www.gnu.org/licenses/>.     #
 
19
#                                                                             #
 
20
###############################################################################
 
21
 
 
22
from osv import osv, fields
 
23
import netsvc
 
24
from tools import DEFAULT_SERVER_DATETIME_FORMAT
 
25
from datetime import datetime
 
26
 
 
27
 
 
28
 
 
29
class sale_shop(osv.osv):
 
30
    _inherit = "sale.shop"
 
31
 
 
32
    _columns = {
 
33
        'last_products_links_export_date' : fields.datetime('Last Product Link Export Time'),
 
34
    }
 
35
 
 
36
    def export_catalog(self, cr, uid, ids, context=None):
 
37
        res=super(sale_shop, self).export_catalog(cr, uid, ids, context=context)
 
38
        context['export_product'] = 'link'
 
39
        self.export_resources(cr, uid, ids, 'product.product', context=context)
 
40
        return res
 
41
 
 
42
 
 
43