~ecommerce-addons-core-editors/e-commerce-addons/github-6.1

« back to all changes in this revision

Viewing changes to product_links_sync/product.py

  • Committer: sebastien beau
  • Date: 2012-08-21 13:57:44 UTC
  • mto: (269.1.1)
  • mto: This revision was merged to the branch mainline in revision 273.
  • Revision ID: git-v1:5a17b67295468f3c90564a729144ebc41da38618
[REF] refactor/clean code due to orm change in 6.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# -*- encoding: utf-8 -*-
2
2
###############################################################################
3
3
#                                                                             #
4
 
#   product_links_sync for OpenERP                                  #
5
 
#   Copyright (C) 2012 Akretion Sébastien BEAU <sebastien.beau@akretion.com>   #
 
4
#   product_links_sync for OpenERP                                            #
 
5
#   Copyright (C) 2012 Akretion Sébastien BEAU <sebastien.beau@akretion.com>  #
6
6
#                                                                             #
7
7
#   This program is free software: you can redistribute it and/or modify      #
8
8
#   it under the terms of the GNU Affero General Public License as            #
19
19
#                                                                             #
20
20
###############################################################################
21
21
 
22
 
from osv import osv, fields
 
22
from openerp.osv.orm import Model
 
23
from openerp.osv.orm import TransientModel
 
24
from openerp.osv import fields
23
25
import netsvc
24
26
from tools import DEFAULT_SERVER_DATETIME_FORMAT
25
27
from datetime import datetime
26
28
from base_external_referentials.decorator import only_for_referential
27
29
from base_external_referentials.decorator import commit_now
28
30
 
29
 
class product_product(osv.osv):
 
31
class product_product(Model):
30
32
    _inherit = "product.product"
31
33
 
32
34
    _columns = {
85
87
            if 'product_link_ids' in fields_to_read: fields_to_read.remove('product_link_ids')
86
88
        return fields_to_read
87
89
 
88
 
#    def export_links_for_product(self, cr, uid, ids, context=None):
89
 
#        """ Not implemented in this abstract module"""
90
 
#        return False
91
 
 
92
90
    @only_for_referential(ref_categ ='Multichannel Sale')
93
91
    def _get_last_exported_date(self, cr, uid, external_session, context):
94
92
        shop = external_session.sync_from_object
107
105
            return super(product_product, self)._set_last_exported_date(cr, uid, external_session, date, context)
108
106
 
109
107
 
110
 
class product_link(osv.osv):
 
108
class product_link(Model):
111
109
    _inherit = "product.link"
112
110
    
113
111
    def write(self, cr, uid, ids, vals, context=None):