Пример #1
0
    def test_03_stoped_timer_duration(self):
        """
        Test stoped timer duration.
        """
        workflow = []

        timer = Timer()
        timer.stop()

        r1 = timer.duration
        self.assertTrue(r1 is not None)
        workflow.append(r1)

        r2 = timer.duration
        self.assertTrue(r2 is not None)
        workflow.append(r2)

        self.assertTrue(r1 == r2)

        return workflow
Пример #2
0
    def test_04_stoped_timer_timedelta(self):
        """
        Test stoped timer timedelta.
        """
        workflow = []

        timer = Timer()
        timer.stop()

        r1 = timer.timedelta
        self.assertTrue(r1 is not None)
        workflow.append(r1)

        r2 = timer.timedelta
        self.assertTrue(r2 is not None)
        workflow.append(r2)

        self.assertTrue(r1 == r2)

        return workflow
Пример #3
0
session = Session([
    '-c', '/Users/eneldoserrata/PycharmProjects/marcos_odoo/.openerp_serverrc',
    '-d', 'rim'
])

cr = session.cr

lot_ids = [l.id for l in session.models.stock_production_lot.search([])]

count = 0
total_time = False
moves = set()
skua_ab = {}

for lot_id in session.models.stock_production_lot.search([]):
    timer = Timer()
    for quant in session.models.stock_quant.search([('lot_id', '=', lot_id.id)
                                                    ]):
        moves |= {move.id for move in quant.history_ids}
    try:
        from_qc_skua_cost = 0.00
        for move_id in session.models.stock_move.search([
            ("id", "in", sorted(list(moves)))
        ]):
            if move_id.location_id.usage == "internal" and move_id.location_id.usage == "supplier":
                move_id.with_context({
                    "from_qc": False
                }).product_price_update_before_done()

            elif move_id.location_id.usage == "internal" and move_id.location_id.usage == "internal":
                move_id.with_context({