restore product_update_price_last_purchase and pos_ticket_pricelist
This commit is contained in:
parent
412d897695
commit
b5bb678cbc
16 changed files with 1296 additions and 0 deletions
0
pos_ticket_pricelist/__init__.py
Normal file
0
pos_ticket_pricelist/__init__.py
Normal file
24
pos_ticket_pricelist/__manifest__.py
Normal file
24
pos_ticket_pricelist/__manifest__.py
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
# Copyright 2022 Criptomart
|
||||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
|
{
|
||||||
|
'name': 'Pos Ticket Pricelist',
|
||||||
|
'description': """
|
||||||
|
Prints the pricelist applied on tickets.""",
|
||||||
|
'version': "16.0.1.0.0",
|
||||||
|
'license': 'AGPL-3',
|
||||||
|
'author': 'Criptomart',
|
||||||
|
'website': 'https://criptomart.net',
|
||||||
|
'depends': [
|
||||||
|
"point_of_sale"
|
||||||
|
],
|
||||||
|
'data': [
|
||||||
|
],
|
||||||
|
'assets': {
|
||||||
|
'point_of_sale.assets': [
|
||||||
|
'pos_ticket_pricelist/static/src/xml/pos.xml'
|
||||||
|
],
|
||||||
|
},
|
||||||
|
'demo': [
|
||||||
|
],
|
||||||
|
}
|
||||||
20
pos_ticket_pricelist/static/src/xml/pos.xml
Normal file
20
pos_ticket_pricelist/static/src/xml/pos.xml
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<templates id="template" xml:space="preserve">
|
||||||
|
|
||||||
|
<t
|
||||||
|
t-name="OrderReceipt"
|
||||||
|
t-inherit="point_of_sale.OrderReceipt"
|
||||||
|
t-inherit-mode="extension"
|
||||||
|
owl="1"
|
||||||
|
>
|
||||||
|
<xpath expr='//t[@t-if="receipt.cashier"]' position="after">
|
||||||
|
<t t-if="props.order.pricelist">
|
||||||
|
<t t-esc="props.order.pricelist.name" /><br />
|
||||||
|
</t>
|
||||||
|
</xpath>
|
||||||
|
<xpath expr='//t[@t-if="receipt.company.website"]' position="attributes">
|
||||||
|
<attribute name="t-att-class">{'oe_hidden': True}</attribute>
|
||||||
|
</xpath>
|
||||||
|
</t>
|
||||||
|
|
||||||
|
</templates>
|
||||||
56
product_update_price_last_purchase/README.rst
Normal file
56
product_update_price_last_purchase/README.rst
Normal file
|
|
@ -0,0 +1,56 @@
|
||||||
|
=======================================
|
||||||
|
Product Update Price From Last Purchase
|
||||||
|
=======================================
|
||||||
|
|
||||||
|
..
|
||||||
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
!! This file is generated by oca-gen-addon-readme !!
|
||||||
|
!! changes will be overwritten. !!
|
||||||
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
!! source digest: sha256:9a3d6dc2e0410212d91f0fba1627ece05131bc10535ebe1e51b03c5a7026f30d
|
||||||
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
|
||||||
|
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
||||||
|
:target: https://odoo-community.org/page/development-status
|
||||||
|
:alt: Beta
|
||||||
|
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
|
||||||
|
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
||||||
|
:alt: License: AGPL-3
|
||||||
|
.. |badge3| image:: https://img.shields.io/badge/github-Criptomart%2Faddons_cm-lightgray.png?logo=github
|
||||||
|
:target: https://github.com/Criptomart/addons_cm/tree/16.0/product_update_price_last_purchase
|
||||||
|
:alt: Criptomart/addons_cm
|
||||||
|
|
||||||
|
|badge1| |badge2| |badge3|
|
||||||
|
|
||||||
|
Update price from last purchase price, using product classification
|
||||||
|
margin
|
||||||
|
|
||||||
|
**Table of contents**
|
||||||
|
|
||||||
|
.. contents::
|
||||||
|
:local:
|
||||||
|
|
||||||
|
Bug Tracker
|
||||||
|
===========
|
||||||
|
|
||||||
|
Bugs are tracked on `GitHub Issues <https://github.com/Criptomart/addons_cm/issues>`_.
|
||||||
|
In case of trouble, please check there if your issue has already been reported.
|
||||||
|
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
||||||
|
`feedback <https://github.com/Criptomart/addons_cm/issues/new?body=module:%20product_update_price_last_purchase%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
||||||
|
|
||||||
|
Do not contact contributors directly about support or help with technical issues.
|
||||||
|
|
||||||
|
Credits
|
||||||
|
=======
|
||||||
|
|
||||||
|
Authors
|
||||||
|
-------
|
||||||
|
|
||||||
|
* Criptomart
|
||||||
|
|
||||||
|
Maintainers
|
||||||
|
-----------
|
||||||
|
|
||||||
|
This module is part of the `Criptomart/addons_cm <https://github.com/Criptomart/addons_cm/tree/16.0/product_update_price_last_purchase>`_ project on GitHub.
|
||||||
|
|
||||||
|
You are welcome to contribute.
|
||||||
1
product_update_price_last_purchase/__init__.py
Normal file
1
product_update_price_last_purchase/__init__.py
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
from . import models
|
||||||
27
product_update_price_last_purchase/__manifest__.py
Normal file
27
product_update_price_last_purchase/__manifest__.py
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
{
|
||||||
|
"name": "Product Update Price From Last Purchase",
|
||||||
|
"version": "16.0.1.0.0",
|
||||||
|
"category": "purchase",
|
||||||
|
"summary": """"
|
||||||
|
Personaliza el comportamiento de Product para supermercados:
|
||||||
|
* Campo que guarda el último precio de compra en vez de usar standard_price
|
||||||
|
y no afectar a la valoración de inventario.
|
||||||
|
* Actualiza el precio de venta según el último precio de coste aplicado a una tarifa.
|
||||||
|
* Filtro para productos actualizados el último precio de coste.
|
||||||
|
* Filtro para productos que necesitan etiqueta nueva.
|
||||||
|
""",
|
||||||
|
"author": "Criptomart",
|
||||||
|
"website": "https://criptomart.net",
|
||||||
|
"license": "AGPL-3",
|
||||||
|
"depends": [
|
||||||
|
"account",
|
||||||
|
"stock_account",
|
||||||
|
"sale",
|
||||||
|
"product_margin_classification",
|
||||||
|
],
|
||||||
|
"data": [
|
||||||
|
"views/actions.xml",
|
||||||
|
"views/product_view.xml",
|
||||||
|
],
|
||||||
|
"installable": True,
|
||||||
|
}
|
||||||
282
product_update_price_last_purchase/i18n/es.po
Normal file
282
product_update_price_last_purchase/i18n/es.po
Normal file
|
|
@ -0,0 +1,282 @@
|
||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * product_update_price_last_purchase
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server 12.0\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2022-03-28 17:11+0000\n"
|
||||||
|
"PO-Revision-Date: 2022-03-28 17:11+0000\n"
|
||||||
|
"Last-Translator: <>\n"
|
||||||
|
"Language-Team: \n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Plural-Forms: \n"
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model.fields,field_description:product_update_price_last_purchase.field_product_product__list_price_automatic
|
||||||
|
#: model:ir.model.fields,field_description:product_update_price_last_purchase.field_product_template__list_price_automatic
|
||||||
|
msgid "Automatic Sale Price"
|
||||||
|
msgstr "Precio de venta automático"
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model.fields,help:product_update_price_last_purchase.field_product_product__list_price_automatic
|
||||||
|
#: model:ir.model.fields,help:product_update_price_last_purchase.field_product_template__list_price_automatic
|
||||||
|
msgid "Automatic computation of the PVP from the cost price and the rate defined in the configuration."
|
||||||
|
msgstr "Cálculo automático del PVP a partir del precio de coste y la tarifa definida en la configuración."
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.actions.report,name:product_update_price_last_purchase.report_productbarcode
|
||||||
|
msgid "Barcode"
|
||||||
|
msgstr "Código de barras"
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model.fields,help:product_update_price_last_purchase.field_product_pricelist_item__base
|
||||||
|
msgid "Base price for computation.\n"
|
||||||
|
"Public Price: The base price will be the Sale/public Price.\n"
|
||||||
|
"Cost Price : The base price will be the cost price.\n"
|
||||||
|
"Other Pricelist : Computation of the base price based on another Pricelist."
|
||||||
|
msgstr "Precio base de cálculo.\n"
|
||||||
|
"Precio Público: El precio base será el Precio Público / Venta.\n"
|
||||||
|
"Precio de costo: El precio base será el precio de costo.\n"
|
||||||
|
"Otra lista de precios: cálculo del precio base basado en otra lista de precios."
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model.fields,field_description:product_update_price_last_purchase.field_product_pricelist_item__base
|
||||||
|
msgid "Based on"
|
||||||
|
msgstr "Basado en"
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model.fields,help:product_update_price_last_purchase.field_product_product__last_purchase_price_compute_type
|
||||||
|
#: model:ir.model.fields,help:product_update_price_last_purchase.field_product_template__last_purchase_price_compute_type
|
||||||
|
msgid "Choose whether discounts should influence the calculation of the last purchase price. Select Never update for manual configuration of cost and sale prices.\n"
|
||||||
|
"\n"
|
||||||
|
"* Without discounts: does not take into account discounts when updating the last purchase price.\n"
|
||||||
|
"* First discount: take into account only first discount when updating the last purchase price.\n"
|
||||||
|
"* Triple discount: take into account all discounts when updating the last purchase price. Needs \"Purchase Triple Discount\" OCA module.\n"
|
||||||
|
"* Manual update: Select this for manual configuration of cost and sale price. The sales price will not be calculated automatically."
|
||||||
|
msgstr "Elija si los descuentos deben influir en la actualización del último precio de compra. Seleccione No actualizar nunca para la configuración manual de los precios de coste y venta.\n"
|
||||||
|
"\n"
|
||||||
|
"* Sin descuentos: no tiene en cuenta ningún descuento al actualizar el último precio de compra.\n"
|
||||||
|
"* Primer descuento: tiene en cuenta sólo el primer descuento al actualizar el último precio de compra.\n"
|
||||||
|
"* Triple descuento: tiene en cuenta todos los descuentos al actualizar el último precio de compra. Necesita el módulo OCA \"Purchase Triple Discount\".\n"
|
||||||
|
"* Actualización manual: configuración manual del precio de coste y de venta. El precio de venta no se calculará automáticamente."
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model,name:product_update_price_last_purchase.model_res_company
|
||||||
|
msgid "Companies"
|
||||||
|
msgstr "Compañías"
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model,name:product_update_price_last_purchase.model_res_config_settings
|
||||||
|
msgid "Config Settings"
|
||||||
|
msgstr "Opciones de Configuración"
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model.fields,field_description:product_update_price_last_purchase.field_product_packaging__qty
|
||||||
|
msgid "Contained Quantity"
|
||||||
|
msgstr "Cantidad contenida"
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: selection:product.pricelist.item,base:0
|
||||||
|
msgid "Cost"
|
||||||
|
msgstr "Coste"
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: selection:product.pricelist.item,base:0
|
||||||
|
msgid "Cost Price Tax Included"
|
||||||
|
msgstr "Precio de coste con impuesto incluido"
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model_terms:ir.ui.view,arch_db:product_update_price_last_purchase.res_config_settings_view_form_pricelists
|
||||||
|
msgid "Default pricelists for Coops"
|
||||||
|
msgstr "Tarifas por defecto para cooperativas"
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: selection:product.template,last_purchase_price_compute_type:0
|
||||||
|
msgid "First discount"
|
||||||
|
msgstr "Primer descuento"
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model.fields,field_description:product_update_price_last_purchase.field_product_product__last_purchase_price
|
||||||
|
#: model:ir.model.fields,field_description:product_update_price_last_purchase.field_product_template__last_purchase_price
|
||||||
|
#: model_terms:ir.ui.view,arch_db:product_update_price_last_purchase.product_view_inherit_list_price_auto
|
||||||
|
#: selection:product.pricelist.item,base:0
|
||||||
|
msgid "Last purchase price"
|
||||||
|
msgstr "Último precio de compra"
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model.fields,field_description:product_update_price_last_purchase.field_product_product__last_purchase_price_compute_type
|
||||||
|
#: model:ir.model.fields,field_description:product_update_price_last_purchase.field_product_template__last_purchase_price_compute_type
|
||||||
|
msgid "Last purchase price calculation type"
|
||||||
|
msgstr "Cálculo de último precio de compra"
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model.fields,field_description:product_update_price_last_purchase.field_product_product__list_price_updated
|
||||||
|
#: model:ir.model.fields,field_description:product_update_price_last_purchase.field_product_template__list_price_updated
|
||||||
|
msgid "Last purchase price updated"
|
||||||
|
msgstr "Último precio de compra actualizado"
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: selection:product.template,last_purchase_price_compute_type:0
|
||||||
|
msgid "Manual update"
|
||||||
|
msgstr "Actualización manual"
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: code:addons/product_update_price_last_purchase/models/product_template.py:38
|
||||||
|
#, python-format
|
||||||
|
msgid "Not found a valid pricelist to compute sale price. Check configuration in General Settings."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: selection:product.pricelist.item,base:0
|
||||||
|
msgid "Other Pricelist"
|
||||||
|
msgstr "Otra tarifa"
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model.fields,help:product_update_price_last_purchase.field_product_product__list_price
|
||||||
|
#: model:ir.model.fields,help:product_update_price_last_purchase.field_product_template__list_price
|
||||||
|
msgid "Price calculated according to the configured pricelist, including VAT."
|
||||||
|
msgstr "Precio calculado según la tarifa configurada, incluyendo el IVA."
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model,name:product_update_price_last_purchase.model_product_pricelist
|
||||||
|
msgid "Pricelist"
|
||||||
|
msgstr "Tarifa"
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model,name:product_update_price_last_purchase.model_product_pricelist_item
|
||||||
|
msgid "Pricelist Item"
|
||||||
|
msgstr "Elemento de tarifa"
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model.fields,field_description:product_update_price_last_purchase.field_res_config_settings__product_pricelist_automatic
|
||||||
|
msgid "Pricelist applied to automatic calculation of sales price"
|
||||||
|
msgstr "Tarifa aplicada al cálculo automático del precio de venta"
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model.fields,field_description:product_update_price_last_purchase.field_res_company__product_pricelist_automatic
|
||||||
|
msgid "Pricelist applied to the automatic selling price"
|
||||||
|
msgstr "Tarifa aplicada al PVP automáticamente"
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model,name:product_update_price_last_purchase.model_product_product
|
||||||
|
msgid "Product"
|
||||||
|
msgstr "Producto"
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.actions.report,name:product_update_price_last_purchase.report_product_product_barcode
|
||||||
|
#: model:ir.actions.report,name:product_update_price_last_purchase.report_product_template_barcode
|
||||||
|
#: model:ir.actions.report,name:product_update_price_last_purchase.report_productbarcode_laosa
|
||||||
|
#: model:ir.actions.report,name:product_update_price_last_purchase.report_simple_barcode_laosa
|
||||||
|
msgid "Product Barcode (PDF)"
|
||||||
|
msgstr "Código de barras del producto (PDF)"
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model,name:product_update_price_last_purchase.model_product_packaging
|
||||||
|
msgid "Product Packaging"
|
||||||
|
msgstr "Empaquetado del producto"
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model,name:product_update_price_last_purchase.model_product_template
|
||||||
|
msgid "Product Template"
|
||||||
|
msgstr "Plantilla de producto"
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model_terms:ir.ui.view,arch_db:product_update_price_last_purchase.view_product_search_form_inherit_tags
|
||||||
|
msgid "Products that have changed their sales price and no label has been printed."
|
||||||
|
msgstr "Productos que han cambiado su PVP y no se ha impreso su etiqueta."
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model_terms:ir.ui.view,arch_db:product_update_price_last_purchase.view_product_search_form_inherit_updated
|
||||||
|
msgid "Products that have recently changed their cost price and have not updated their selling price."
|
||||||
|
msgstr "Productos que han cambiado recientemente su precio de coste y no han actualizado su PVP."
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: selection:product.pricelist.item,base:0
|
||||||
|
msgid "Public Price"
|
||||||
|
msgstr "Precio público"
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model.fields,help:product_update_price_last_purchase.field_res_company__product_pricelist_automatic
|
||||||
|
#: model:ir.model.fields,help:product_update_price_last_purchase.field_res_config_settings__product_pricelist_automatic
|
||||||
|
msgid "Rate that applies to all products that update the selling price automatically."
|
||||||
|
msgstr "Tarifa que se aplica a todos los productos que actualizan el precio de venta automáticamente."
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model,name:product_update_price_last_purchase.model_ir_actions_report
|
||||||
|
msgid "Report Action"
|
||||||
|
msgstr "Reportar la acción"
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model.fields,field_description:product_update_price_last_purchase.field_product_product__list_price
|
||||||
|
#: model:ir.model.fields,field_description:product_update_price_last_purchase.field_product_template__list_price
|
||||||
|
msgid "Sale price with VAT"
|
||||||
|
msgstr "PVP con impuestos"
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model_terms:ir.ui.view,arch_db:product_update_price_last_purchase.product_view_inherit_list_price_auto
|
||||||
|
msgid "Sale price."
|
||||||
|
msgstr "PVP"
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model,name:product_update_price_last_purchase.model_stock_move
|
||||||
|
msgid "Stock Move"
|
||||||
|
msgstr "Movimiento de stock"
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model.fields,help:product_update_price_last_purchase.field_product_product__list_price_updated
|
||||||
|
#: model:ir.model.fields,help:product_update_price_last_purchase.field_product_template__list_price_updated
|
||||||
|
msgid "The last cost price has been updated and you need to update the selling price in the database, shelves and scales."
|
||||||
|
msgstr "Se ha actualizado el último precio de coste y hay que actualizar el PVP en la base de datos, lineales y las balanzas."
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model.fields,help:product_update_price_last_purchase.field_product_product__last_purchase_price
|
||||||
|
#: model:ir.model.fields,help:product_update_price_last_purchase.field_product_template__last_purchase_price
|
||||||
|
msgid "The last price at which the product was purchased. It is used as the base price field for calculating the product sale price."
|
||||||
|
msgstr "El último precio al que se compró el producto. Se utiliza como campo de precio base para calcular el precio de venta del producto."
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model.fields,help:product_update_price_last_purchase.field_product_product__to_print
|
||||||
|
#: model:ir.model.fields,help:product_update_price_last_purchase.field_product_template__to_print
|
||||||
|
msgid "The sale price has been updated on this product and needs to be updated on the shelf."
|
||||||
|
msgstr "El PVP ha sido actualizado en este producto y necesita ser actualizado en el lineal."
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model.fields,help:product_update_price_last_purchase.field_product_packaging__qty
|
||||||
|
msgid "The total number of products you can have per pallet or box."
|
||||||
|
msgstr "El numero total de productos que puede tener por palé o caja."
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model_terms:ir.ui.view,arch_db:product_update_price_last_purchase.view_product_search_form_inherit_tags
|
||||||
|
msgid "To print"
|
||||||
|
msgstr "Para imprimir"
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model.fields,field_description:product_update_price_last_purchase.field_product_product__to_print
|
||||||
|
#: model:ir.model.fields,field_description:product_update_price_last_purchase.field_product_template__to_print
|
||||||
|
msgid "To print label"
|
||||||
|
msgstr "Pendiente de imprimir etiqueta"
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model_terms:ir.ui.view,arch_db:product_update_price_last_purchase.view_product_search_form_inherit_updated
|
||||||
|
msgid "To update sales price"
|
||||||
|
msgstr "Pendiente de actualizar PVP"
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: selection:product.template,last_purchase_price_compute_type:0
|
||||||
|
msgid "Triple discount"
|
||||||
|
msgstr "Triple decuento"
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.actions.server,name:product_update_price_last_purchase.action_product_calculate_theoritical_price
|
||||||
|
msgid "Update Sales Price"
|
||||||
|
msgstr "Actualizar PVP"
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: selection:product.template,last_purchase_price_compute_type:0
|
||||||
|
msgid "Without discounts"
|
||||||
|
msgstr "Sin descuentos"
|
||||||
|
|
||||||
|
|
@ -0,0 +1,166 @@
|
||||||
|
# Translation of Odoo Server.
|
||||||
|
# This file contains the translation of the following modules:
|
||||||
|
# * product_update_price_last_purchase
|
||||||
|
#
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: Odoo Server 16.0\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2024-12-30 16:10+0000\n"
|
||||||
|
"PO-Revision-Date: 2024-12-30 16:10+0000\n"
|
||||||
|
"Last-Translator: \n"
|
||||||
|
"Language-Team: \n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: \n"
|
||||||
|
"Plural-Forms: \n"
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model.fields,help:product_update_price_last_purchase.field_product_product__last_purchase_price_received_compute_type
|
||||||
|
#: model:ir.model.fields,help:product_update_price_last_purchase.field_product_template__last_purchase_price_received_compute_type
|
||||||
|
msgid ""
|
||||||
|
"\n"
|
||||||
|
" Choose whether discounts should influence the calculation of the last purchase price.\n"
|
||||||
|
" Select Never update for manual configuration of cost and sale prices.\n"
|
||||||
|
"\n"
|
||||||
|
" * Without discounts: does not take into account discounts when updating\n"
|
||||||
|
" the last purchase price.\n"
|
||||||
|
"\n"
|
||||||
|
" * First discount: take into account only first discount when updating\n"
|
||||||
|
" the last purchase price.\n"
|
||||||
|
"\n"
|
||||||
|
" * Double discount: take into account two first discounts when updating\n"
|
||||||
|
" the last purchase price.\n"
|
||||||
|
"\n"
|
||||||
|
" * Triple discount: take into account all discounts when updating\n"
|
||||||
|
" the last purchase price.\n"
|
||||||
|
" Needs \"Purchase Triple Discount\" OCA module.\n"
|
||||||
|
"\n"
|
||||||
|
" * Manual update: Select this for manual configuration of cost and sale price.\n"
|
||||||
|
" The sales price will not be calculated automatically.\n"
|
||||||
|
" "
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model.fields,field_description:product_update_price_last_purchase.field_product_packaging__qty
|
||||||
|
msgid "Contained Quantity"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model.fields.selection,name:product_update_price_last_purchase.selection__product_template__margin_state__correct
|
||||||
|
msgid "Correct Margin"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model.fields.selection,name:product_update_price_last_purchase.selection__product_template__last_purchase_price_received_compute_type__with_two_discounts
|
||||||
|
msgid "Double discount"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model.fields.selection,name:product_update_price_last_purchase.selection__product_template__last_purchase_price_received_compute_type__with_discount
|
||||||
|
msgid "First discount"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model.fields,field_description:product_update_price_last_purchase.field_product_product__last_purchase_price_received
|
||||||
|
#: model:ir.model.fields,field_description:product_update_price_last_purchase.field_product_template__last_purchase_price_received
|
||||||
|
msgid "Last purchase price"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model.fields,field_description:product_update_price_last_purchase.field_product_product__last_purchase_price_received_compute_type
|
||||||
|
#: model:ir.model.fields,field_description:product_update_price_last_purchase.field_product_template__last_purchase_price_received_compute_type
|
||||||
|
msgid "Last purchase price calculation type"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model.fields.selection,name:product_update_price_last_purchase.selection__product_template__last_purchase_price_received_compute_type__manual_update
|
||||||
|
msgid "Manual update"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model,name:product_update_price_last_purchase.model_product_template
|
||||||
|
msgid "Product"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model,name:product_update_price_last_purchase.model_product_packaging
|
||||||
|
msgid "Product Packaging"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model,name:product_update_price_last_purchase.model_product_product
|
||||||
|
msgid "Product Variant"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model,name:product_update_price_last_purchase.model_stock_move
|
||||||
|
msgid "Stock Move"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model.fields,help:product_update_price_last_purchase.field_product_product__last_purchase_price_received
|
||||||
|
#: model:ir.model.fields,help:product_update_price_last_purchase.field_product_template__last_purchase_price_received
|
||||||
|
msgid ""
|
||||||
|
"The last price at which the product was purchased. It is used as the base "
|
||||||
|
"price field for calculating the product sale price."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model.fields,help:product_update_price_last_purchase.field_product_product__to_print_label
|
||||||
|
#: model:ir.model.fields,help:product_update_price_last_purchase.field_product_template__to_print_label
|
||||||
|
msgid ""
|
||||||
|
"The sale price has been updated on this product\n"
|
||||||
|
" and needs to be updated on the shelf."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model.fields,help:product_update_price_last_purchase.field_product_packaging__qty
|
||||||
|
msgid "The total number of products you can have per pallet or box."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model.fields,field_description:product_update_price_last_purchase.field_product_template__margin_state
|
||||||
|
msgid "Theoretical Price State"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model_terms:ir.ui.view,arch_db:product_update_price_last_purchase.view_product_search_form_inherit_updated
|
||||||
|
msgid "To print"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model.fields,field_description:product_update_price_last_purchase.field_product_product__to_print_label
|
||||||
|
#: model:ir.model.fields,field_description:product_update_price_last_purchase.field_product_template__to_print_label
|
||||||
|
msgid "To print label"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model_terms:ir.ui.view,arch_db:product_update_price_last_purchase.view_product_search_form_inherit_updated
|
||||||
|
msgid "To update sales price"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model.fields.selection,name:product_update_price_last_purchase.selection__product_template__margin_state__too_cheap
|
||||||
|
msgid "Too Cheap"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model.fields.selection,name:product_update_price_last_purchase.selection__product_template__margin_state__too_expensive
|
||||||
|
msgid "Too Expensive"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model.fields.selection,name:product_update_price_last_purchase.selection__product_template__last_purchase_price_received_compute_type__with_three_discounts
|
||||||
|
msgid "Triple discount"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.actions.server,name:product_update_price_last_purchase.action_product_calculate_theoritical_price
|
||||||
|
msgid "Update Sales Price"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: product_update_price_last_purchase
|
||||||
|
#: model:ir.model.fields.selection,name:product_update_price_last_purchase.selection__product_template__last_purchase_price_received_compute_type__without_discounts
|
||||||
|
msgid "Without discounts"
|
||||||
|
msgstr ""
|
||||||
3
product_update_price_last_purchase/models/__init__.py
Normal file
3
product_update_price_last_purchase/models/__init__.py
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
from . import product_template
|
||||||
|
from . import product_product
|
||||||
|
from . import stock_move
|
||||||
57
product_update_price_last_purchase/models/product_product.py
Normal file
57
product_update_price_last_purchase/models/product_product.py
Normal file
|
|
@ -0,0 +1,57 @@
|
||||||
|
# Copyright (C) 2020: Criptomart (https://criptomart.net)
|
||||||
|
# @author Santi Noreña (<santi@criptomart.net>)
|
||||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||||
|
|
||||||
|
import logging
|
||||||
|
|
||||||
|
from odoo import api, fields, models
|
||||||
|
|
||||||
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
class ProductProduct(models.Model):
|
||||||
|
_inherit = "product.product"
|
||||||
|
|
||||||
|
@api.depends(
|
||||||
|
"standard_price",
|
||||||
|
"last_purchase_price_received",
|
||||||
|
"lst_price",
|
||||||
|
"margin_classification_id",
|
||||||
|
"margin_classification_id.markup",
|
||||||
|
"margin_classification_id.price_round",
|
||||||
|
"margin_classification_id.price_surcharge",
|
||||||
|
"product_tmpl_id.taxes_id",
|
||||||
|
"product_tmpl_id.list_price",
|
||||||
|
)
|
||||||
|
def _compute_theoretical_multi(self):
|
||||||
|
res = super()._compute_theoretical_multi()
|
||||||
|
for product in self:
|
||||||
|
if product.last_purchase_price_received != 0:
|
||||||
|
(
|
||||||
|
product.margin_state,
|
||||||
|
product.theoretical_price,
|
||||||
|
product.theoretical_difference,
|
||||||
|
) = self._get_margin_info(
|
||||||
|
product.margin_classification_id,
|
||||||
|
product.taxes_id,
|
||||||
|
product.name,
|
||||||
|
product.last_purchase_price_received,
|
||||||
|
product.lst_price,
|
||||||
|
)
|
||||||
|
return res
|
||||||
|
|
||||||
|
def use_theoretical_price(self):
|
||||||
|
for product in self:
|
||||||
|
if product.last_purchase_price_received_compute_type != "manual_update":
|
||||||
|
product.lst_price = product.theoretical_price
|
||||||
|
product.to_print_label = True
|
||||||
|
|
||||||
|
|
||||||
|
class ProductPackaging(models.Model):
|
||||||
|
_inherit = "product.packaging"
|
||||||
|
|
||||||
|
qty = fields.Float(
|
||||||
|
"Contained Quantity",
|
||||||
|
help="The total number of products you can have per pallet or box.",
|
||||||
|
digits="Product Unit of Measure",
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,76 @@
|
||||||
|
# Copyright (C) 2020: Criptomart (https://criptomart.net)
|
||||||
|
# @author Santi Noreña (<santi@criptomart.net>)
|
||||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||||
|
|
||||||
|
from odoo import api, fields, models
|
||||||
|
|
||||||
|
|
||||||
|
class ProductTemplate(models.Model):
|
||||||
|
_inherit = "product.template"
|
||||||
|
|
||||||
|
margin_state = fields.Selection(store=True)
|
||||||
|
to_print_label = fields.Boolean(
|
||||||
|
string="To print label",
|
||||||
|
help="""The sale price has been updated on this product
|
||||||
|
and needs to be updated on the shelf.""",
|
||||||
|
default=False,
|
||||||
|
)
|
||||||
|
|
||||||
|
last_purchase_price_received = fields.Float(
|
||||||
|
string="Last purchase price",
|
||||||
|
help="The last price at which the product was purchased. "
|
||||||
|
"It is used as the base price field for calculating the product sale price.",
|
||||||
|
readonly=True,
|
||||||
|
digits="Product Price",
|
||||||
|
)
|
||||||
|
|
||||||
|
last_purchase_price_received_compute_type = fields.Selection(
|
||||||
|
[
|
||||||
|
("without_discounts", "Without discounts"),
|
||||||
|
("with_discount", "First discount"),
|
||||||
|
("with_two_discounts", "Double discount"),
|
||||||
|
("with_three_discounts", "Triple discount"),
|
||||||
|
("manual_update", "Manual update"),
|
||||||
|
],
|
||||||
|
string="Last purchase price calculation type",
|
||||||
|
help="""
|
||||||
|
Choose whether discounts should influence the calculation of the last purchase price.
|
||||||
|
Select Never update for manual configuration of cost and sale prices.\n
|
||||||
|
* Without discounts: does not take into account discounts when updating
|
||||||
|
the last purchase price.\n
|
||||||
|
* First discount: take into account only first discount when updating
|
||||||
|
the last purchase price.\n
|
||||||
|
* Double discount: take into account two first discounts when updating
|
||||||
|
the last purchase price.\n
|
||||||
|
* Triple discount: take into account all discounts when updating
|
||||||
|
the last purchase price.
|
||||||
|
Needs "Purchase Triple Discount" OCA module.\n
|
||||||
|
* Manual update: Select this for manual configuration of cost and sale price.
|
||||||
|
The sales price will not be calculated automatically.
|
||||||
|
""",
|
||||||
|
default="without_discounts",
|
||||||
|
required=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
@api.onchange(
|
||||||
|
"last_purchase_price_received",
|
||||||
|
"standard_price",
|
||||||
|
"taxes_id",
|
||||||
|
"margin_classification_id",
|
||||||
|
"list_price",
|
||||||
|
)
|
||||||
|
def _onchange_standard_price(self):
|
||||||
|
res = super()._onchange_standard_price()
|
||||||
|
if self.last_purchase_price_received != 0:
|
||||||
|
(
|
||||||
|
self.margin_state,
|
||||||
|
self.theoretical_price,
|
||||||
|
self.theoretical_difference,
|
||||||
|
) = self.env["product.product"]._get_margin_info(
|
||||||
|
self.margin_classification_id,
|
||||||
|
self.taxes_id,
|
||||||
|
self.name,
|
||||||
|
self.last_purchase_price_received,
|
||||||
|
self.list_price,
|
||||||
|
)
|
||||||
|
return res
|
||||||
71
product_update_price_last_purchase/models/stock_move.py
Normal file
71
product_update_price_last_purchase/models/stock_move.py
Normal file
|
|
@ -0,0 +1,71 @@
|
||||||
|
# Copyright 2016-2019 Akretion (http://www.akretion.com/)
|
||||||
|
# Copyright 2020 Criptomart <tech@criptomart.net>
|
||||||
|
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
|
||||||
|
# @author Santi Noreña (<santi@criptomart.net>)
|
||||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
|
import logging
|
||||||
|
|
||||||
|
from odoo import models
|
||||||
|
from odoo.tools import float_compare, float_is_zero, float_round
|
||||||
|
|
||||||
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
class StockMove(models.Model):
|
||||||
|
_inherit = "stock.move"
|
||||||
|
|
||||||
|
def product_price_update_before_done(self):
|
||||||
|
res = super(StockMove, self).product_price_update_before_done()
|
||||||
|
for move in self.filtered(lambda move: move.location_id.usage == "supplier"):
|
||||||
|
if (
|
||||||
|
move.product_id.last_purchase_price_received_compute_type
|
||||||
|
== "with_three_discounts"
|
||||||
|
):
|
||||||
|
price_updated = float_round(
|
||||||
|
move.purchase_line_id.price_subtotal
|
||||||
|
/ move.purchase_line_id.product_qty,
|
||||||
|
precision_digits=2,
|
||||||
|
)
|
||||||
|
elif (
|
||||||
|
move.product_id.last_purchase_price_received_compute_type
|
||||||
|
== "with_discount"
|
||||||
|
):
|
||||||
|
price_updated = float_round(
|
||||||
|
move.purchase_line_id.price_unit
|
||||||
|
* (1 - move.purchase_line_id.discount / 100),
|
||||||
|
precision_digits=2,
|
||||||
|
)
|
||||||
|
elif (
|
||||||
|
move.product_id.last_purchase_price_received_compute_type
|
||||||
|
== "with_two_discounts"
|
||||||
|
):
|
||||||
|
price_updated = float_round(
|
||||||
|
move.purchase_line_id.price_unit
|
||||||
|
* (1 - move.purchase_line_id.discount / 100)
|
||||||
|
* (1 - move.purchase_line_id.discount2 / 100),
|
||||||
|
precision_digits=2,
|
||||||
|
)
|
||||||
|
|
||||||
|
else:
|
||||||
|
price_updated = move.purchase_line_id.price_unit
|
||||||
|
|
||||||
|
if float_compare(
|
||||||
|
move.product_id.last_purchase_price_received,
|
||||||
|
price_updated,
|
||||||
|
precision_digits=2,
|
||||||
|
) and not float_is_zero(move.quantity_done, precision_digits=3):
|
||||||
|
_logger.info(
|
||||||
|
"Update last_purchase_price_received: %s for product %s Previous price: %s"
|
||||||
|
% (
|
||||||
|
price_updated,
|
||||||
|
move.product_id.default_code,
|
||||||
|
move.product_id.last_purchase_price_received,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
# Write last purchase price as SUPERUSER_ID
|
||||||
|
# warehouse manager may not have the right to write on products
|
||||||
|
move.product_id.with_company(move.company_id.id).sudo().write(
|
||||||
|
{"last_purchase_price_received": price_updated}
|
||||||
|
)
|
||||||
|
return res
|
||||||
2
product_update_price_last_purchase/readme/DESCRIPTION.md
Normal file
2
product_update_price_last_purchase/readme/DESCRIPTION.md
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
Update price from last purchase price, using product classification
|
||||||
|
margin
|
||||||
409
product_update_price_last_purchase/static/description/index.html
Normal file
409
product_update_price_last_purchase/static/description/index.html
Normal file
|
|
@ -0,0 +1,409 @@
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
|
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
|
||||||
|
<title>Product Update Price From Last Purchase</title>
|
||||||
|
<style type="text/css">
|
||||||
|
|
||||||
|
/*
|
||||||
|
:Author: David Goodger (goodger@python.org)
|
||||||
|
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
|
||||||
|
:Copyright: This stylesheet has been placed in the public domain.
|
||||||
|
|
||||||
|
Default cascading style sheet for the HTML output of Docutils.
|
||||||
|
|
||||||
|
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
|
||||||
|
customize this style sheet.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* used to remove borders from tables and images */
|
||||||
|
.borderless, table.borderless td, table.borderless th {
|
||||||
|
border: 0 }
|
||||||
|
|
||||||
|
table.borderless td, table.borderless th {
|
||||||
|
/* Override padding for "table.docutils td" with "! important".
|
||||||
|
The right padding separates the table cells. */
|
||||||
|
padding: 0 0.5em 0 0 ! important }
|
||||||
|
|
||||||
|
.first {
|
||||||
|
/* Override more specific margin styles with "! important". */
|
||||||
|
margin-top: 0 ! important }
|
||||||
|
|
||||||
|
.last, .with-subtitle {
|
||||||
|
margin-bottom: 0 ! important }
|
||||||
|
|
||||||
|
.hidden {
|
||||||
|
display: none }
|
||||||
|
|
||||||
|
.subscript {
|
||||||
|
vertical-align: sub;
|
||||||
|
font-size: smaller }
|
||||||
|
|
||||||
|
.superscript {
|
||||||
|
vertical-align: super;
|
||||||
|
font-size: smaller }
|
||||||
|
|
||||||
|
a.toc-backref {
|
||||||
|
text-decoration: none ;
|
||||||
|
color: black }
|
||||||
|
|
||||||
|
blockquote.epigraph {
|
||||||
|
margin: 2em 5em ; }
|
||||||
|
|
||||||
|
dl.docutils dd {
|
||||||
|
margin-bottom: 0.5em }
|
||||||
|
|
||||||
|
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Uncomment (and remove this text!) to get bold-faced definition list terms
|
||||||
|
dl.docutils dt {
|
||||||
|
font-weight: bold }
|
||||||
|
*/
|
||||||
|
|
||||||
|
div.abstract {
|
||||||
|
margin: 2em 5em }
|
||||||
|
|
||||||
|
div.abstract p.topic-title {
|
||||||
|
font-weight: bold ;
|
||||||
|
text-align: center }
|
||||||
|
|
||||||
|
div.admonition, div.attention, div.caution, div.danger, div.error,
|
||||||
|
div.hint, div.important, div.note, div.tip, div.warning {
|
||||||
|
margin: 2em ;
|
||||||
|
border: medium outset ;
|
||||||
|
padding: 1em }
|
||||||
|
|
||||||
|
div.admonition p.admonition-title, div.hint p.admonition-title,
|
||||||
|
div.important p.admonition-title, div.note p.admonition-title,
|
||||||
|
div.tip p.admonition-title {
|
||||||
|
font-weight: bold ;
|
||||||
|
font-family: sans-serif }
|
||||||
|
|
||||||
|
div.attention p.admonition-title, div.caution p.admonition-title,
|
||||||
|
div.danger p.admonition-title, div.error p.admonition-title,
|
||||||
|
div.warning p.admonition-title, .code .error {
|
||||||
|
color: red ;
|
||||||
|
font-weight: bold ;
|
||||||
|
font-family: sans-serif }
|
||||||
|
|
||||||
|
/* Uncomment (and remove this text!) to get reduced vertical space in
|
||||||
|
compound paragraphs.
|
||||||
|
div.compound .compound-first, div.compound .compound-middle {
|
||||||
|
margin-bottom: 0.5em }
|
||||||
|
|
||||||
|
div.compound .compound-last, div.compound .compound-middle {
|
||||||
|
margin-top: 0.5em }
|
||||||
|
*/
|
||||||
|
|
||||||
|
div.dedication {
|
||||||
|
margin: 2em 5em ;
|
||||||
|
text-align: center ;
|
||||||
|
font-style: italic }
|
||||||
|
|
||||||
|
div.dedication p.topic-title {
|
||||||
|
font-weight: bold ;
|
||||||
|
font-style: normal }
|
||||||
|
|
||||||
|
div.figure {
|
||||||
|
margin-left: 2em ;
|
||||||
|
margin-right: 2em }
|
||||||
|
|
||||||
|
div.footer, div.header {
|
||||||
|
clear: both;
|
||||||
|
font-size: smaller }
|
||||||
|
|
||||||
|
div.line-block {
|
||||||
|
display: block ;
|
||||||
|
margin-top: 1em ;
|
||||||
|
margin-bottom: 1em }
|
||||||
|
|
||||||
|
div.line-block div.line-block {
|
||||||
|
margin-top: 0 ;
|
||||||
|
margin-bottom: 0 ;
|
||||||
|
margin-left: 1.5em }
|
||||||
|
|
||||||
|
div.sidebar {
|
||||||
|
margin: 0 0 0.5em 1em ;
|
||||||
|
border: medium outset ;
|
||||||
|
padding: 1em ;
|
||||||
|
background-color: #ffffee ;
|
||||||
|
width: 40% ;
|
||||||
|
float: right ;
|
||||||
|
clear: right }
|
||||||
|
|
||||||
|
div.sidebar p.rubric {
|
||||||
|
font-family: sans-serif ;
|
||||||
|
font-size: medium }
|
||||||
|
|
||||||
|
div.system-messages {
|
||||||
|
margin: 5em }
|
||||||
|
|
||||||
|
div.system-messages h1 {
|
||||||
|
color: red }
|
||||||
|
|
||||||
|
div.system-message {
|
||||||
|
border: medium outset ;
|
||||||
|
padding: 1em }
|
||||||
|
|
||||||
|
div.system-message p.system-message-title {
|
||||||
|
color: red ;
|
||||||
|
font-weight: bold }
|
||||||
|
|
||||||
|
div.topic {
|
||||||
|
margin: 2em }
|
||||||
|
|
||||||
|
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
|
||||||
|
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
|
||||||
|
margin-top: 0.4em }
|
||||||
|
|
||||||
|
h1.title {
|
||||||
|
text-align: center }
|
||||||
|
|
||||||
|
h2.subtitle {
|
||||||
|
text-align: center }
|
||||||
|
|
||||||
|
hr.docutils {
|
||||||
|
width: 75% }
|
||||||
|
|
||||||
|
img.align-left, .figure.align-left, object.align-left, table.align-left {
|
||||||
|
clear: left ;
|
||||||
|
float: left ;
|
||||||
|
margin-right: 1em }
|
||||||
|
|
||||||
|
img.align-right, .figure.align-right, object.align-right, table.align-right {
|
||||||
|
clear: right ;
|
||||||
|
float: right ;
|
||||||
|
margin-left: 1em }
|
||||||
|
|
||||||
|
img.align-center, .figure.align-center, object.align-center {
|
||||||
|
display: block;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.align-center {
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.align-left {
|
||||||
|
text-align: left }
|
||||||
|
|
||||||
|
.align-center {
|
||||||
|
clear: both ;
|
||||||
|
text-align: center }
|
||||||
|
|
||||||
|
.align-right {
|
||||||
|
text-align: right }
|
||||||
|
|
||||||
|
/* reset inner alignment in figures */
|
||||||
|
div.align-right {
|
||||||
|
text-align: inherit }
|
||||||
|
|
||||||
|
/* div.align-center * { */
|
||||||
|
/* text-align: left } */
|
||||||
|
|
||||||
|
.align-top {
|
||||||
|
vertical-align: top }
|
||||||
|
|
||||||
|
.align-middle {
|
||||||
|
vertical-align: middle }
|
||||||
|
|
||||||
|
.align-bottom {
|
||||||
|
vertical-align: bottom }
|
||||||
|
|
||||||
|
ol.simple, ul.simple {
|
||||||
|
margin-bottom: 1em }
|
||||||
|
|
||||||
|
ol.arabic {
|
||||||
|
list-style: decimal }
|
||||||
|
|
||||||
|
ol.loweralpha {
|
||||||
|
list-style: lower-alpha }
|
||||||
|
|
||||||
|
ol.upperalpha {
|
||||||
|
list-style: upper-alpha }
|
||||||
|
|
||||||
|
ol.lowerroman {
|
||||||
|
list-style: lower-roman }
|
||||||
|
|
||||||
|
ol.upperroman {
|
||||||
|
list-style: upper-roman }
|
||||||
|
|
||||||
|
p.attribution {
|
||||||
|
text-align: right ;
|
||||||
|
margin-left: 50% }
|
||||||
|
|
||||||
|
p.caption {
|
||||||
|
font-style: italic }
|
||||||
|
|
||||||
|
p.credits {
|
||||||
|
font-style: italic ;
|
||||||
|
font-size: smaller }
|
||||||
|
|
||||||
|
p.label {
|
||||||
|
white-space: nowrap }
|
||||||
|
|
||||||
|
p.rubric {
|
||||||
|
font-weight: bold ;
|
||||||
|
font-size: larger ;
|
||||||
|
color: maroon ;
|
||||||
|
text-align: center }
|
||||||
|
|
||||||
|
p.sidebar-title {
|
||||||
|
font-family: sans-serif ;
|
||||||
|
font-weight: bold ;
|
||||||
|
font-size: larger }
|
||||||
|
|
||||||
|
p.sidebar-subtitle {
|
||||||
|
font-family: sans-serif ;
|
||||||
|
font-weight: bold }
|
||||||
|
|
||||||
|
p.topic-title {
|
||||||
|
font-weight: bold }
|
||||||
|
|
||||||
|
pre.address {
|
||||||
|
margin-bottom: 0 ;
|
||||||
|
margin-top: 0 ;
|
||||||
|
font: inherit }
|
||||||
|
|
||||||
|
pre.literal-block, pre.doctest-block, pre.math, pre.code {
|
||||||
|
margin-left: 2em ;
|
||||||
|
margin-right: 2em }
|
||||||
|
|
||||||
|
pre.code .ln { color: grey; } /* line numbers */
|
||||||
|
pre.code, code { background-color: #eeeeee }
|
||||||
|
pre.code .comment, code .comment { color: #5C6576 }
|
||||||
|
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
|
||||||
|
pre.code .literal.string, code .literal.string { color: #0C5404 }
|
||||||
|
pre.code .name.builtin, code .name.builtin { color: #352B84 }
|
||||||
|
pre.code .deleted, code .deleted { background-color: #DEB0A1}
|
||||||
|
pre.code .inserted, code .inserted { background-color: #A3D289}
|
||||||
|
|
||||||
|
span.classifier {
|
||||||
|
font-family: sans-serif ;
|
||||||
|
font-style: oblique }
|
||||||
|
|
||||||
|
span.classifier-delimiter {
|
||||||
|
font-family: sans-serif ;
|
||||||
|
font-weight: bold }
|
||||||
|
|
||||||
|
span.interpreted {
|
||||||
|
font-family: sans-serif }
|
||||||
|
|
||||||
|
span.option {
|
||||||
|
white-space: nowrap }
|
||||||
|
|
||||||
|
span.pre {
|
||||||
|
white-space: pre }
|
||||||
|
|
||||||
|
span.problematic {
|
||||||
|
color: red }
|
||||||
|
|
||||||
|
span.section-subtitle {
|
||||||
|
/* font-size relative to parent (h1..h6 element) */
|
||||||
|
font-size: 80% }
|
||||||
|
|
||||||
|
table.citation {
|
||||||
|
border-left: solid 1px gray;
|
||||||
|
margin-left: 1px }
|
||||||
|
|
||||||
|
table.docinfo {
|
||||||
|
margin: 2em 4em }
|
||||||
|
|
||||||
|
table.docutils {
|
||||||
|
margin-top: 0.5em ;
|
||||||
|
margin-bottom: 0.5em }
|
||||||
|
|
||||||
|
table.footnote {
|
||||||
|
border-left: solid 1px black;
|
||||||
|
margin-left: 1px }
|
||||||
|
|
||||||
|
table.docutils td, table.docutils th,
|
||||||
|
table.docinfo td, table.docinfo th {
|
||||||
|
padding-left: 0.5em ;
|
||||||
|
padding-right: 0.5em ;
|
||||||
|
vertical-align: top }
|
||||||
|
|
||||||
|
table.docutils th.field-name, table.docinfo th.docinfo-name {
|
||||||
|
font-weight: bold ;
|
||||||
|
text-align: left ;
|
||||||
|
white-space: nowrap ;
|
||||||
|
padding-left: 0 }
|
||||||
|
|
||||||
|
/* "booktabs" style (no vertical lines) */
|
||||||
|
table.docutils.booktabs {
|
||||||
|
border: 0px;
|
||||||
|
border-top: 2px solid;
|
||||||
|
border-bottom: 2px solid;
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
table.docutils.booktabs * {
|
||||||
|
border: 0px;
|
||||||
|
}
|
||||||
|
table.docutils.booktabs th {
|
||||||
|
border-bottom: thin solid;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
|
||||||
|
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
|
||||||
|
font-size: 100% }
|
||||||
|
|
||||||
|
ul.auto-toc {
|
||||||
|
list-style-type: none }
|
||||||
|
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="document" id="product-update-price-from-last-purchase">
|
||||||
|
<h1 class="title">Product Update Price From Last Purchase</h1>
|
||||||
|
|
||||||
|
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
!! This file is generated by oca-gen-addon-readme !!
|
||||||
|
!! changes will be overwritten. !!
|
||||||
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
!! source digest: sha256:9a3d6dc2e0410212d91f0fba1627ece05131bc10535ebe1e51b03c5a7026f30d
|
||||||
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
||||||
|
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/Criptomart/addons_cm/tree/16.0/product_update_price_last_purchase"><img alt="Criptomart/addons_cm" src="https://img.shields.io/badge/github-Criptomart%2Faddons_cm-lightgray.png?logo=github" /></a></p>
|
||||||
|
<p>Update price from last purchase price, using product classification
|
||||||
|
margin</p>
|
||||||
|
<p><strong>Table of contents</strong></p>
|
||||||
|
<div class="contents local topic" id="contents">
|
||||||
|
<ul class="simple">
|
||||||
|
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-1">Bug Tracker</a></li>
|
||||||
|
<li><a class="reference internal" href="#credits" id="toc-entry-2">Credits</a><ul>
|
||||||
|
<li><a class="reference internal" href="#authors" id="toc-entry-3">Authors</a></li>
|
||||||
|
<li><a class="reference internal" href="#maintainers" id="toc-entry-4">Maintainers</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="section" id="bug-tracker">
|
||||||
|
<h1><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h1>
|
||||||
|
<p>Bugs are tracked on <a class="reference external" href="https://github.com/Criptomart/addons_cm/issues">GitHub Issues</a>.
|
||||||
|
In case of trouble, please check there if your issue has already been reported.
|
||||||
|
If you spotted it first, help us to smash it by providing a detailed and welcomed
|
||||||
|
<a class="reference external" href="https://github.com/Criptomart/addons_cm/issues/new?body=module:%20product_update_price_last_purchase%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
|
||||||
|
<p>Do not contact contributors directly about support or help with technical issues.</p>
|
||||||
|
</div>
|
||||||
|
<div class="section" id="credits">
|
||||||
|
<h1><a class="toc-backref" href="#toc-entry-2">Credits</a></h1>
|
||||||
|
<div class="section" id="authors">
|
||||||
|
<h2><a class="toc-backref" href="#toc-entry-3">Authors</a></h2>
|
||||||
|
<ul class="simple">
|
||||||
|
<li>Criptomart</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="section" id="maintainers">
|
||||||
|
<h2><a class="toc-backref" href="#toc-entry-4">Maintainers</a></h2>
|
||||||
|
<p>This module is part of the <a class="reference external" href="https://github.com/Criptomart/addons_cm/tree/16.0/product_update_price_last_purchase">Criptomart/addons_cm</a> project on GitHub.</p>
|
||||||
|
<p>You are welcome to contribute.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
36
product_update_price_last_purchase/views/actions.xml
Normal file
36
product_update_price_last_purchase/views/actions.xml
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
<?xml version="1.0" ?>
|
||||||
|
<!--
|
||||||
|
Copyright (C) 2020-Today: La Osa (<https://laosa.coop/>)
|
||||||
|
@author: Criptomart (https://criptomart.net)
|
||||||
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||||
|
-->
|
||||||
|
<odoo>
|
||||||
|
|
||||||
|
<!-- Add action entry in the Action Menu for calculate sale price in Products -->
|
||||||
|
<record id="action_product_calculate_theoritical_price" model="ir.actions.server">
|
||||||
|
<field name="name">Update Sales Price</field>
|
||||||
|
<field name="model_id" ref="product.model_product_template" />
|
||||||
|
<field name="binding_model_id" ref="product.model_product_template" />
|
||||||
|
<field name="state">code</field>
|
||||||
|
<field name="code">
|
||||||
|
records.use_theoretical_price()
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<!-- Open products window with filter
|
||||||
|
<record id="action_product_template_list_price_updated" model="ir.actions.act_window">
|
||||||
|
<field name="name">Productos con PVP actualizable</field>
|
||||||
|
<field name="type">ir.actions.act_window</field>
|
||||||
|
<field name="res_model">product.template</field>
|
||||||
|
<field name="view_mode">tree,form</field>
|
||||||
|
<field name="view_id" ref="product.product_template_tree_view"/>
|
||||||
|
<field name="domain">[]</field>
|
||||||
|
<field name="context">{"search_default_products_updated_filter": 1}</field>
|
||||||
|
<field name="help" type="html">
|
||||||
|
<p class="oe_view_nocontent_create">
|
||||||
|
Todos los productos están actualizados.
|
||||||
|
</p>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
-->
|
||||||
|
</odoo>
|
||||||
66
product_update_price_last_purchase/views/product_view.xml
Normal file
66
product_update_price_last_purchase/views/product_view.xml
Normal file
|
|
@ -0,0 +1,66 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<odoo>
|
||||||
|
<data>
|
||||||
|
|
||||||
|
<!-- list automatic price tick in product sheet -->
|
||||||
|
<record model="ir.ui.view" id="product_view_inherit_list_price_auto">
|
||||||
|
<field name="name">product.list.price.automatic.form</field>
|
||||||
|
<field name="model">product.template</field>
|
||||||
|
<field name="type">form</field>
|
||||||
|
<field name="inherit_id" ref="product.product_template_form_view" />
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<label for="list_price" position="before">
|
||||||
|
<field name="last_purchase_price_received" />
|
||||||
|
<!-- attrs="{'readonly': 1}"-->
|
||||||
|
<!-- />-->
|
||||||
|
<field name="last_purchase_price_received_compute_type" />
|
||||||
|
<field name="to_print_label" />
|
||||||
|
</label>
|
||||||
|
<field name="standard_price" position="replace">
|
||||||
|
<field
|
||||||
|
name="standard_price"
|
||||||
|
attrs="{'readonly': [('last_purchase_price_received_compute_type','!=', 'manual_update')]}"
|
||||||
|
/>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record id="product_template_tree_view" model="ir.ui.view">
|
||||||
|
<field name="name">product.template.product.tree</field>
|
||||||
|
<field name="model">product.template</field>
|
||||||
|
<field name="inherit_id" ref="product.product_template_tree_view" />
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="standard_price" position="after">
|
||||||
|
<field name="last_purchase_price_received" />
|
||||||
|
<field name="margin_state" invisible="1" />
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<!--Filter for products that should update its sales price -->
|
||||||
|
<record id="view_product_search_form_inherit_updated" model="ir.ui.view">
|
||||||
|
<field name="name">view.product.search.form.inherit.updated</field>
|
||||||
|
<field name="model">product.template</field>
|
||||||
|
<field name="inherit_id" ref="product.product_template_search_view" />
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<xpath expr="//filter[@name='services']" position="before">
|
||||||
|
<filter
|
||||||
|
string="To update sales price"
|
||||||
|
name="products_updated_filter"
|
||||||
|
domain="[
|
||||||
|
('last_purchase_price_received_compute_type', '!=', 'manual_update'),
|
||||||
|
('margin_state','in', ['too_cheap', 'too_expensive'])
|
||||||
|
]"
|
||||||
|
/>
|
||||||
|
<filter
|
||||||
|
string="To print"
|
||||||
|
name="products_ready_to_print_filter"
|
||||||
|
domain="[('to_print_label', '=', True)]"
|
||||||
|
/>
|
||||||
|
<separator />
|
||||||
|
</xpath>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
</data>
|
||||||
|
</odoo>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue