Commit d1078668 authored by Tulio Ruiz's avatar Tulio Ruiz
Browse files

Merge branch '8.0' of github.com:Vauxoo/addons-vauxoo into 8.0-comment_invoide_validate-truiz

parents 3b2894c9 6957f604
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * message_post_model
# * message_post_model
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-05-04 19:11+0000\n"
"PO-Revision-Date: 2016-05-04 19:30+0000\n"
"PO-Revision-Date: 2016-05-25 22:09-0400\n"
"Last-Translator: Humberto Arocha <hbto@vauxoo.com>\n"
"Language-Team: Spanish <http://example.com/projects/addons-"
"vauxoo/message_post_model/es/>\n"
"Language-Team: Spanish <http://example.com/projects/addons-vauxoo/message_post_model/es/>\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 2.2-dev\n"
"X-Generator: Poedit 1.8.7.1\n"
#. module: message_post_model
#: code:addons/message_post_model/model/message_post.py:148
#, python-format
msgid "%s\n"
msgid ""
"%s\n"
"<h3>Line %s</h3>"
msgstr ""
"%s\n"
"<h3>Line %s</h3>"
"<h3>Línea %s</h3>"
#. module: message_post_model
#: code:addons/message_post_model/model/message_post.py:100
......@@ -80,9 +80,8 @@ msgstr "Seguidores"
#: help:message.post.show.all,message_summary:0
msgid "Holds the Chatter summary (number of messages, ...). This summary is directly in html format in order to be inserted in kanban views."
msgstr ""
"Contiene el sumario de Conversaciones (número de mensajes, ...). Este "
"sumario está directamente en formato html con el fin de ser insertado en las "
"vistas kanban."
"Contiene el sumario de Conversaciones (número de mensajes, ...). Este sumario está directamente en formato html con el fin de ser "
"insertado en las vistas kanban."
#. module: message_post_model
#: field:message.post.show.all,id:0
......@@ -125,8 +124,7 @@ msgid "Messages and communication history"
msgstr "Mensajes e historia de comunicación"
#. module: message_post_model
#: code:addons/message_post_model/model/message_post.py:75
#: code:addons/message_post_model/model/message_post.py:76
#: code:addons/message_post_model/model/message_post.py:75 code:addons/message_post_model/model/message_post.py:76
#, python-format
msgid "Removed Line"
msgstr "Línea Removida"
......
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * message_post_model
# * message_post_model
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-05-04 19:11+0000\n"
"PO-Revision-Date: 2016-05-04 19:30+0000\n"
"PO-Revision-Date: 2016-05-25 22:09-0400\n"
"Last-Translator: Humberto Arocha <hbto@vauxoo.com>\n"
"Language-Team: Spanish <http://example.com/projects/addons-"
"vauxoo/message_post_model/es/>\n"
"Language-Team: Spanish <http://example.com/projects/addons-vauxoo/message_post_model/es/>\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 2.2-dev\n"
"X-Generator: Poedit 1.8.7.1\n"
#. module: message_post_model
#: code:addons/message_post_model/model/message_post.py:148
#, python-format
msgid "%s\n"
msgid ""
"%s\n"
"<h3>Line %s</h3>"
msgstr ""
"%s\n"
"<h3>Line %s</h3>"
"<h3>Línea %s</h3>"
#. module: message_post_model
#: code:addons/message_post_model/model/message_post.py:100
......@@ -80,9 +80,8 @@ msgstr "Seguidores"
#: help:message.post.show.all,message_summary:0
msgid "Holds the Chatter summary (number of messages, ...). This summary is directly in html format in order to be inserted in kanban views."
msgstr ""
"Contiene el sumario de Conversaciones (número de mensajes, ...). Este "
"sumario está directamente en formato html con el fin de ser insertado en las "
"vistas kanban."
"Contiene el sumario de Conversaciones (número de mensajes, ...). Este sumario está directamente en formato html con el fin de ser "
"insertado en las vistas kanban."
#. module: message_post_model
#: field:message.post.show.all,id:0
......@@ -125,8 +124,7 @@ msgid "Messages and communication history"
msgstr "Mensajes e historia de comunicación"
#. module: message_post_model
#: code:addons/message_post_model/model/message_post.py:75
#: code:addons/message_post_model/model/message_post.py:76
#: code:addons/message_post_model/model/message_post.py:75 code:addons/message_post_model/model/message_post.py:76
#, python-format
msgid "Removed Line"
msgstr "Línea Removida"
......
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * message_post_model
# * message_post_model
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-05-04 19:11+0000\n"
"PO-Revision-Date: 2016-05-04 19:30+0000\n"
"PO-Revision-Date: 2016-05-25 22:09-0400\n"
"Last-Translator: Humberto Arocha <hbto@vauxoo.com>\n"
"Language-Team: Spanish <http://example.com/projects/addons-"
"vauxoo/message_post_model/es/>\n"
"Language-Team: Spanish <http://example.com/projects/addons-vauxoo/message_post_model/es/>\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 2.2-dev\n"
"X-Generator: Poedit 1.8.7.1\n"
#. module: message_post_model
#: code:addons/message_post_model/model/message_post.py:148
#, python-format
msgid "%s\n"
msgid ""
"%s\n"
"<h3>Line %s</h3>"
msgstr ""
"%s\n"
"<h3>Line %s</h3>"
"<h3>Línea %s</h3>"
#. module: message_post_model
#: code:addons/message_post_model/model/message_post.py:100
......@@ -80,9 +80,8 @@ msgstr "Seguidores"
#: help:message.post.show.all,message_summary:0
msgid "Holds the Chatter summary (number of messages, ...). This summary is directly in html format in order to be inserted in kanban views."
msgstr ""
"Contiene el sumario de Conversaciones (número de mensajes, ...). Este "
"sumario está directamente en formato html con el fin de ser insertado en las "
"vistas kanban."
"Contiene el sumario de Conversaciones (número de mensajes, ...). Este sumario está directamente en formato html con el fin de ser "
"insertado en las vistas kanban."
#. module: message_post_model
#: field:message.post.show.all,id:0
......@@ -125,8 +124,7 @@ msgid "Messages and communication history"
msgstr "Mensajes e historia de comunicación"
#. module: message_post_model
#: code:addons/message_post_model/model/message_post.py:75
#: code:addons/message_post_model/model/message_post.py:76
#: code:addons/message_post_model/model/message_post.py:75 code:addons/message_post_model/model/message_post.py:76
#, python-format
msgid "Removed Line"
msgstr "Línea Removida"
......
......@@ -84,15 +84,17 @@ class MessagePostShowAll(models.Model):
if val and info.get(val[0], False):
if val[0] == 0:
value = val[2]
message = u'%s\n<li><b>%s<b>: %s</li>' % \
message = '%s\n<li><b>%s<b>: %s</li>' % \
(message, info.get(val[0]), value.get(r_name),)
elif val[0] in (2, 3):
model_brw = obj.browse(val[1])
last_value = model_brw.name_get()
last_value = last_value and last_value[0][1]
value = val[1]
message = u'%s\n<li><b>%s<b>: %s</li>' % \
(message, info.get(val[0]), last_value)
message = '%s\n<li><b>%s<b>: %s</li>' % \
(self.get_encode_value(message),
self.get_encode_value(info.get(val[0])),
self.get_encode_value(last_value))
elif val[0] == 6:
lastv = list(set(val[2]) - set(last))
......@@ -103,14 +105,19 @@ class MessagePostShowAll(models.Model):
dele = [obj.browse(i).name_get()[0][1]
for i in lastv]
mes = ' - '.join(dele)
message = u'%s\n<li><b>%s %s<b>: %s</li>' % \
(message, add, string, mes)
message = '%s\n<li><b>%s %s<b>: %s</li>' % \
(self.get_encode_value(message),
add, string,
mes)
if not lastv and new:
dele = [obj.browse(i).name_get()[0][1] for i in new]
mes = '-'.join(dele)
message = u'%s\n<li><b>%s %s<b>: %s</li>' % \
(message, delete, string, mes)
message = '%s\n<li><b>%s %s<b>: %s</li>' % \
(self.get_encode_value(message),
delete,
string,
mes)
elif val[0] == 1:
vals = val[2]
......@@ -122,7 +129,7 @@ class MessagePostShowAll(models.Model):
last_value = is_many and self.get_last_value(
val[1], n_obj, field, 'many2many')
field_str = obj._fields[field].string
field_str = self.get_string_by_field(obj, field)
new_n_obj = obj._fields[field].comodel_name
mes = self.prepare_many_info(val[1],
vals[field],
......@@ -144,12 +151,32 @@ class MessagePostShowAll(models.Model):
message = id_line != val[1] and \
_('%s\n<h3>Line %s</h3>' % (message, val[1])) \
or message
message = '%s\n%s' % (message, mes)
message = '%s\n%s' % \
(self.get_encode_value(message),
mes)
id_line = val[1]
message = '%s\n</ul>' % message
message = '%s\n</ul>' % self.get_encode_value(message)
return message
@api.model
def get_string_by_field(self, source_obj, field):
"""Get the string of a field using fields_get method to
get the string depending of the user lang
@param source_obj: Model that contains the field
@type source_obj: RecordSet
@param field: Database name of the field
@type field: str or unicode
@returns: String of the field shown in the views
@rtype: str
"""
description = source_obj.fields_get([field])
description = description and description.get(field, {})
description = description and description.get('string', '') or ''
return description.encode('utf-8', 'ignore')
@api.model
def prepare_many2one_info(self, ids, n_obj, field, vals):
obj = self.env[n_obj]
......@@ -163,12 +190,23 @@ class MessagePostShowAll(models.Model):
new_value = new_value and new_value[0][1]
if not (last_value == new_value) and any((new_value, last_value)):
message = u'<li><b>%s<b>: %s → %s</li>' % \
(obj._fields[field].string,
last_value,
new_value)
message = '<li><b>%s<b>: %s → %s</li>' % \
(self.get_string_by_field(obj, field),
self.get_encode_value(last_value),
self.get_encode_value(new_value))
return message
@staticmethod
def get_encode_value(value):
"""Encode string values to avoid unicode errors
@param value: Any object to try encode the value
@type value: str bool date
"""
val = value
if isinstance(value, (unicode)):
val = value.encode('utf-8', 'ignore')
return val
@api.model
def prepare_simple_info(self, ids, n_obj, field,
vals):
......@@ -177,12 +215,13 @@ class MessagePostShowAll(models.Model):
last_value = self.get_last_value(
ids, obj._name, field, obj._fields[field].type)
if ((unicode(last_value) != unicode(vals[field])) and
if ((self.get_encode_value(last_value) !=
self.get_encode_value(vals[field])) and
any((last_value, vals[field]))):
message = u'<li><b>%s<b>: %s → %s</li>' % \
(obj._fields[field].string,
last_value,
vals[field])
message = '<li><b>%s<b>: %s → %s</li>' % \
(self.get_string_by_field(obj, field),
self.get_encode_value(last_value),
self.get_encode_value(vals[field]))
return message
# pylint: disable=W0106
......@@ -198,7 +237,7 @@ class MessagePostShowAll(models.Model):
last_value = is_many and self.get_last_value(
idx.id, self._name, field, 'many2many')
field_str = self._fields[field].string
field_str = self.get_string_by_field(self, field)
n_obj = self._fields[field].comodel_name
message = self.prepare_many_info(
idx.id, vals[field], field_str, n_obj,
......
......@@ -164,7 +164,7 @@ class StockLandedCost(models.Model):
'product_id': product_brw.id,
}
name = '{name}: {memo} - AVG'
name = u'{name}: {memo} - AVG'
if diff < 0:
name = name.format(
......@@ -328,7 +328,7 @@ class StockLandedCost(models.Model):
# NOTE: knowing how many products that were affected, COGS was to
# change, by this landed cost is not really necessary
name = '{name}: COGS - {memo}'
name = u'{name}: COGS - {memo}'
if diff > 0:
name = name.format(
name=product_brw.name, memo='[+]')
......
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:alt: License: AGPL-3
Stock Unfuck
=====================
This module is created by the need to customize and improve the stock module
and its related modules.
Customized methods:
**quants_get_prefered_domain**: This method for stock_quant object was changed to
specify the quants to use, send them by context avoiding choose another quant
not needed or create quant in specific locations(inventory, supplier,
production).
The value sent in the context must be equal to that have to be
returned by this method; List of tuples with two elements inside each tuple,
where the first element is a recordset of stock quant, and the second one is
the quantity that must be used of the quant(first element)
You need to be sure that the quants sent by context can be used, considering
the main fields used in filters to find quants(qty, location_id, owner, lot_id,
package_id, reservation_id), because this change can be very useful or very
dangerous and it can create inconsistences in the inventory.
Because of we are sending this value by context we can send it from any method
even if this is not directly in stock_quant, for example the action_done method
for stock_move.
e.g.
move_brw.with_context({'unfuck_quants': [(stock.quant(59,), 1.0)]}).action_done()
Contributors
------------
* Jose Morales <jose@vauxoo.com>
Maintainer
----------
.. image:: https://www.vauxoo.com/logo.png
:alt: Vauxoo
:target: https://vauxoo.com
This module is maintained by Vauxoo.
a latinamerican company that provides training, coaching,
development and implementation of enterprise management
sytems and bases its entire operation strategy in the use
of Open Source Software and its main product is odoo.
To contribute to this module, please visit http://www.vauxoo.com.
# coding: utf-8
###########################################################################
# Module Writen to OpenERP, Open Source Management Solution
#
# Copyright (c) 2013 Vauxoo - http://www.vauxoo.com
# All Rights Reserved.
# info@vauxoo.com
############################################################################
# Coded by: Jose Morales (jose@vauxoo.com)
# Planified by: Nhomar Hernandez <nhomar@vauxoo.com>
# Audited by: Jose Morales <jose@vauxoo.com>
############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from . import models
# coding: utf-8
###############################################################################
# Module Writen to OpenERP, Open Source Management Solution
# Copyright (C) OpenERP Venezuela (<http://www.vauxoo.com>).
# All Rights Reserved
# ############ Credits ########################################################
# Coded by: Jose Morales <jose@vauxoo.com>
# Planified by: Nhomar Hernandez <nhomar@vauxoo.com>
# Audited by: Jose Morales <jose@vauxoo.com>
# #############################################################################
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# ##############################################################################
{
"name": "Stock Unfuck",
"version": "8.0.0.1.6",
"author": "Vauxoo",
"category": "",
"website": "http://www.vauxoo.com/",
"license": "",
"depends": [
"stock",
],
"demo": [
'demo/product_demo.xml',
'demo/stock_demo.xml',
],
"data": [
],
"test": [],
"js": [],
"css": [],
"qweb": [],
"installable": True,
"auto_install": False,
}
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<record id="product_product_19" model="product.product">
<field name="name">Product to try the quants used</field>
<field name="categ_id" ref="product.product_category_8"/>
<field name="standard_price">1100.0</field>
<field name="list_price">1250.0</field>
<field name="type">product</field>
<field name="uom_id" ref="product.product_uom_unit"/>
<field name="uom_po_id" ref="product.product_uom_unit"/>
<field name="default_code">testb</field>
</record>
</data>
</openerp>
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<!-- Resource: stock.inventory -->
<record id="stock_inventory_unfuck" model="stock.inventory">
<field name="name">Initial Inventory</field>
</record>
<!-- Resource: stock.inventory.line -->
<record id="stock_inventory_line_1" model="stock.inventory.line">
<field name="product_id" ref="stock_unfuck.product_product_19"/>
<field name="product_uom_id" ref="product.product_uom_unit"/>
<field name="inventory_id" ref="stock_unfuck.stock_inventory_unfuck"/>
<field name="product_qty">12</field>
<field name="location_id" ref="stock.stock_location_stock"/>
</record>
<function model="stock.inventory" name="action_done">
<function eval="[[('id', '=', ref('stock_unfuck.stock_inventory_unfuck'))]]" model="stock.inventory" name="search"/>
</function>
</data>
</openerp>
# coding: utf-8
###########################################################################
# Module Writen to OpenERP, Open Source Management Solution
#
# Copyright (c) 2013 Vauxoo - http://www.vauxoo.com
# All Rights Reserved.
# info@vauxoo.com
############################################################################
# Coded by: Jose Morales (jose@vauxoo.com)
# Planified by: Nhomar Hernandez <nhomar@vauxoo.com>
# Audited by: Jose Morales <jose@vauxoo.com>
############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from . import stock
# coding: utf-8
###########################################################################
# Module Writen to OpenERP, Open Source Management Solution
#
# Copyright (c) 2013 Vauxoo - http://www.vauxoo.com
# All Rights Reserved.
# info@vauxoo.com
############################################################################
# Coded by: Jose Morales <jose@vauxoo.com>
# Planned by: Nhomar Hernandez <nhomar@vauxoo.com>
# Audited by: Jose Morales <jose@vauxoo.com>
############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp import models
class StockQuant(models.Model):
_inherit = 'stock.quant'
# pylint: disable=W0102
def quants_get_prefered_domain(self, cr, uid, location, product, qty,
domain=None, prefered_domain_list=[],
restrict_lot_id=False,
restrict_partner_id=False, context=None):
"""The original function tries to find quants in the given location for
the given domain.
This method is inherited to return specific quants if these are sending
by context, if not the quant returned are the found for the original
method.
"""
res = context.get('force_quant', False) or \
super(StockQuant, self).\
quants_get_prefered_domain(
cr, uid, location, product, qty, domain=domain,
prefered_domain_list=prefered_domain_list,
restrict_lot_id=restrict_lot_id,
restrict_partner_id=restrict_partner_id, context=context)
return res
<head>
<style>
.backgrounds{background-color:#fff;color:#a41d35}
</style>
</head>
<section class="oe_container">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan">
Stock Easy Internal Transfers