<commit_before># -*- coding: utf-8 -*-
# Copyright 2016 Eficent Business and IT Consulting Services S.L.
#   (http://www.eficent.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from openerp import api, models


class ProcurementOrder(models.Model):
    _inherit = "procurement.order"

    @api.multi
    @api.onchange('product_id')
    def onchange_product_id(self):
        for rec in self:
            rec.procure_uom_id = rec.product_id.uom_id

    @api.model
    def _prepare_orderpoint_procurement(self, orderpoint, product_qty):
        res = super(ProcurementOrder,self)._prepare_orderpoint_procurement(
            orderpoint, product_qty)
        if orderpoint.procure_uom_id:
            res['product_qty'] = orderpoint.procure_uom_id._compute_qty(
                orderpoint.product_id.uom_id.id, product_qty,
                orderpoint.procure_uom_id.id)
            res['product_uom'] = orderpoint.procure_uom_id.id
        return res<commit_msg>[FIX] travis<commit_after># -*- coding: utf-8 -*-
# Copyright 2016 Eficent Business and IT Consulting Services S.L.
#   (http://www.eficent.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).

from openerp import api, models


class ProcurementOrder(models.Model):
    _inherit = "procurement.order"

    @api.multi
    @api.onchange('product_id')
    def onchange_product_id(self):
        for rec in self:
            rec.procure_uom_id = rec.product_id.uom_id

    @api.model
    def _prepare_orderpoint_procurement(self, orderpoint, product_qty):
        res = super(ProcurementOrder, self)._prepare_orderpoint_procurement(
            orderpoint, product_qty)
        if orderpoint.procure_uom_id:
            res['product_qty'] = orderpoint.procure_uom_id._compute_qty(
                orderpoint.product_id.uom_id.id, product_qty,
                orderpoint.procure_uom_id.id)
            res['product_uom'] = orderpoint.procure_uom_id.id
        return res
{'fraction_non_alphanumeric': 0.10435663627152988, 'fraction_numerical': 0.0070921985815602835, 'mean_word_length': 2.942115768463074, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7582637', 'n_tokens_mistral': 687, 'n_tokens_neox': 665, 'n_words': 115}