<commit_before># -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################

from openerp import models, fields, api
import openerp.addons.decimal_precision as dp
# from openerp.tools import float_compare, float_is_zero
# from openerp.exceptions import UserError
import logging

logger = logging.getLogger(__name__)


class StockWarehouseOrderpoint(models.Model):
    _name = 'stock.warehouse.orderpoint'
    _inherit = ['stock.warehouse.orderpoint', 'mail.thread']

    rotation = fields.Float(
        help='Cantidades entregadas a clientes en los '
        'últimos 90 días dividido por 3 para mensualizar '
        '(restadas devoluciones).',
        compute='_compute_rotation',
        digits=dp.get_precision('Product Unit of Measure'),
    )
    location_rotation = fields.Float(
        help='Cantidades entregadas desde esta ubicación a clientes en los '
        'últimos 90 días dividido por 3 para mensualizar'
        '(restadas devoluciones).',
        compute='_compute_rotation',
        digits=dp.get_precision('Product Unit of Measure'),
    )
    product_min_qty = fields.Float(track_visibility='always')
    product_max_qty = fields.Float(track_visibility='always')
    qty_multiple = fields.Float(track_visibility='always')
    location_id = fields.Many2one(track_visibility='always')
    product_id = fields.Many2one(track_visibility='always')

    @api.multi
    @api.depends('product_id', 'location_id')
    def _compute_rotation(self):
        for rec in self:
            rec.rotation = rec.product_id.get_product_rotation()
            rec.location_rotation = rec.product_id.get_product_rotation(
                rec.location_id)<commit_msg>FIX stock_usability<commit_after># -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################

from openerp import models, fields, api
import openerp.addons.decimal_precision as dp
# from openerp.tools import float_compare, float_is_zero
# from openerp.exceptions import UserError
import logging

logger = logging.getLogger(__name__)


class StockWarehouseOrderpoint(models.Model):
    _name = 'stock.warehouse.orderpoint'
    _inherit = ['stock.warehouse.orderpoint', 'mail.thread']

    rotation = fields.Float(
        help='Cantidades entregadas a clientes en los '
        'últimos 90 días dividido por 3 para mensualizar '
        '(restadas devoluciones).',
        compute='_compute_rotation',
        digits=dp.get_precision('Product Unit of Measure'),
    )
    location_rotation = fields.Float(
        help='Cantidades entregadas desde esta ubicación a clientes en los '
        'últimos 90 días dividido por 3 para mensualizar'
        '(restadas devoluciones).',
        compute='_compute_rotation',
        digits=dp.get_precision('Product Unit of Measure'),
    )
    product_min_qty = fields.Float(track_visibility='always')
    product_max_qty = fields.Float(track_visibility='always')
    qty_multiple = fields.Float(track_visibility='always')
    location_id = fields.Many2one(track_visibility='always')
    product_id = fields.Many2one(track_visibility='always')

    @api.multi
    @api.depends('product_id', 'location_id')
    def _compute_rotation(self):
        for rec in self:
            if rec.product_id:
                rec.rotation = rec.product_id.get_product_rotation()
                rec.location_rotation = rec.product_id.get_product_rotation(
                    rec.location_id)
{'fraction_non_alphanumeric': 0.16881409413620826, 'fraction_numerical': 0.00473310544307126, 'mean_word_length': 3.9595827900912646, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '131308', 'n_tokens_mistral': 1096, 'n_tokens_neox': 1028, 'n_words': 238}