Remove un-needed code in stock_account_usability
As the module is now empty, don't make it installable for the moment
This commit is contained in:
@@ -1 +0,0 @@
|
|||||||
from . import wizard
|
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Copyright 2019-2020 Akretion France (http://www.akretion.com)
|
# Copyright 2019-2020 Akretion France (http://www.akretion.com)
|
||||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
@@ -6,7 +5,7 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
'name': 'Stock Account Usability',
|
'name': 'Stock Account Usability',
|
||||||
'version': '12.0.1.0.0',
|
'version': '14.0.1.0.0',
|
||||||
'category': 'Hidden',
|
'category': 'Hidden',
|
||||||
'license': 'AGPL-3',
|
'license': 'AGPL-3',
|
||||||
'summary': 'Several usability enhancements on stock_account',
|
'summary': 'Several usability enhancements on stock_account',
|
||||||
@@ -16,12 +15,7 @@ Stock Account Usability
|
|||||||
|
|
||||||
The usability enhancements include:
|
The usability enhancements include:
|
||||||
|
|
||||||
* activate the refund option by default in return wizard on pickings
|
NONE
|
||||||
|
|
||||||
* show field *property_cost_method* on product form view
|
|
||||||
|
|
||||||
* add ability to select a stock location on the inventory valuation report
|
|
||||||
|
|
||||||
|
|
||||||
This module has been written by Alexis de Lattre from Akretion <alexis.delattre@akretion.com>.
|
This module has been written by Alexis de Lattre from Akretion <alexis.delattre@akretion.com>.
|
||||||
""",
|
""",
|
||||||
@@ -29,8 +23,6 @@ This module has been written by Alexis de Lattre from Akretion <alexis.delattre@
|
|||||||
'website': 'http://www.akretion.com',
|
'website': 'http://www.akretion.com',
|
||||||
'depends': ['stock_account'],
|
'depends': ['stock_account'],
|
||||||
'data': [
|
'data': [
|
||||||
'product_view.xml',
|
|
||||||
'wizard/stock_quantity_history_view.xml',
|
|
||||||
],
|
],
|
||||||
'installable': False,
|
'installable': False,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
diff --git a/addons/stock_account/models/product.py b/addons/stock_account/models/product.py
|
|
||||||
index 0622c16d2b5..c078ac54324 100644
|
|
||||||
--- a/addons/stock_account/models/product.py
|
|
||||||
+++ b/addons/stock_account/models/product.py
|
|
||||||
@@ -239,7 +239,7 @@ class ProductProduct(models.Model):
|
|
||||||
|
|
||||||
for product in self:
|
|
||||||
if product.cost_method in ['standard', 'average']:
|
|
||||||
- qty_available = product.with_context(company_owned=True, owner_id=False).qty_available
|
|
||||||
+ qty_available = product.with_context(owner_id=False).qty_available
|
|
||||||
price_used = product.standard_price
|
|
||||||
if to_date:
|
|
||||||
price_used = product.get_history_price(
|
|
||||||
@@ -252,7 +252,7 @@ class ProductProduct(models.Model):
|
|
||||||
if to_date:
|
|
||||||
if product.product_tmpl_id.valuation == 'manual_periodic':
|
|
||||||
product.stock_value = product_values[product.id]
|
|
||||||
- product.qty_at_date = product.with_context(company_owned=True, owner_id=False).qty_available
|
|
||||||
+ product.qty_at_date = product.with_context(owner_id=False).qty_available
|
|
||||||
product.stock_fifo_manual_move_ids = StockMove.browse(product_move_ids[product.id])
|
|
||||||
elif product.product_tmpl_id.valuation == 'real_time':
|
|
||||||
valuation_account_id = product.categ_id.property_stock_valuation_account_id.id
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!--
|
|
||||||
Copyright 2020 Akretion France (http://www.akretion.com/)
|
|
||||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
|
||||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
|
||||||
-->
|
|
||||||
|
|
||||||
<odoo>
|
|
||||||
|
|
||||||
|
|
||||||
<record id="view_template_property_form" model="ir.ui.view">
|
|
||||||
<field name="name">stock_account.product.template.form</field>
|
|
||||||
<field name="model">product.template</field>
|
|
||||||
<field name="inherit_id" ref="stock_account.view_template_property_form"/>
|
|
||||||
<field name="arch" type="xml">
|
|
||||||
<field name="property_cost_method" position="attributes">
|
|
||||||
<attribute name="invisible">0</attribute>
|
|
||||||
</field>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
|
|
||||||
</odoo>
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
# Copyright 2019 Akretion France (http://www.akretion.com/)
|
|
||||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
|
||||||
|
|
||||||
from odoo import models
|
|
||||||
|
|
||||||
|
|
||||||
class StockQuantityHistory(models.TransientModel):
|
|
||||||
_inherit = 'stock.quantity.history'
|
|
||||||
|
|
||||||
def open_table(self):
|
|
||||||
action = super(StockQuantityHistory, self).open_table()
|
|
||||||
if self.location_id and self.env.context.get('valuation'):
|
|
||||||
# When we have 'valuation' in context
|
|
||||||
# in both cases ('current inventory' and 'at specific date')
|
|
||||||
# it returns an action on product.product,
|
|
||||||
# the only difference is the context.
|
|
||||||
# We have to make the same modifications, but
|
|
||||||
# when self.compute_at_date, action['context'] is a dict
|
|
||||||
# otherwize, action['context'] is a string
|
|
||||||
if self.compute_at_date:
|
|
||||||
# insert "location" in context for qty computation
|
|
||||||
action['context']['location'] = self.location_id.id
|
|
||||||
# When company_owned=True, the 'location' given in the
|
|
||||||
# context is not taken into account
|
|
||||||
# IMPORTANT: also requires a patch on the stock_account
|
|
||||||
# module. Patch provided in this module.
|
|
||||||
action['context']['company_owned'] = False
|
|
||||||
else:
|
|
||||||
action['context'] = {
|
|
||||||
'location': self.location_id.id,
|
|
||||||
'create': False,
|
|
||||||
'edit': False,
|
|
||||||
}
|
|
||||||
return action
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!--
|
|
||||||
Copyright 2019 Akretion France (http://www.akretion.com/)
|
|
||||||
@author: Alexis de Lattre <alexis.delattre@akretion.com>
|
|
||||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
|
||||||
-->
|
|
||||||
|
|
||||||
<odoo>
|
|
||||||
|
|
||||||
|
|
||||||
<record id="view_stock_quantity_history" model="ir.ui.view">
|
|
||||||
<field name="name">stock_account_usability.stock.quantity.history.form</field>
|
|
||||||
<field name="model">stock.quantity.history</field>
|
|
||||||
<field name="inherit_id" ref="stock_account.view_stock_quantity_history"/>
|
|
||||||
<field name="arch" type="xml">
|
|
||||||
<field name="date" position="after">
|
|
||||||
<field name="location_id"/>
|
|
||||||
</field>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
|
|
||||||
</odoo>
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
# Copyright 2019 Akretion France (https://akretion.com/)
|
|
||||||
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
|
||||||
|
|
||||||
from odoo import api, models
|
|
||||||
|
|
||||||
|
|
||||||
class StockReturnPicking(models.TransientModel):
|
|
||||||
_inherit = 'stock.return.picking'
|
|
||||||
|
|
||||||
# Set to_refund to True by default
|
|
||||||
@api.model
|
|
||||||
def default_get(self, fields_list):
|
|
||||||
res = super(StockReturnPicking, self).default_get(fields_list)
|
|
||||||
if isinstance(res.get('product_return_moves'), list):
|
|
||||||
for l in res['product_return_moves']:
|
|
||||||
if len(l) == 3 and isinstance(l[2], dict):
|
|
||||||
l[2]['to_refund'] = True
|
|
||||||
return res
|
|
||||||
Reference in New Issue
Block a user