#12 debrand
This commit is contained in:
parent
5f4bb24894
commit
f874606369
6 changed files with 23 additions and 27 deletions
|
|
@ -1,10 +1,11 @@
|
||||||
{
|
{
|
||||||
'name': 'Product Update Sale Price',
|
'name': 'Product Update Price From Last Purchase',
|
||||||
'version': '12.0.1.1.0',
|
'version': '12.0.2.1.0',
|
||||||
'category': 'product',
|
'category': 'purchase',
|
||||||
'summary' : 'Allow updating list_price when the cost price changes in last purchase.',
|
'summary' : 'Product Update Price From Last Purchase',
|
||||||
'description' : """
|
'description' : """
|
||||||
* Setea los impuestos del proveedor al mismo tipo que el impuesto de venta.
|
Personaliza el comportamiento de Product para supermercados:
|
||||||
|
* setea los impuestos del proveedor al mismo tipo que el impuesto de venta.
|
||||||
* Actualiza el precio de venta según el precio de coste aplicado a una tarifa.
|
* Actualiza el precio de venta según el precio de coste aplicado a una tarifa.
|
||||||
* Filtro para productos actualizados el precio de coste.
|
* Filtro para productos actualizados el precio de coste.
|
||||||
* Filtro para productos que necesitan etiqueta nueva.
|
* Filtro para productos que necesitan etiqueta nueva.
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ class ProductTemplate(models.Model):
|
||||||
def _compute_theoritical_price(self):
|
def _compute_theoritical_price(self):
|
||||||
partner = self.env['res.users'].browse(self.env.uid).partner_id
|
partner = self.env['res.users'].browse(self.env.uid).partner_id
|
||||||
pricelist_obj = self.env['product.pricelist']
|
pricelist_obj = self.env['product.pricelist']
|
||||||
pricelist_id = self.env['ir.config_parameter'].sudo().get_param('product_laosa.product_pricelist_automatic') or False
|
pricelist_id = self.env['ir.config_parameter'].sudo().get_param('product_update_price_last_purchase.product_pricelist_automatic') or False
|
||||||
pricelist = pricelist_obj.browse(int(pricelist_id))
|
pricelist = pricelist_obj.browse(int(pricelist_id))
|
||||||
_logger.debug("Calculating price with PriceList : %s" %pricelist.name)
|
_logger.debug("Calculating price with PriceList : %s" %pricelist.name)
|
||||||
if pricelist:
|
if pricelist:
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,5 @@
|
||||||
#import logging
|
|
||||||
|
|
||||||
from odoo import models, fields, api
|
from odoo import models, fields, api
|
||||||
|
|
||||||
#_logger = logging.getLogger(__name__)
|
|
||||||
|
|
||||||
class ResConfigSettings(models.TransientModel):
|
class ResConfigSettings(models.TransientModel):
|
||||||
_inherit = 'res.config.settings'
|
_inherit = 'res.config.settings'
|
||||||
|
|
||||||
|
|
@ -19,7 +15,7 @@ class ResConfigSettings(models.TransientModel):
|
||||||
res = super(ResConfigSettings, self).get_values()
|
res = super(ResConfigSettings, self).get_values()
|
||||||
config_obj = self.env["ir.config_parameter"]
|
config_obj = self.env["ir.config_parameter"]
|
||||||
product_pricelist_automatic = config_obj.sudo().get_param(
|
product_pricelist_automatic = config_obj.sudo().get_param(
|
||||||
"product_laosa.product_pricelist_automatic", default=0)
|
"product_update_price_last_purchase.product_pricelist_automatic", default=0)
|
||||||
return res
|
return res
|
||||||
|
|
||||||
@api.multi
|
@api.multi
|
||||||
|
|
@ -27,7 +23,7 @@ class ResConfigSettings(models.TransientModel):
|
||||||
super(ResConfigSettings, self).set_values()
|
super(ResConfigSettings, self).set_values()
|
||||||
config_obj = self.env["ir.config_parameter"]
|
config_obj = self.env["ir.config_parameter"]
|
||||||
config_obj.sudo().set_param(
|
config_obj.sudo().set_param(
|
||||||
"product_laosa.product_pricelist_automatic",
|
"product_update_price_last_purchase.product_pricelist_automatic",
|
||||||
int(self.product_pricelist_automatic.id)
|
int(self.product_pricelist_automatic.id)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,11 +6,11 @@
|
||||||
string="Barcode"
|
string="Barcode"
|
||||||
model="product.product"
|
model="product.product"
|
||||||
report_type="qweb-pdf"
|
report_type="qweb-pdf"
|
||||||
name="product_laosa.report_productbarcode_laosa"
|
name="product_update_price_last_purchase.report_productbarcode_update"
|
||||||
file="product_laosa.report_productbarcode_laosa"/>
|
file="product_update_price_last_purchase.report_productbarcode_update"/>
|
||||||
|
|
||||||
<record id="report_productbarcode" model="ir.actions.report" >
|
<record id="report_productbarcode" model="ir.actions.report" >
|
||||||
<field name="paperformat_id" ref="product_laosa.paperformat_barcode"/>
|
<field name="paperformat_id" ref="product_update_price_last_purchase.paperformat_barcode"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<report
|
<report
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<record id="report_product_product_barcode" model="ir.actions.report" >
|
<record id="report_product_product_barcode" model="ir.actions.report" >
|
||||||
<field name="paperformat_id" ref="product_laosa.paperformat_barcode"/>
|
<field name="paperformat_id" ref="product_update_price_last_purchase.paperformat_barcode"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -39,11 +39,11 @@
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<record id="report_product_template_barcode" model="ir.actions.report" >
|
<record id="report_product_template_barcode" model="ir.actions.report" >
|
||||||
<field name="paperformat_id" ref="product_laosa.paperformat_barcode"/>
|
<field name="paperformat_id" ref="product_update_price_last_purchase.paperformat_barcode"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<report
|
<report
|
||||||
id="report_simple_barcode_laosa"
|
id="report_simple_barcode_update"
|
||||||
string="Product Barcode (PDF)"
|
string="Product Barcode (PDF)"
|
||||||
model="product.product"
|
model="product.product"
|
||||||
report_type="qweb-pdf"
|
report_type="qweb-pdf"
|
||||||
|
|
@ -52,12 +52,12 @@
|
||||||
print_report_name="'Products barcode - %s' % (object.name)"
|
print_report_name="'Products barcode - %s' % (object.name)"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<record id="report_simple_barcode_laosa" model="ir.actions.report" >
|
<record id="report_simple_barcode_update" model="ir.actions.report" >
|
||||||
<field name="paperformat_id" ref="product_laosa.paperformat_barcode"/>
|
<field name="paperformat_id" ref="product_update_price_last_purchase.paperformat_barcode"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<report
|
<report
|
||||||
id="report_productbarcode_laosa"
|
id="report_productbarcode_update"
|
||||||
string="Product Barcode (PDF)"
|
string="Product Barcode (PDF)"
|
||||||
model="product.product"
|
model="product.product"
|
||||||
report_type="qweb-pdf"
|
report_type="qweb-pdf"
|
||||||
|
|
@ -66,8 +66,8 @@
|
||||||
print_report_name="'Products barcode - %s' % (object.name)"
|
print_report_name="'Products barcode - %s' % (object.name)"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<record id="report_productbarcode_laosa" model="ir.actions.report" >
|
<record id="report_productbarcode_update" model="ir.actions.report" >
|
||||||
<field name="paperformat_id" ref="product_laosa.paperformat_barcode"/>
|
<field name="paperformat_id" ref="product_update_price_last_purchase.paperformat_barcode"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<template id="report_simple_barcode_laosa" inherit_id="product.report_simple_barcode" >
|
<template id="report_simple_barcode_update" inherit_id="product.report_simple_barcode" >
|
||||||
<xpath expr="." position="replace">
|
<xpath expr="." position="replace">
|
||||||
<t t-name="product.report_simple_barcode">
|
<t t-name="product.report_simple_barcode">
|
||||||
<div style="height: 1.65cm; width: 3.5cm; margin-top: 0.2mm; padding: 0; text-align: center; position: relative; display: inline-table; border: 2px solid black;">
|
<div style="height: 1.65cm; width: 3.5cm; margin-top: 0.2mm; padding: 0; text-align: center; position: relative; display: inline-table; border: 2px solid black;">
|
||||||
|
|
@ -16,13 +16,13 @@
|
||||||
</xpath>
|
</xpath>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template id="report_productbarcode_laosa" inherit_id="product.report_productbarcode">
|
<template id="report_productbarcode_update" inherit_id="product.report_productbarcode">
|
||||||
<xpath expr="." position="replace">
|
<xpath expr="." position="replace">
|
||||||
<t t-name="product.report_productbarcode">
|
<t t-name="product.report_productbarcode">
|
||||||
<t t-call="web.html_container">
|
<t t-call="web.html_container">
|
||||||
<div class="page" >
|
<div class="page" >
|
||||||
<t t-foreach="docs" t-as="product">
|
<t t-foreach="docs" t-as="product">
|
||||||
<t t-call="product.report_simple_barcode_laosa">
|
<t t-call="product.report_simple_barcode_update">
|
||||||
<t t-set="product" t-value="product"/>
|
<t t-set="product" t-value="product"/>
|
||||||
</t>
|
</t>
|
||||||
</t>
|
</t>
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,6 @@
|
||||||
<!-- Settings Window -->
|
<!-- Settings Window -->
|
||||||
<record id="res_config_settings_view_form_pricelists" model="ir.ui.view">
|
<record id="res_config_settings_view_form_pricelists" model="ir.ui.view">
|
||||||
<field name="name">product_update_price_last_purchase.res.config.settings.form</field>
|
<field name="name">product_update_price_last_purchase.res.config.settings.form</field>
|
||||||
<!-- <field name="name">res.config.settings.view.form.inherit.sale.pricelists</field>-->
|
|
||||||
<field name="model">res.config.settings</field>
|
<field name="model">res.config.settings</field>
|
||||||
<field name="priority" eval="100"/>
|
<field name="priority" eval="100"/>
|
||||||
<field name="inherit_id" ref="stock.res_config_settings_view_form"/>
|
<field name="inherit_id" ref="stock.res_config_settings_view_form"/>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue