diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index c8a05a31a01..d21c96a4ea5 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -1799,15 +1799,15 @@ class AccountPartialReconcile(models.Model): 'amount_currency': self.amount_currency and line.currency_id.round(-line.amount_currency * amount / line.balance) or 0.0, 'partner_id': line.partner_id.id, }) - if newly_created_move: - if move_date > (self.company_id.period_lock_date or '0000-00-00') and newly_created_move.date != move_date: - # The move date should be the maximum date between payment and invoice (in case - # of payment in advance). However, we should make sure the move date is not - # recorded before the period lock date as the tax statement for this period is - # probably already sent to the estate. - newly_created_move.write({'date': move_date}) - # post move - newly_created_move.post() + if newly_created_move: + if move_date > (self.company_id.period_lock_date or '0000-00-00') and newly_created_move.date != move_date: + # The move date should be the maximum date between payment and invoice (in case + # of payment in advance). However, we should make sure the move date is not + # recorded before the period lock date as the tax statement for this period is + # probably already sent to the estate. + newly_created_move.write({'date': move_date}) + # post move + newly_created_move.post() def _create_tax_basis_move(self): # Check if company_journal for cash basis is set if not, raise exception diff --git a/addons/account/models/chart_template.py b/addons/account/models/chart_template.py index 974c3acb0fb..bb25cae9082 100644 --- a/addons/account/models/chart_template.py +++ b/addons/account/models/chart_template.py @@ -509,7 +509,7 @@ class AccountTaxTemplate(models.Model): amount_type = fields.Selection(default='percent', string="Tax Computation", required=True, selection=[('group', 'Group of Taxes'), ('fixed', 'Fixed'), ('percent', 'Percentage of Price'), ('division', 'Percentage of Price Tax Included')]) active = fields.Boolean(default=True, help="Set active to false to hide the tax without removing it.") - company_id = fields.Many2one('res.company', string='Company') + company_id = fields.Many2one('res.company', string='Company', default=lambda self: self.env.user.company_id) children_tax_ids = fields.Many2many('account.tax.template', 'account_tax_template_filiation_rel', 'parent_tax', 'child_tax', string='Children Taxes') sequence = fields.Integer(required=True, default=1, help="The sequence field is used to define order in which the tax lines are applied.") diff --git a/addons/account/tests/test_reconciliation.py b/addons/account/tests/test_reconciliation.py index 2353ec6fd7a..b4924a0caea 100644 --- a/addons/account/tests/test_reconciliation.py +++ b/addons/account/tests/test_reconciliation.py @@ -1,3 +1,4 @@ +from odoo import api from odoo.addons.account.tests.account_test_classes import AccountingTestCase from odoo.tests import tagged import time diff --git a/addons/base_address_extended/models/base_address_extended.py b/addons/base_address_extended/models/base_address_extended.py index 1ca0178ba20..1bdecd6acc3 100644 --- a/addons/base_address_extended/models/base_address_extended.py +++ b/addons/base_address_extended/models/base_address_extended.py @@ -131,6 +131,12 @@ class Partner(models.Model): for k, v in vals.items(): partner[k] = v + def write(self, vals): + res = super(Partner, self).write(vals) + if 'country_id' in vals: + self._set_street() + return res + class Company(models.Model): _inherit = 'res.company' diff --git a/addons/base_address_extended/tests/test_street_fields.py b/addons/base_address_extended/tests/test_street_fields.py index d5817070ffd..cf5598b624f 100644 --- a/addons/base_address_extended/tests/test_street_fields.py +++ b/addons/base_address_extended/tests/test_street_fields.py @@ -51,5 +51,5 @@ class TestStreetFields(TransactionCase): self.write_and_assert(p1, {'street': 'Chaussee de Namur'}, 'Chaussee de Namur', 'Chaussee de Namur', '', '') self.write_and_assert(p1, {'street_name': 'Chee de Namur', 'street_number': '40'}, 'Chee de Namur, 40', 'Chee de Namur', '40', '') self.write_and_assert(p1, {'street_number2': '4'}, 'Chee de Namur, 40/4', 'Chee de Namur', '40', '4') - #we don't recompute the street fields when we change the country - self.write_and_assert(p1, {'country_id': self.env.ref('base.us').id}, 'Chee de Namur, 40/4', 'Chee de Namur', '40', '4') + #we do recompute the street fields when we change the country + self.write_and_assert(p1, {'country_id': self.env.ref('base.us').id}, '40/4 Chee de Namur', 'Chee de Namur', '40', '4') diff --git a/addons/base_sparse_field/models/models.py b/addons/base_sparse_field/models/models.py index ef5fc4e5dbf..77ea36a6bd8 100644 --- a/addons/base_sparse_field/models/models.py +++ b/addons/base_sparse_field/models/models.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- -from odoo import models, fields, api +from odoo import models, fields, api, _ +from odoo.exceptions import UserError class IrModelFields(models.Model): diff --git a/addons/im_support/controllers/i18n/sw.po b/addons/im_support/controllers/i18n/sw.po new file mode 100644 index 00000000000..7d75d59d753 --- /dev/null +++ b/addons/im_support/controllers/i18n/sw.po @@ -0,0 +1,155 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * web_planner +# +# Translators: +# Mpasua Msonobari , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.saas~18\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-09-20 09:54+0000\n" +"PO-Revision-Date: 2017-09-20 09:54+0000\n" +"Last-Translator: Mpasua Msonobari , 2018\n" +"Language-Team: Swahili (https://www.transifex.com/odoo/teams/41243/sw/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: sw\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: web_planner +#: model:ir.model.fields,field_description:web_planner.field_web_planner_active +#: model:ir.ui.view,arch_db:web_planner.web_planner_view_search +msgid "Active" +msgstr "Amilifu" + +#. module: web_planner +#. openerp-web +#: code:addons/web_planner/static/src/js/web_planner_common.js:379 +#, python-format +msgid "Cancel" +msgstr "Katiza" + +#. module: web_planner +#: model:ir.model.fields,field_description:web_planner.field_web_planner_create_uid +msgid "Created by" +msgstr "" + +#. module: web_planner +#: model:ir.model.fields,field_description:web_planner.field_web_planner_create_date +msgid "Created on" +msgstr "" + +#. module: web_planner +#: model:ir.model.fields,field_description:web_planner.field_web_planner_data +msgid "Data" +msgstr "" + +#. module: web_planner +#: model:ir.model.fields,field_description:web_planner.field_web_planner_display_name +msgid "Display Name" +msgstr "" + +#. module: web_planner +#: model:ir.model.fields,field_description:web_planner.field_web_planner_id +msgid "ID" +msgstr "" + +#. module: web_planner +#: model:ir.model.fields,help:web_planner.field_web_planner_active +msgid "" +"If the active field is set to False, it will allow you to hide the planner. " +"This change requires a refresh of your page." +msgstr "" + +#. module: web_planner +#: model:ir.ui.view,arch_db:web_planner.web_planner_view_search +msgid "Inactive" +msgstr "" + +#. module: web_planner +#: model:ir.model.fields,field_description:web_planner.field_web_planner___last_update +msgid "Last Modified on" +msgstr "" + +#. module: web_planner +#: model:ir.model.fields,field_description:web_planner.field_web_planner_write_uid +msgid "Last Updated by" +msgstr "" + +#. module: web_planner +#: model:ir.model.fields,field_description:web_planner.field_web_planner_write_date +msgid "Last Updated on" +msgstr "" + +#. module: web_planner +#. openerp-web +#: code:addons/web_planner/static/src/js/web_planner_common.js:133 +#, python-format +msgid "Mark As Done" +msgstr "" + +#. module: web_planner +#: model:ir.model.fields,field_description:web_planner.field_web_planner_menu_id +msgid "Menu" +msgstr "" + +#. module: web_planner +#: model:ir.model.fields,field_description:web_planner.field_web_planner_name +msgid "Name" +msgstr "" + +#. module: web_planner +#. openerp-web +#: code:addons/web_planner/static/src/js/web_planner_common.js:141 +#, python-format +msgid "Next Step" +msgstr "" + +#. module: web_planner +#. openerp-web +#: code:addons/web_planner/static/src/js/web_planner_common.js:388 +#, python-format +msgid "Odoo Enterprise" +msgstr "" + +#. module: web_planner +#: model:ir.model,name:web_planner.model_web_planner +#: model:ir.ui.view,arch_db:web_planner.web_planner_view_search +#: model:ir.ui.view,arch_db:web_planner.web_planner_view_tree +msgid "Planner" +msgstr "" + +#. module: web_planner +#: model:ir.model.fields,field_description:web_planner.field_web_planner_planner_application +msgid "Planner Application" +msgstr "" + +#. module: web_planner +#: model:ir.model.fields,field_description:web_planner.field_web_planner_tooltip_planner +msgid "Planner Tooltips" +msgstr "" + +#. module: web_planner +#: model:ir.actions.act_window,name:web_planner.web_planner_action +#: model:ir.ui.menu,name:web_planner.web_planner_menu +msgid "Planners" +msgstr "" + +#. module: web_planner +#: model:ir.model.fields,field_description:web_planner.field_web_planner_progress +msgid "Progress Percentage" +msgstr "" + +#. module: web_planner +#: model:ir.model.fields,field_description:web_planner.field_web_planner_view_id +msgid "Template" +msgstr "" + +#. module: web_planner +#. openerp-web +#: code:addons/web_planner/static/src/js/web_planner_common.js:365 +#, python-format +msgid "Upgrade now" +msgstr "" diff --git a/addons/mail/models/mail_channel.py b/addons/mail/models/mail_channel.py index 19d758db641..d05aaba1504 100644 --- a/addons/mail/models/mail_channel.py +++ b/addons/mail/models/mail_channel.py @@ -4,7 +4,7 @@ import base64 from email.utils import formataddr import re -import uuid +from uuid import uuid4 from odoo import _, api, fields, models, modules, tools from odoo.exceptions import UserError @@ -56,7 +56,7 @@ class Channel(models.Model): ('channel', 'Channel')], 'Channel Type', default='channel') description = fields.Text('Description') - uuid = fields.Char('UUID', size=50, index=True, default=lambda self: '%s' % uuid.uuid4(), copy=False) + uuid = fields.Char('UUID', size=50, index=True, default=lambda self: str(uuid4()), copy=False) email_send = fields.Boolean('Send messages by email', default=False) # multi users channel channel_last_seen_partner_ids = fields.One2many('mail.channel.partner', 'channel_id', string='Last Seen') diff --git a/addons/point_of_sale/models/pos_config.py b/addons/point_of_sale/models/pos_config.py index 44ebafa3242..67e4f5a527b 100644 --- a/addons/point_of_sale/models/pos_config.py +++ b/addons/point_of_sale/models/pos_config.py @@ -2,7 +2,7 @@ # Part of Odoo. See LICENSE file for full copyright and licensing details. from datetime import datetime -import uuid +from uuid import uuid4 from odoo import api, fields, models, _ from odoo.exceptions import ValidationError @@ -114,7 +114,7 @@ class PosConfig(models.Model): proxy_ip = fields.Char(string='IP Address', size=45, help='The hostname or ip address of the hardware proxy, Will be autodetected if left empty.') active = fields.Boolean(default=True) - uuid = fields.Char(readonly=True, default=lambda self: str(uuid.uuid4()), + uuid = fields.Char(readonly=True, default=lambda self: str(uuid4()), help='A globally unique identifier for this pos configuration, used to prevent conflicts in client-generated data.') sequence_id = fields.Many2one('ir.sequence', string='Order IDs Sequence', readonly=True, help="This sequence is automatically created by Odoo but you can change it " diff --git a/addons/product/models/product.py b/addons/product/models/product.py index 78b4ddc3169..3584f6e5756 100644 --- a/addons/product/models/product.py +++ b/addons/product/models/product.py @@ -230,7 +230,7 @@ class ProductProduct(models.Model): def _compute_partner_ref(self): for supplier_info in self.seller_ids: if supplier_info.name.id == self._context.get('partner_id'): - product_name = supplier_info.product_name or self.default_code + product_name = supplier_info.product_name or self.default_code or self.name self.partner_ref = '%s%s' % (self.code and '[%s] ' % self.code or '', product_name) break else: diff --git a/addons/purchase/models/purchase.py b/addons/purchase/models/purchase.py index 789b37b95d3..a4264cd7db8 100644 --- a/addons/purchase/models/purchase.py +++ b/addons/purchase/models/purchase.py @@ -138,8 +138,8 @@ class PurchaseOrder(models.Model): ('invoiced', 'No Bill to Receive'), ], string='Billing Status', compute='_get_invoiced', store=True, readonly=True, copy=False, default='no') - picking_count = fields.Integer(compute='_compute_picking', string='Picking count', default=0, store=True) - picking_ids = fields.Many2many('stock.picking', compute='_compute_picking', string='Receptions', copy=False, store=True) + picking_count = fields.Integer(compute='_compute_picking', string='Picking count', default=0, store=True, compute_sudo=True) + picking_ids = fields.Many2many('stock.picking', compute='_compute_picking', string='Receptions', copy=False, store=True, compute_sudo=True) # There is no inverse function on purpose since the date may be different on each line date_planned = fields.Datetime(string='Scheduled Date', compute='_compute_date_planned', store=True, index=True) diff --git a/addons/purchase/models/stock.py b/addons/purchase/models/stock.py index 553c0f2917d..c009d3ba37b 100644 --- a/addons/purchase/models/stock.py +++ b/addons/purchase/models/stock.py @@ -186,3 +186,12 @@ class Orderpoint(models.Model): result['domain'] = "[('id','in',%s)]" % (purchase_ids.ids) return result + + +class PushedFlow(models.Model): + _inherit = "stock.location.path" + + def _prepare_move_copy_values(self, move_to_copy, new_date): + res = super()._prepare_move_copy_values(move_to_copy, new_date) + res['purchase_line_id'] = None + return res diff --git a/addons/purchase/views/purchase_views.xml b/addons/purchase/views/purchase_views.xml index 73d9732dec0..58a100ed06e 100644 --- a/addons/purchase/views/purchase_views.xml +++ b/addons/purchase/views/purchase_views.xml @@ -174,8 +174,8 @@
-