[MIG] sale_stock_usability
This commit is contained in:
@@ -1 +1 @@
|
|||||||
from . import sale_stock
|
from . import models
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
# Copyright 2015-2019 Akretion (http://www.akretion.com)
|
# Copyright 2015-2020 Akretion (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).
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
'name': 'Sale Stock Usability',
|
'name': 'Sale Stock Usability',
|
||||||
'version': '12.0.1.0.0',
|
'version': '14.0.1.0.0',
|
||||||
'category': 'Sales Management',
|
'category': 'Sales Management',
|
||||||
'license': 'AGPL-3',
|
'license': 'AGPL-3',
|
||||||
'summary': 'Small usability improvements to the sale_stock module',
|
'summary': 'Small usability improvements to the sale_stock module',
|
||||||
@@ -22,6 +22,11 @@ This module has been written by Alexis de Lattre from Akretion <alexis.delattre@
|
|||||||
'author': 'Akretion',
|
'author': 'Akretion',
|
||||||
'website': 'http://www.akretion.com',
|
'website': 'http://www.akretion.com',
|
||||||
'depends': ['sale_stock'],
|
'depends': ['sale_stock'],
|
||||||
'data': ['sale_stock_view.xml'],
|
'data': [
|
||||||
'installable': False,
|
'views/sale_order.xml',
|
||||||
|
'views/procurement_group.xml',
|
||||||
|
'views/stock_move.xml',
|
||||||
|
'views/stock_picking.xml',
|
||||||
|
],
|
||||||
|
'installable': True,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,71 +4,56 @@
|
|||||||
#
|
#
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Odoo Server 8.0\n"
|
"Project-Id-Version: Odoo Server 14.0\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2016-07-13 12:36+0000\n"
|
"POT-Creation-Date: 2020-12-03 21:31+0000\n"
|
||||||
"PO-Revision-Date: 2016-07-13 14:37+0200\n"
|
"PO-Revision-Date: 2020-12-03 21:31+0000\n"
|
||||||
"Last-Translator: <>\n"
|
"Last-Translator: \n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: \n"
|
||||||
"Plural-Forms: \n"
|
"Plural-Forms: \n"
|
||||||
"Language: fr\n"
|
|
||||||
"X-Generator: Poedit 1.8.7.1\n"
|
|
||||||
|
|
||||||
#. module: sale_stock_usability
|
#. module: sale_stock_usability
|
||||||
#: view:sale.order:sale_stock_usability.view_order_form_inherit
|
#: model:ir.model.fields.selection,name:sale_stock_usability.selection__sale_order__picking_status__cancel
|
||||||
msgid "Delivery Orders"
|
|
||||||
msgstr "Livraisons"
|
|
||||||
|
|
||||||
#. module: sale_stock_usability
|
|
||||||
#: view:procurement.group:sale_stock_usability.procurement_group_form_view
|
|
||||||
#: field:procurement.group,picking_ids:0
|
|
||||||
msgid "Pickings"
|
|
||||||
msgstr "Préparations"
|
|
||||||
|
|
||||||
#. module: sale_stock_usability
|
|
||||||
#: model:ir.model,name:sale_stock_usability.model_procurement_group
|
|
||||||
msgid "Procurement Requisition"
|
|
||||||
msgstr "Demande d'approvisionnement"
|
|
||||||
|
|
||||||
#. module: sale_stock_usability
|
|
||||||
#: view:procurement.group:sale_stock_usability.procurement_group_form_view
|
|
||||||
#: field:procurement.group,sale_ids:0
|
|
||||||
msgid "Sale Orders"
|
|
||||||
msgstr "Sale Orders"
|
|
||||||
|
|
||||||
#. module: sale_stock_usability
|
|
||||||
#: model:ir.model,name:sale_stock_usability.model_sale_order
|
|
||||||
msgid "Sales Order"
|
|
||||||
msgstr "Bon de commande"
|
|
||||||
|
|
||||||
#. module: sale_stock_usability
|
|
||||||
#: model:ir.model,name:sale_stock_usability.model_sale_order_line
|
|
||||||
msgid "Sales Order Line"
|
|
||||||
msgstr "Ligne de commandes de vente"
|
|
||||||
|
|
||||||
#. module: sale_stock_usability
|
|
||||||
#: selection:sale.order,picking_status:0
|
|
||||||
msgid "Delivery Cancelled"
|
msgid "Delivery Cancelled"
|
||||||
msgstr "Livraison annulée"
|
msgstr "Livraison annulée"
|
||||||
|
|
||||||
#. module: sale_stock_usability
|
#. module: sale_stock_usability
|
||||||
|
#: model:ir.model.fields,field_description:sale_stock_usability.field_sale_order__display_name
|
||||||
|
msgid "Display Name"
|
||||||
|
msgstr "Nom affiché"
|
||||||
|
|
||||||
|
#. module: sale_stock_usability
|
||||||
|
#: model:ir.model.fields.selection,name:sale_stock_usability.selection__sale_order__picking_status__delivered
|
||||||
#: model_terms:ir.ui.view,arch_db:sale_stock_usability.view_sales_order_filter
|
#: model_terms:ir.ui.view,arch_db:sale_stock_usability.view_sales_order_filter
|
||||||
#: selection:sale.order,picking_status:0
|
|
||||||
msgid "Fully Delivered"
|
msgid "Fully Delivered"
|
||||||
msgstr "Entierement Livré "
|
msgstr "Entierement Livré "
|
||||||
|
|
||||||
|
#. module: sale_stock_usability
|
||||||
|
#: model:ir.model.fields,field_description:sale_stock_usability.field_sale_order__id
|
||||||
|
msgid "ID"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#. module: sale_stock_usability
|
#. module: sale_stock_usability
|
||||||
#: model:ir.model.fields,field_description:sale_stock_usability.field_sale_order__incoterm
|
#: model:ir.model.fields,field_description:sale_stock_usability.field_sale_order__incoterm
|
||||||
msgid "Incoterms"
|
msgid "Incoterm"
|
||||||
msgstr "Incoterms"
|
msgstr ""
|
||||||
|
|
||||||
#. module: sale_stock_usability
|
#. module: sale_stock_usability
|
||||||
#: model:ir.model.fields,help:sale_stock_usability.field_sale_order__incoterm
|
#: model:ir.model.fields,help:sale_stock_usability.field_sale_order__incoterm
|
||||||
msgid "International Commercial Terms are a series of predefined commercial terms used in international transactions."
|
msgid ""
|
||||||
msgstr "Les Incoterms sont une série de termes commerciaux prédéfinie utilisés dans les transactions internationales."
|
"International Commercial Terms are a series of predefined commercial terms "
|
||||||
|
"used in international transactions."
|
||||||
|
msgstr ""
|
||||||
|
"Les Incoterms sont une série de termes commerciaux prédéfinie utilisés dans "
|
||||||
|
"les transactions internationales."
|
||||||
|
|
||||||
|
#. module: sale_stock_usability
|
||||||
|
#: model:ir.model.fields,field_description:sale_stock_usability.field_sale_order____last_update
|
||||||
|
msgid "Last Modified on"
|
||||||
|
msgstr "Dernière modification le"
|
||||||
|
|
||||||
#. module: sale_stock_usability
|
#. module: sale_stock_usability
|
||||||
#: model_terms:ir.ui.view,arch_db:sale_stock_usability.view_sales_order_filter
|
#: model_terms:ir.ui.view,arch_db:sale_stock_usability.view_sales_order_filter
|
||||||
@@ -76,29 +61,29 @@ msgid "Not Fully Delivered"
|
|||||||
msgstr "Livraison à faire"
|
msgstr "Livraison à faire"
|
||||||
|
|
||||||
#. module: sale_stock_usability
|
#. module: sale_stock_usability
|
||||||
#: selection:sale.order,picking_status:0
|
#: model:ir.model.fields.selection,name:sale_stock_usability.selection__sale_order__picking_status__no
|
||||||
msgid "Nothing to Deliver"
|
msgid "Nothing to Deliver"
|
||||||
msgstr "Rien à livrer"
|
msgstr "Rien à livrer"
|
||||||
|
|
||||||
#. module: sale_stock_usability
|
#. module: sale_stock_usability
|
||||||
#: selection:sale.order,picking_status:0
|
#: model:ir.model.fields.selection,name:sale_stock_usability.selection__sale_order__picking_status__partially_delivered
|
||||||
msgid "Partially Delivered"
|
msgid "Partially Delivered"
|
||||||
msgstr "Livré partielement"
|
msgstr "Partiellement livré"
|
||||||
|
|
||||||
#. module: sale_stock_usability
|
#. module: sale_stock_usability
|
||||||
#: model:ir.model.fields,field_description:sale_stock_usability.field_sale_order__picking_status
|
#: model:ir.model.fields,field_description:sale_stock_usability.field_sale_order__picking_status
|
||||||
msgid "Picking Status"
|
msgid "Picking Status"
|
||||||
msgstr "Status de BL"
|
msgstr "Statut de la livraison"
|
||||||
|
|
||||||
#. module: sale_stock_usability
|
#. module: sale_stock_usability
|
||||||
#: model:ir.model,name:sale_stock_usability.model_sale_order
|
#: model:ir.model,name:sale_stock_usability.model_sale_order
|
||||||
msgid "Sale Order"
|
msgid "Sales Order"
|
||||||
msgstr "Bon de commande"
|
msgstr "Bon de commande"
|
||||||
|
|
||||||
#. module: sale_stock_usability
|
#. module: sale_stock_usability
|
||||||
#: selection:sale.order,picking_status:0
|
#: model:ir.model.fields.selection,name:sale_stock_usability.selection__sale_order__picking_status__to_deliver
|
||||||
msgid "To Deliver"
|
msgid "To Deliver"
|
||||||
msgstr "Prêt à livrer"
|
msgstr "À livrer"
|
||||||
|
|
||||||
#. module: sale_stock_usability
|
#. module: sale_stock_usability
|
||||||
#: model:ir.model.fields,field_description:sale_stock_usability.field_sale_order__warehouse_id
|
#: model:ir.model.fields,field_description:sale_stock_usability.field_sale_order__warehouse_id
|
||||||
|
|||||||
1
sale_stock_usability/models/__init__.py
Normal file
1
sale_stock_usability/models/__init__.py
Normal file
@@ -0,0 +1 @@
|
|||||||
|
from . import sale_order
|
||||||
@@ -1,15 +1,16 @@
|
|||||||
# Copyright 2015-2019 Akretion France (http://www.akretion.com)
|
# Copyright 2015-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).
|
||||||
|
|
||||||
from odoo import models, fields, api
|
from odoo import api, fields, models
|
||||||
|
from odoo.tools import float_compare, float_round
|
||||||
|
|
||||||
|
|
||||||
class SaleOrder(models.Model):
|
class SaleOrder(models.Model):
|
||||||
_inherit = 'sale.order'
|
_inherit = 'sale.order'
|
||||||
|
|
||||||
warehouse_id = fields.Many2one(track_visibility='onchange')
|
warehouse_id = fields.Many2one(tracking=True)
|
||||||
incoterm = fields.Many2one(track_visibility='onchange')
|
incoterm = fields.Many2one(tracking=True)
|
||||||
picking_status = fields.Selection([
|
picking_status = fields.Selection([
|
||||||
('delivered', 'Fully Delivered'),
|
('delivered', 'Fully Delivered'),
|
||||||
('partially_delivered', 'Partially Delivered'),
|
('partially_delivered', 'Partially Delivered'),
|
||||||
@@ -17,7 +18,7 @@ class SaleOrder(models.Model):
|
|||||||
('cancel', 'Delivery Cancelled'),
|
('cancel', 'Delivery Cancelled'),
|
||||||
('no', 'Nothing to Deliver')
|
('no', 'Nothing to Deliver')
|
||||||
], string='Picking Status', compute='_compute_picking_status',
|
], string='Picking Status', compute='_compute_picking_status',
|
||||||
store=True, readonly=True)
|
store=True)
|
||||||
|
|
||||||
@api.depends('state', 'picking_ids.state')
|
@api.depends('state', 'picking_ids.state')
|
||||||
def _compute_picking_status(self):
|
def _compute_picking_status(self):
|
||||||
@@ -48,3 +49,25 @@ class SaleOrder(models.Model):
|
|||||||
for state in pstates]):
|
for state in pstates]):
|
||||||
picking_status = 'to_deliver'
|
picking_status = 'to_deliver'
|
||||||
order.picking_status = picking_status
|
order.picking_status = picking_status
|
||||||
|
|
||||||
|
def report_qty_to_deliver(self):
|
||||||
|
# Can be useful for delivery report
|
||||||
|
self.ensure_one()
|
||||||
|
res = []
|
||||||
|
prec = self.env['decimal.precision'].precision_get(
|
||||||
|
'Product Unit of Measure')
|
||||||
|
for line in self.order_line:
|
||||||
|
if (
|
||||||
|
line.product_id.type in ('product', 'consu') and
|
||||||
|
float_compare(
|
||||||
|
line.product_uom_qty, line.qty_delivered,
|
||||||
|
precision_digits=prec) > 0):
|
||||||
|
qty_to_deliver = float_round(
|
||||||
|
line.product_uom_qty - line.qty_delivered, precision_digits=prec)
|
||||||
|
res.append({
|
||||||
|
'product': line.product_id,
|
||||||
|
'name': line.name,
|
||||||
|
'uom': line.product_uom,
|
||||||
|
'qty_to_deliver': qty_to_deliver,
|
||||||
|
})
|
||||||
|
return res
|
||||||
22
sale_stock_usability/views/procurement_group.xml
Normal file
22
sale_stock_usability/views/procurement_group.xml
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Copyright 2015-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="procurement_group_form_view" model="ir.ui.view">
|
||||||
|
<field name="name">sale_stock_usability.procurement.group.form</field>
|
||||||
|
<field name="model">procurement.group</field>
|
||||||
|
<field name="inherit_id" ref="stock.procurement_group_form_view"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="move_type" position="after">
|
||||||
|
<field name="sale_id"/>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
</odoo>
|
||||||
@@ -1,41 +1,18 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Copyright 2015-2019 Akretion France (http://www.akretion.com/)
|
Copyright 2015-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).
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<odoo>
|
<odoo>
|
||||||
|
|
||||||
<record id="view_picking_form" model="ir.ui.view">
|
|
||||||
<field name="name">sale_stock_usability.stock.picking.form</field>
|
|
||||||
<field name="model">stock.picking</field>
|
|
||||||
<field name="inherit_id" ref="stock.view_picking_form"/>
|
|
||||||
<field name="arch" type="xml">
|
|
||||||
<field name="group_id" position="before">
|
|
||||||
<field name="sale_id" readonly="1"/>
|
|
||||||
</field>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<record id="view_move_form" model="ir.ui.view">
|
|
||||||
<field name="name">sale_stock_usability.stock_move.form</field>
|
|
||||||
<field name="model">stock.move</field>
|
|
||||||
<field name="inherit_id" ref="stock.view_move_form"/>
|
|
||||||
<field name="arch" type="xml">
|
|
||||||
<field name="origin" position="after">
|
|
||||||
<field name="sale_line_id" readonly="1"/>
|
|
||||||
</field>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
<record id="view_order_form" model="ir.ui.view">
|
<record id="view_order_form" model="ir.ui.view">
|
||||||
<field name="name">sale_stock_usability.order.form</field>
|
<field name="name">sale_stock_usability.order.form</field>
|
||||||
<field name="model">sale.order</field>
|
<field name="model">sale.order</field>
|
||||||
<field name="inherit_id" ref="sale.view_order_form"/>
|
<field name="inherit_id" ref="sale_stock.view_order_form_inherit_sale_stock"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<field name="pricelist_id" position="after">
|
<field name="picking_policy" position="after">
|
||||||
<field name="picking_status"/>
|
<field name="picking_status"/>
|
||||||
</field>
|
</field>
|
||||||
</field>
|
</field>
|
||||||
@@ -47,7 +24,7 @@
|
|||||||
<field name="inherit_id" ref="sale.view_order_tree"/>
|
<field name="inherit_id" ref="sale.view_order_tree"/>
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<field name="invoice_status" position="before">
|
<field name="invoice_status" position="before">
|
||||||
<field name="picking_status"/>
|
<field name="picking_status" decoration-success="picking_status == 'delivered'" decoration-info="picking_status == 'to_deliver'" decoration-warning="picking_status == 'partially_delivered'" decoration-danger="picking_status == 'cancel'" widget="badge" optional="show"/>
|
||||||
</field>
|
</field>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
@@ -63,20 +40,9 @@
|
|||||||
domain="[('picking_status', 'in', ('to_deliver', 'partially_delivered'))]"/>
|
domain="[('picking_status', 'in', ('to_deliver', 'partially_delivered'))]"/>
|
||||||
<filter string="Fully Delivered" name="fully_delivered"
|
<filter string="Fully Delivered" name="fully_delivered"
|
||||||
domain="[('picking_status', '=', 'delivered')]"/>
|
domain="[('picking_status', '=', 'delivered')]"/>
|
||||||
|
<separator/>
|
||||||
</filter>
|
</filter>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="procurement_group_form_view" model="ir.ui.view">
|
|
||||||
<field name="name">sale_stock_usability.procurement.group.form</field>
|
|
||||||
<field name="model">procurement.group</field>
|
|
||||||
<field name="inherit_id" ref="stock.procurement_group_form_view"/>
|
|
||||||
<field name="arch" type="xml">
|
|
||||||
<field name="move_type" position="after">
|
|
||||||
<field name="sale_id"/>
|
|
||||||
</field>
|
|
||||||
</field>
|
|
||||||
</record>
|
|
||||||
|
|
||||||
|
|
||||||
</odoo>
|
</odoo>
|
||||||
21
sale_stock_usability/views/stock_move.xml
Normal file
21
sale_stock_usability/views/stock_move.xml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
Copyright 2015-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_move_form" model="ir.ui.view">
|
||||||
|
<field name="name">sale_stock_usability.stock_move.form</field>
|
||||||
|
<field name="model">stock.move</field>
|
||||||
|
<field name="inherit_id" ref="stock.view_move_form"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="origin" position="after">
|
||||||
|
<field name="sale_line_id" readonly="1"/>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
</odoo>
|
||||||
21
sale_stock_usability/views/stock_picking.xml
Normal file
21
sale_stock_usability/views/stock_picking.xml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
Copyright 2015-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_picking_form" model="ir.ui.view">
|
||||||
|
<field name="name">sale_stock_usability.stock.picking.form</field>
|
||||||
|
<field name="model">stock.picking</field>
|
||||||
|
<field name="inherit_id" ref="stock.view_picking_form"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="group_id" position="before">
|
||||||
|
<field name="sale_id" readonly="1"/>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
</odoo>
|
||||||
Reference in New Issue
Block a user