def setUp(self): super(test_event, self).setUp() self.consumer1 = lambda session, model_name: None self.consumer2 = lambda session, model_name: None self.event = Event() self.session = ConnectorSession(self.cr, self.uid)
# # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## from openerp.addons.connector.event import on_record_create, on_record_write, \ on_record_unlink from openerp.addons.connector.queue.job import job from .utils import _get_exporter from ..backend import middleware from openerp.addons.connector.unit.synchronizer import Exporter from ..unit.backend_adapter import GenericAdapter from .rma_events import export_rmaproduct from openerp.addons.connector.event import Event on_stock_move_change = Event() @middleware class ProductExporter(Exporter): _model_name = ['product.product', 'product.template'] def update(self, binding_id, mode): if self.model == self.env["product.template"]: products = self.env["product.product"].\ search([('product_tmpl_id', '=', binding_id)]) else: products = [self.model.browse(binding_id)] for product in products: vals = {'name': product.name,
# published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## from openerp.addons.connector.event import Event on_picking_out_done = Event() """ ``on_picking_out_done`` is fired when an outgoing picking has been marked as done. Listeners should take the following arguments: * session: `connector.session.ConnectorSession` object * model_name: name of the model * record_id: id of the record """ on_picking_out_available = Event() """ ``on_picking_out_available`` is fired when an outgoing picking has been marked as available.
# -*- coding: utf-8 -*- # © 2013 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) from openerp.addons.connector.event import Event on_picking_out_done = Event() """ ``on_picking_out_done`` is fired when an outgoing picking has been marked as done. Listeners should take the following arguments: * session: `connector.session.ConnectorSession` object * model_name: name of the model * record_id: id of the record * type: 'partial' or 'complete' depending on the picking done """ on_tracking_number_added = Event() """ ``on_tracking_number_added`` is fired when a picking has been marked as done and a tracking number has been added to it (write). Listeners should take the following arguments: * session: `connector.session.ConnectorSession` object * model_name: name of the model * record_id: id of the record """