Files
odoo_source/addons/purchase_stock/__init__.py
T
Arnold Moyaux 6eaa4a2ae3 [IMP] (purchase_)stock: suppliers information in replenishment
Infobox to help the user with the replenishment. Allow those actions:
- See the different supplier with their lead time, price and quantity
- Be able to select a supplier and set it on the orderpoint
⁻ See the last delivery by mmonth for the product
- Last purchase date for each supplier

Technicaly it use a wizard and a fields char with JSON used by
a widget to display a static template. Also it creates directly
the wizard in backend instead of just let the view manage the new
object since we need a button on a one2many and if the records do
not have an id, it's not possilbe to use it.

closes odoo/odoo#72039

Task: 2519761
Related: odoo/upgrade#2596
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-06-29 07:41:12 +00:00

20 lines
634 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import models
from . import report
from . import populate
from . import wizard
from odoo import api, SUPERUSER_ID
def _create_buy_rules(cr, registry):
""" This hook is used to add a default buy_pull_id on every warehouse. It is
necessary if the purchase_stock module is installed after some warehouses
were already created.
"""
env = api.Environment(cr, SUPERUSER_ID, {})
warehouse_ids = env['stock.warehouse'].search([('buy_pull_id', '=', False)])
warehouse_ids.write({'buy_to_resupply': True})