Connectors mailing list archives

connectors@odoo-community.org

Avatar

Re: Help updateing Sale Orders customer note field

by
Camptocamp France SAS, Damien Crier
- 04/07/2017 09:12:12
Please unsubscribe yourself here: https://odoo-community.org/groups?unsubscribe

BTW, the given link is present in each mail so feel free to get out of any group you want

On Tue, Jul 4, 2017 at 9:07 AM, Ahmad Ababneh <ababneh.a1@gmail.com> wrote:
GET ME OUT OF THE GROUP

On 23 June 2017 at 13:23, Kontor Consulting | Zoran Vranesevic <z.vranesevic@kontor.consulting> wrote:

Hello to all,
I’m developing a custom extension tot he magentoerpconnector module on odoo.
So far we’re successfully using the Connector with Mag. 1.9.2.4 and Odoo 8.

I’ve extended the connector so far,
that it does transport a custom customer note field from Magento to Odoo.
And I’m able to import the customer notes with a new Quotation/Order import,
but this field is possibly updated after import on Magento and has to be synched to odoo again.

As far as I can see this field is no more updated again after import and creation of the order.

 

How could I trigger an update of this custom field?

Code Snippets:

/mymodule/sale.py

 

 

Import …

 

_logger = logging.getLogger(__name__)

 

 

 

_logger.info("kc_bbg_datafeeding.sale")

 

 

class sale_order(osv.osv):

    _inherit = 'sale.order'

    _name = 'sale.order'

    _columns = {

      …

      'kc_mag_customer_note'                        : fields.text('Bestellkommentar', help="Customer note imported from Magento", required=False),

    }

….

@magento(replacing=sale.SaleOrderImportMapper)

class KCBBGSaleOrderImportMapper(sale.SaleOrderImportMapper):

    _model_name = 'magento.sale.order'

    """

        Replacement Import Mapper

        This replacemnt Importer adds the BBG-Style portion,

        needed for their SaleOrder-handling

    """

 

    @mapping

    def kc_mag_customer_note(self, record):

        _logger.info( """@mapping kc_mag_customer_note(self, record) """)

        _logger.info( "record=[%s]" % repr(record['custom']))

        return {'kc_mag_customer_note':record['custom'][0]['value']}

    

 

 

Mit freundlichem Gruß

Zoran Vranesevic

- Anwendungsentwickler -

 

 

 

Kontor Consulting GmbH

 

Geschäftsführer
Tadeusz Nikitin
Willy-Brandt-Allee 31b
23554 Lübeck

Tel. +49 451 599 83 00
Fax +49 451 61 16 57 48

Email: info@kontor.consulting
Website: www.kontor.consulting

Handelsregister: Amtsgericht Lübeck HRB 14643 HL
Ust-ID-Nr: DE298887575

Sitz: Lübeck

 

 

_______________________________________________
Mailing-List: https://odoo-community.org/groups/connectors-30
Post to: mailto:connectors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe


_______________________________________________
Mailing-List: https://odoo-community.org/groups/connectors-30
Post to: mailto:connectors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe




--
Damien Crier
Tel : +33 4 58 48 20 31

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac Cedex
http://www.camptocamp.com

Reference