diff --git a/addons/account/models/account_bank_statement.py b/addons/account/models/account_bank_statement.py index c0ddcdc7099..882172dd917 100644 --- a/addons/account/models/account_bank_statement.py +++ b/addons/account/models/account_bank_statement.py @@ -266,12 +266,12 @@ class AccountBankStatement(models.Model): """ Changes statement state to Running.""" for statement in self: if not statement.name: - context = {'ir_sequence_date', statement.date} + context = {'ir_sequence_date': statement.date} if statement.journal_id.sequence_id: - st_number = statement.journal_id.sequence_id.with_context(context).next_by_id() + st_number = statement.journal_id.sequence_id.with_context(**context).next_by_id() else: SequenceObj = self.env['ir.sequence'] - st_number = SequenceObj.with_context(context).next_by_code('account.bank.statement') + st_number = SequenceObj.with_context(**context).next_by_code('account.bank.statement') statement.name = st_number statement.state = 'open' diff --git a/addons/account/views/account_view.xml b/addons/account/views/account_view.xml index 091ebf21daa..0e71985b557 100644 --- a/addons/account/views/account_view.xml +++ b/addons/account/views/account_view.xml @@ -1053,7 +1053,7 @@ class="oe_link" type="object" string="-> View partially reconciled entries" - attrs="{'invisible': ['|', ('full_reconcile_id', '=', True), '&', ('matched_debit_ids', '=', []),('matched_credit_ids', '=', [])]}"> + attrs="{'invisible': ['|', ('full_reconcile_id', '!=', False), '&', ('matched_debit_ids', '=', []),('matched_credit_ids', '=', [])]}"> diff --git a/addons/account/views/report_invoice.xml b/addons/account/views/report_invoice.xml index 67f99a43fe6..9809cf93e54 100644 --- a/addons/account/views/report_invoice.xml +++ b/addons/account/views/report_invoice.xml @@ -171,6 +171,8 @@

Duplicate + refund + invoice

diff --git a/addons/board/static/src/js/dashboard.js b/addons/board/static/src/js/dashboard.js index eb458812a57..68e45762593 100644 --- a/addons/board/static/src/js/dashboard.js +++ b/addons/board/static/src/js/dashboard.js @@ -181,6 +181,8 @@ var DashBoard = form_common.FormWidget.extend({ action = result, view_mode = action_attrs.view_mode; + if (!action) { return; } + // evaluate action_attrs context and domain action_attrs.context_string = action_attrs.context; action_attrs.context = pyeval.eval( diff --git a/addons/calendar/models/calendar.py b/addons/calendar/models/calendar.py index d55b35ae36c..2c3fa12fa5e 100644 --- a/addons/calendar/models/calendar.py +++ b/addons/calendar/models/calendar.py @@ -527,9 +527,23 @@ class Meeting(models.Model): return partners @api.multi - def _get_recurrent_date_by_event(self): - """ Get recurrent dates based on Rule string and all event where recurrent_id is child """ + def _get_recurrent_dates_by_event(self): + """ Get recurrent start and stop dates based on Rule string""" + start_dates = self._get_recurrent_date_by_event(date_field='start') + stop_dates = self._get_recurrent_date_by_event(date_field='stop') + return zip(start_dates, stop_dates) + + @api.multi + def _get_recurrent_date_by_event(self, date_field='start'): + """ Get recurrent dates based on Rule string and all event where recurrent_id is child + + date_field: the field containing the reference date information for recurrency computation + """ self.ensure_one() + if date_field in self._fields.keys() and self._fields[date_field].type in ('date', 'datetime'): + reference_date = self[date_field] + else: + reference_date = self.start def todate(date): val = parser.parse(''.join((re.compile('\d')).findall(date))) @@ -539,14 +553,14 @@ class Meeting(models.Model): return val.astimezone(timezone) timezone = pytz.timezone(self._context.get('tz') or 'UTC') - startdate = pytz.UTC.localize(fields.Datetime.from_string(self.start)) # Add "+hh:mm" timezone - if not startdate: - startdate = datetime.now() + event_date = pytz.UTC.localize(fields.Datetime.from_string(reference_date)) # Add "+hh:mm" timezone + if not event_date: + event_date = datetime.now() - # Convert the start date to saved timezone (or context tz) as it'll + # Convert the event date to saved timezone (or context tz) as it'll # define the correct hour/day asked by the user to repeat for recurrence. - startdate = startdate.astimezone(timezone) # transform "+hh:mm" timezone - rset1 = rrule.rrulestr(str(self.rrule), dtstart=startdate, forceset=True) + event_date = event_date.astimezone(timezone) # transform "+hh:mm" timezone + rset1 = rrule.rrulestr(str(self.rrule), dtstart=event_date, forceset=True) recurring_meetings = self.search([('recurrent_id', '=', self.id), '|', ('active', '=', False), ('active', '=', True)]) for meeting in recurring_meetings: @@ -998,27 +1012,38 @@ class Meeting(models.Model): result.append(meeting.id) result_data.append(meeting.get_search_fields(order_fields)) continue - rdates = meeting._get_recurrent_date_by_event() + rdates = meeting._get_recurrent_dates_by_event() - for r_date in rdates: + for r_start_date, r_stop_date in rdates: # fix domain evaluation # step 1: check date and replace expression by True or False, replace other expressions by True # step 2: evaluation of & and | # check if there are one False pile = [] ok = True + r_date = r_start_date # default for empty domain for arg in domain: if str(arg[0]) in ('start', 'stop', 'final_date'): + if str(arg[0]) == 'start': + r_date = r_start_date + else: + r_date = r_stop_date + if arg[2] and len(arg[2]) > len(r_date.strftime(DEFAULT_SERVER_DATE_FORMAT)): + dformat = DEFAULT_SERVER_DATETIME_FORMAT + else: + dformat = DEFAULT_SERVER_DATE_FORMAT if (arg[1] == '='): - ok = r_date.strftime('%Y-%m-%d') == arg[2] + ok = r_date.strftime(dformat) == arg[2] if (arg[1] == '>'): - ok = r_date.strftime('%Y-%m-%d') > arg[2] + ok = r_date.strftime(dformat) > arg[2] if (arg[1] == '<'): - ok = r_date.strftime('%Y-%m-%d') < arg[2] + ok = r_date.strftime(dformat) < arg[2] if (arg[1] == '>='): - ok = r_date.strftime('%Y-%m-%d') >= arg[2] + ok = r_date.strftime(dformat) >= arg[2] if (arg[1] == '<='): - ok = r_date.strftime('%Y-%m-%d') <= arg[2] + ok = r_date.strftime(dformat) <= arg[2] + if (arg[1] == '!='): + ok = r_date.strftime(dformat) != arg[2] pile.append(ok) elif str(arg) == str('&') or str(arg) == str('|'): pile.append(arg) @@ -1534,6 +1559,18 @@ class Meeting(models.Model): if not self._context.get('virtual_id', True): return super(Meeting, self).search(new_args, offset=offset, limit=limit, order=order, count=count) + if any(arg[0] == 'start' for arg in args) and \ + not any(arg[0] in ('stop', 'final_date') for arg in args): + # domain with a start filter but with no stop clause should be extended + # e.g. start=2017-01-01, count=5 => virtual occurences must be included in ('start', '>', '2017-01-02') + start_args = new_args + new_args = [] + for arg in start_args: + new_arg = arg + if arg[0] in ('start_date', 'start_datetime', 'start',): + new_args += ['|', '&', ('recurrency', '=', 1), ('final_date', arg[1], arg[2])] + new_args.append(new_arg) + # offset, limit, order and count must be treated separately as we may need to deal with virtual ids events = super(Meeting, self).search(new_args, offset=0, limit=0, order=None, count=False) events = self.browse(events.get_recurrent_ids(args, order=order)) diff --git a/addons/calendar/tests/test_calendar_recurrent_event_case2.py b/addons/calendar/tests/test_calendar_recurrent_event_case2.py index da39fa6509b..e05428593ae 100644 --- a/addons/calendar/tests/test_calendar_recurrent_event_case2.py +++ b/addons/calendar/tests/test_calendar_recurrent_event_case2.py @@ -96,3 +96,52 @@ class TestRecurrentEvent(common.TransactionCase): # I update the description of two meetings, and check that both have been updated self.calendar_event_sprint_review.write({'description': "Some description"}) self.assertEqual(self.calendar_event_sprint_review.description, "Some description", "Event %d has not been updated" % self.calendar_event_sprint_review.id) + + def test_recurrent_meeting4(self): + # I create a weekly meeting till a particular end date. + self.CalendarEvent.create({ + 'start': '2017-01-22 11:47:00', + 'stop': '2017-01-22 12:47:00', + 'day': 0.0, + 'duration': 1.0, + 'final_date': '2017-06-30', + 'end_type': 'end_date', + 'fr': True, + 'mo': True, + 'th': True, + 'tu': True, + 'we': True, + 'name': 'Review code with programmer', + 'recurrency': True, + 'rrule_type': 'weekly' + }) + + # I search for a recurrent weekly meetings that take place at a given date. + meetings_count = self.CalendarEvent.with_context({'virtual_id': True}).search_count([ + ('start', '<=', '2017-01-24'), ('stop', '>=', '2017-01-24'), ('name', '=', 'Review code with programmer') + ]) + self.assertEqual(meetings_count, 1, 'Recurrent weekly meetings are not found using date filter !') + + # I search for a recurrent weekly meetings that take place at a given date and time. + meetings_count = self.CalendarEvent.with_context({'virtual_id': True}).search_count([ + ('start', '<=', '2017-01-24 11:55:00'), ('stop', '>=', '2017-01-24 11:55:00'), ('name', '=', 'Review code with programmer') + ]) + self.assertEqual(meetings_count, 1, 'Recurrent weekly meetings are not found using time filter !') + + # I search using the filter 'start date is set' + meetings_count = self.CalendarEvent.with_context({'virtual_id': True}).search_count([ + ('start', '!=', False), ('stop', '>=', '2017-06-30 11:55:00'), ('name', '=', 'Review code with programmer') + ]) + self.assertEqual(meetings_count, 1, "Last recurrent weekly meetings are not found using 'is set' filter !") + + # I search for a recurrent weekly meetings that take place at a given date and time. + meetings_count = self.CalendarEvent.with_context({'virtual_id': True}).search_count([ + ('start', '<=', '2017-01-24 11:55:00'), ('stop', '>=', '2017-01-24 15:55:00') + ]) + self.assertEqual(meetings_count, 0, 'Too late recurrent meetings are found using time filter !') + + # I search using a start filter but no stop + meetings_count = self.CalendarEvent.with_context({'virtual_id': True}).search_count([ + ('start', '>=', '2017-06-30 08:00:00'), ('name', '=', 'Review code with programmer') + ]) + self.assertEqual(meetings_count, 1, "Last recurrent weekly meetings are not found without stop filter !") diff --git a/addons/crm/models/crm_lead.py b/addons/crm/models/crm_lead.py index a86d64cdac9..c0614c034e0 100644 --- a/addons/crm/models/crm_lead.py +++ b/addons/crm/models/crm_lead.py @@ -466,24 +466,21 @@ class Lead(models.Model): """ title = "%s : %s\n" % (_('Merged opportunity') if self.type == 'opportunity' else _('Merged lead'), self.name) body = [title] - for field_name in fields: - field = self._fields.get(field_name) - if field is None: - continue - - value = self[field_name] - if field.type == 'selection': + fields = self.env['ir.model.fields'].search([('name', 'in', fields or []), ('model_id.model', '=', self._name)]) + for field in fields: + value = self[field.name] + if field.ttype == 'selection': value = dict(field.get_values(self.env)).get(value, value) - elif field.type == 'many2one': + elif field.ttype == 'many2one': if value: value = value.sudo().name_get()[0][1] - elif field.type == 'many2many': + elif field.ttype == 'many2many': if value: value = ','.join( val.name_get()[0][1] for val in value.sudo() ) - body.append("%s: %s" % (field.string, value or '')) + body.append("%s: %s" % (field.field_description, value or '')) return "
".join(body + ['
']) @api.multi diff --git a/addons/crm/views/crm_team_views.xml b/addons/crm/views/crm_team_views.xml index ed45e69378a..7b007b8a531 100644 --- a/addons/crm/views/crm_team_views.xml +++ b/addons/crm/views/crm_team_views.xml @@ -146,6 +146,7 @@ ir.actions.act_window form form + [('type','=','opportunity')] { 'search_default_team_id': [active_id], diff --git a/addons/hr_expense/models/hr_expense.py b/addons/hr_expense/models/hr_expense.py index eb56429708a..085ff53bda3 100644 --- a/addons/hr_expense/models/hr_expense.py +++ b/addons/hr_expense/models/hr_expense.py @@ -5,7 +5,7 @@ import re from odoo import api, fields, models, _ from odoo.exceptions import UserError -from odoo.tools import email_split +from odoo.tools import email_split, float_is_zero import odoo.addons.decimal_precision as dp @@ -511,7 +511,9 @@ class HrExpenseSheet(models.Model): if any(not sheet.journal_id for sheet in self): raise UserError(_("Expenses must have an expense journal specified to generate accounting entries.")) - res = self.mapped('expense_line_ids').action_move_create() + res = self.mapped('expense_line_ids')\ + .filtered(lambda r: not float_is_zero(r.total_amount, precision_rounding=(r.currency_id or self.env.user.company_id.currency_id).rounding))\ + .action_move_create() if not self.accounting_date: self.accounting_date = self.account_move_id.date diff --git a/addons/hr_expense/security/ir_rule.xml b/addons/hr_expense/security/ir_rule.xml index e084a2b9283..61aba78d7ed 100644 --- a/addons/hr_expense/security/ir_rule.xml +++ b/addons/hr_expense/security/ir_rule.xml @@ -20,6 +20,12 @@ ['|',('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id])] + + Expense Report multi company rule + + + ['|',('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id])] + diff --git a/addons/hr_timesheet_sheet/models/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/models/hr_timesheet_sheet.py index e4c05fbd2b1..cc94bd6aec5 100644 --- a/addons/hr_timesheet_sheet/models/hr_timesheet_sheet.py +++ b/addons/hr_timesheet_sheet/models/hr_timesheet_sheet.py @@ -152,7 +152,7 @@ class HrTimesheetSheet(models.Model): analytic_timesheet_toremove = self.env['account.analytic.line'] for sheet in self: - analytic_timesheet_toremove += sheet.timesheet_ids + analytic_timesheet_toremove += sheet.timesheet_ids.filtered(lambda t: not t.task_id) analytic_timesheet_toremove.unlink() return super(HrTimesheetSheet, self).unlink() diff --git a/addons/im_livechat/views/im_livechat_channel_templates.xml b/addons/im_livechat/views/im_livechat_channel_templates.xml index 0e3a4b911c8..0e5b476942a 100644 --- a/addons/im_livechat/views/im_livechat_channel_templates.xml +++ b/addons/im_livechat/views/im_livechat_channel_templates.xml @@ -126,7 +126,6 @@ - diff --git a/addons/l10n_cn_standard/__init__.py b/addons/l10n_cn_standard/__init__.py index 7e7e19a411a..8e0bd7042c7 100644 --- a/addons/l10n_cn_standard/__init__.py +++ b/addons/l10n_cn_standard/__init__.py @@ -1,4 +1,8 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. -# Copyright (C) 2007-2014 Jeff Wang(). +# Copyright (C) 2008-2008 凯源吕鑫 lvxin@gmail.com +# 维智众源 oldrev@gmail.com +# Copyright (C) 2012-2012 南京盈通 ccdos@intoerp.com +# Copyright (C) 2008-now 开阖软件 jeff@osbzr.com < PM and LTS > +# Copyright (C) 2017-now jeffery9@gmail.com diff --git a/addons/l10n_cn_standard/__manifest__.py b/addons/l10n_cn_standard/__manifest__.py index 465dbaa8da7..e29a1a4ecc1 100644 --- a/addons/l10n_cn_standard/__manifest__.py +++ b/addons/l10n_cn_standard/__manifest__.py @@ -5,26 +5,35 @@ # 维智众源 oldrev@gmail.com # Copyright (C) 2012-2012 南京盈通 ccdos@intoerp.com # Copyright (C) 2008-now 开阖软件 jeff@osbzr.com < PM and LTS > +# Copyright (C) 2017-now jeffery9@gmail.com { - 'name': '中国会计科目表-企业会计准则', - 'version': '1.8', + 'name': '会计科目表 - 中国企业会计准则', + 'version': '2.0', 'category': 'Localization', - 'author': 'www.openerp-china.org', - 'maintainer': 'jeff@osbzr.com', - 'website': 'http://openerp-china.org', + 'author': ['lvxin@gmail.co', 'oldrev@gmail.co', 'ccdos@intoerp.com', 'jeff@osbzr.com', 'jeffery9@gmail.com'], + + 'website': 'http://shine-it.net', 'description': """ +Including the following data in the Accounting Standards for Business Enterprises +包含企业会计准则以下数据 - 科目类型\会计科目表模板\增值税\辅助核算类别\管理会计凭证簿\财务会计凭证簿 +* Chart of Accounts +* 科目表模板 - 添加中文省份数据 +* Account templates +* 科目模板 - 增加小企业会计科目表 +* Tax templates +* 税金模板 """, 'depends': ['l10n_cn'], 'data': [ 'data/l10n_cn_standard_chart_data.xml', + 'data/account.account.template.csv', + 'data/account_tax_templates.xml', + 'data/account_chart_template_data.xml', 'data/account_chart_template_data.yml', ], 'license': 'GPL-3', diff --git a/addons/l10n_cn_standard/data/account.account.template.csv b/addons/l10n_cn_standard/data/account.account.template.csv new file mode 100644 index 00000000000..0cc206754be --- /dev/null +++ b/addons/l10n_cn_standard/data/account.account.template.csv @@ -0,0 +1,174 @@ +id,code,name,reconcile,user_type_id/id,chart_template_id/id +account_1011,1011,存放同业,FALSE,account.data_account_type_current_assets,l10n_chart_china_standard_business +account_1012,1012,其他货币资金,FALSE,account.data_account_type_current_assets,l10n_chart_china_standard_business +account_1021,1021,结算备付金,FALSE,account.data_account_type_current_assets,l10n_chart_china_standard_business +account_1031,1031,存出保证金,FALSE,account.data_account_type_current_assets,l10n_chart_china_standard_business +account_1101,1101,交易性金融资产,FALSE,account.data_account_type_current_assets,l10n_chart_china_standard_business +account_1111,1111,买入返售金融资产,FALSE,account.data_account_type_current_assets,l10n_chart_china_standard_business +account_1121,1121,应收票据,TRUE,account.data_account_type_receivable,l10n_chart_china_standard_business +account_1122,1122,应收账款,TRUE,account.data_account_type_receivable,l10n_chart_china_standard_business +account_1123,1123,预付账款,TRUE,account.data_account_type_receivable,l10n_chart_china_standard_business +account_1131,1131,应收股利,TRUE,account.data_account_type_receivable,l10n_chart_china_standard_business +account_1132,1132,应收利息,TRUE,account.data_account_type_receivable,l10n_chart_china_standard_business +account_1201,1201,应收代位追偿款,FALSE,account.data_account_type_current_assets,l10n_chart_china_standard_business +account_1211,1211,应收分保账款,FALSE,account.data_account_type_current_assets,l10n_chart_china_standard_business +account_1212,1212,应收分保合同准备金,FALSE,account.data_account_type_current_assets,l10n_chart_china_standard_business +account_1221,1221,其他应收款,FALSE,account.data_account_type_current_assets,l10n_chart_china_standard_business +account_1231,1231,坏账准备,FALSE,account.data_account_type_current_assets,l10n_chart_china_standard_business +account_1301,1301,贴现资产,FALSE,account.data_account_type_current_assets,l10n_chart_china_standard_business +account_1302,1302,拆出资金,FALSE,account.data_account_type_current_assets,l10n_chart_china_standard_business +account_1303,1303,贷款,FALSE,account.data_account_type_current_assets,l10n_chart_china_standard_business +account_1304,1304,贷款损失准备,FALSE,account.data_account_type_current_assets,l10n_chart_china_standard_business +account_1311,1311,代理兑付证券,FALSE,account.data_account_type_current_assets,l10n_chart_china_standard_business +account_1321,1321,代理业务资产,FALSE,account.data_account_type_current_assets,l10n_chart_china_standard_business +account_1401,1401,材料采购,FALSE,account.data_account_type_current_assets,l10n_chart_china_standard_business +account_1402,1402,在途物资,FALSE,account.data_account_type_current_assets,l10n_chart_china_standard_business +account_1403,1403,原材料,FALSE,account.data_account_type_current_assets,l10n_chart_china_standard_business +account_1404,1404,材料成本差异,FALSE,account.data_account_type_current_assets,l10n_chart_china_standard_business +account_1405,1405,库存商品,FALSE,account.data_account_type_current_assets,l10n_chart_china_standard_business +account_1406,1406,发出商品,FALSE,account.data_account_type_current_assets,l10n_chart_china_standard_business +account_1407,1407,商品进销差价,FALSE,account.data_account_type_current_assets,l10n_chart_china_standard_business +account_1408,1408,委托加工物资,FALSE,account.data_account_type_current_assets,l10n_chart_china_standard_business +account_1411,1411,周转材料,FALSE,account.data_account_type_non_current_assets,l10n_chart_china_standard_business +account_1421,1421,消耗性生物资产,FALSE,account.data_account_type_non_current_assets,l10n_chart_china_standard_business +account_1431,1431,贵金属,FALSE,account.data_account_type_non_current_assets,l10n_chart_china_standard_business +account_1441,1441,抵债资产,FALSE,account.data_account_type_non_current_assets,l10n_chart_china_standard_business +account_1451,1451,损余物资,FALSE,account.data_account_type_non_current_assets,l10n_chart_china_standard_business +account_1461,1461,融资租赁资产,FALSE,account.data_account_type_non_current_assets,l10n_chart_china_standard_business +account_1471,1471,存货跌价准备,FALSE,account.data_account_type_non_current_assets,l10n_chart_china_standard_business +account_1501,1501,持有至到期投资,FALSE,account.data_account_type_non_current_assets,l10n_chart_china_standard_business +account_1502,1502,持有至到期投资减值准备,FALSE,account.data_account_type_non_current_assets,l10n_chart_china_standard_business +account_1503,1503,可供出售金融资产,FALSE,account.data_account_type_non_current_assets,l10n_chart_china_standard_business +account_1511,1511,长期股权投资,FALSE,account.data_account_type_non_current_assets,l10n_chart_china_standard_business +account_1512,1512,长期股权投资减值准备,FALSE,account.data_account_type_non_current_assets,l10n_chart_china_standard_business +account_1521,1521,投资性房地产,FALSE,account.data_account_type_non_current_assets,l10n_chart_china_standard_business +account_1531,1531,长期应收款,FALSE,account.data_account_type_non_current_assets,l10n_chart_china_standard_business +account_1532,1532,未实现融资收益,FALSE,account.data_account_type_non_current_assets,l10n_chart_china_standard_business +account_1541,1541,存出资本保证金,FALSE,account.data_account_type_non_current_assets,l10n_chart_china_standard_business +account_1601,1601,固定资产,FALSE,account.data_account_type_fixed_assets,l10n_chart_china_standard_business +account_1602,1602,累计折旧,FALSE,account.data_account_type_fixed_assets,l10n_chart_china_standard_business +account_1603,1603,固定资产减值准备,FALSE,account.data_account_type_fixed_assets,l10n_chart_china_standard_business +account_1604,1604,在建工程,FALSE,account.data_account_type_fixed_assets,l10n_chart_china_standard_business +account_1605,1605,工程物资,FALSE,account.data_account_type_fixed_assets,l10n_chart_china_standard_business +account_1606,1606,固定资产清理,FALSE,account.data_account_type_fixed_assets,l10n_chart_china_standard_business +account_1611,1611,未担保余值,FALSE,account.data_account_type_current_assets,l10n_chart_china_standard_business +account_1621,1621,生产性生物资产,FALSE,account.data_account_type_current_assets,l10n_chart_china_standard_business +account_1622,1622,生产性生物资产累计折旧,FALSE,account.data_account_type_current_assets,l10n_chart_china_standard_business +account_1623,1623,公益性生物资产,FALSE,account.data_account_type_current_assets,l10n_chart_china_standard_business +account_1631,1631,油气资产,FALSE,account.data_account_type_current_assets,l10n_chart_china_standard_business +account_1632,1632,累计折耗,FALSE,account.data_account_type_current_assets,l10n_chart_china_standard_business +account_1701,1701,无形资产,FALSE,account.data_account_type_current_assets,l10n_chart_china_standard_business +account_1702,1702,累计摊销,FALSE,account.data_account_type_current_assets,l10n_chart_china_standard_business +account_1703,1703,无形资产减值准备,FALSE,account.data_account_type_current_assets,l10n_chart_china_standard_business +account_1711,1711,商誉,FALSE,account.data_account_type_current_assets,l10n_chart_china_standard_business +account_1801,1801,长期待摊费用,FALSE,account.data_account_type_current_assets,l10n_chart_china_standard_business +account_1811,1811,递延所得税资产,FALSE,account.data_account_type_current_assets,l10n_chart_china_standard_business +account_1821,1821,独立账户资产,FALSE,account.data_account_type_current_assets,l10n_chart_china_standard_business +account_1901,1901,待处理财产损溢,FALSE,account.data_account_type_current_assets,l10n_chart_china_standard_business +account_2001,2001,短期借款,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2002,2002,存入保证金,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2003,2003,拆入资金,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2004,2004,向中央银行借款,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2011,2011,吸收存款,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2012,2012,同业存放,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2021,2021,贴现负债,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2101,2101,交易性金融负债,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2111,2111,卖出回购金融资产款,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2201,2201,应付票据,TRUE,account.data_account_type_payable,l10n_chart_china_standard_business +account_2202,2202,应付账款,TRUE,account.data_account_type_payable,l10n_chart_china_standard_business +account_2203,2203,预收账款,TRUE,account.data_account_type_payable,l10n_chart_china_standard_business +account_2211,2211,应付职工薪酬,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2221,2221,应交税费,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2221_1_1,2221.01.01,进项税额,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2221_1_2,2221.01.02,已交税金,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2221_1_3,2221.01.03,转出未交增值税,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2221_1_4,2221.01.04,减免税款,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2221_1_5,2221.01.05,销项税额,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2221_1_6,2221.01.06,出口退税,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2221_1_7,2221.01.07,进项税额转出,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2221_1_8,2221.01.08,出口抵减内销产品应纳税额,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2221_1_9,2221.01.09,转出多交增值税,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2221_1_10,2221.01.10,未交增值税,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2221_2,2221.02,应交营业税,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2221_3,2221.03,应交消费税,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2221_4,2221.04,应交资源税,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2221_5,2221.05,应交所得税,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2221_6,2221.06,应交土地增值税,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2221_7,2221.07,应交城市维护建设税,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2221_8,2221.08,应交房产税,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2221_9,2221.09,应交土地使用税,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2221_10,2221.10,应交车船使用税,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2221_11,2221.11,应交个人所得税,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2231,2231,应付利息,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2232,2232,应付股利,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2241,2241,其他应付款,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2251,2251,应付保单红利,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2261,2261,应付分保账款,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2311,2311,代理买卖证券款,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2312,2312,代理承销证券款,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2313,2313,代理兑付证券款,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2314,2314,代理业务负债,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2401,2401,递延收益,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2501,2501,长期借款,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2502,2502,应付债券,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2601,2601,未到期责任准备金,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2602,2602,保险责任准备金,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2611,2611,保户储金,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2621,2621,独立账户负债,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2701,2701,长期应付款,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2702,2702,未确认融资费用,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2711,2711,专项应付款,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2801,2801,预计负债,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_2901,2901,递延所得税负债,FALSE,account.data_account_type_current_liabilities,l10n_chart_china_standard_business +account_3001,3001,清算资金往来,FALSE,l10n_cn.user_type_all,l10n_chart_china_standard_business +account_3002,3002,货币兑换,FALSE,l10n_cn.user_type_all,l10n_chart_china_standard_business +account_3101,3101,衍生工具,FALSE,l10n_cn.user_type_all,l10n_chart_china_standard_business +account_3201,3201,套期工具,FALSE,l10n_cn.user_type_all,l10n_chart_china_standard_business +account_3202,3202,被套期项目,FALSE,l10n_cn.user_type_all,l10n_chart_china_standard_business +account_4001,4001,实收资本,FALSE,account.data_account_type_equity,l10n_chart_china_standard_business +account_4002,4002,资本公积,FALSE,account.data_account_type_equity,l10n_chart_china_standard_business +account_4101,4101,盈余公积,FALSE,account.data_account_type_equity,l10n_chart_china_standard_business +account_4102,4102,一般风险准备,FALSE,account.data_account_type_equity,l10n_chart_china_standard_business +account_4103,4103,本年利润,FALSE,account.data_account_type_equity,l10n_chart_china_standard_business +account_4104,4104,利润分配,FALSE,account.data_account_type_equity,l10n_chart_china_standard_business +account_4201,4201,库存股,FALSE,account.data_account_type_equity,l10n_chart_china_standard_business +account_5001,5001,生产成本,FALSE,l10n_cn.user_type_all,l10n_chart_china_standard_business +account_5101,5101,制造费用,FALSE,l10n_cn.user_type_all,l10n_chart_china_standard_business +account_5201,5201,劳务成本,FALSE,l10n_cn.user_type_all,l10n_chart_china_standard_business +account_5301,5301,研发支出,FALSE,l10n_cn.user_type_all,l10n_chart_china_standard_business +account_5401,5401,工程施工,FALSE,l10n_cn.user_type_all,l10n_chart_china_standard_business +account_5402,5402,工程结算,FALSE,l10n_cn.user_type_all,l10n_chart_china_standard_business +account_5403,5403,机械作业,FALSE,l10n_cn.user_type_all,l10n_chart_china_standard_business +account_6001,6001,主营业务收入,FALSE,account.data_account_type_revenue,l10n_chart_china_standard_business +account_6011,6011,利息收入,FALSE,account.data_account_type_revenue,l10n_chart_china_standard_business +account_6021,6021,手续费及佣金收入,FALSE,account.data_account_type_revenue,l10n_chart_china_standard_business +account_6031,6031,保费收入,FALSE,account.data_account_type_revenue,l10n_chart_china_standard_business +account_6041,6041,租赁收入,FALSE,account.data_account_type_revenue,l10n_chart_china_standard_business +account_6051,6051,其他业务收入,FALSE,account.data_account_type_revenue,l10n_chart_china_standard_business +account_6061,6061,汇兑损益,FALSE,account.data_account_type_revenue,l10n_chart_china_standard_business +account_6101,6101,公允价值变动损益,FALSE,account.data_account_type_revenue,l10n_chart_china_standard_business +account_6111,6111,投资收益,FALSE,account.data_account_type_revenue,l10n_chart_china_standard_business +account_6201,6201,摊回保险责任准备金,FALSE,account.data_account_type_expenses,l10n_chart_china_standard_business +account_6202,6202,摊回赔付支出,FALSE,account.data_account_type_expenses,l10n_chart_china_standard_business +account_6203,6203,摊回分保费用,FALSE,account.data_account_type_expenses,l10n_chart_china_standard_business +account_6301,6301,营业外收入,FALSE,account.data_account_type_expenses,l10n_chart_china_standard_business +account_6401,6401,主营业务成本,FALSE,account.data_account_type_expenses,l10n_chart_china_standard_business +account_6402,6402,其他业务成本,FALSE,account.data_account_type_expenses,l10n_chart_china_standard_business +account_6403,6403,营业税金及附加,FALSE,account.data_account_type_expenses,l10n_chart_china_standard_business +account_6411,6411,利息支出,FALSE,account.data_account_type_expenses,l10n_chart_china_standard_business +account_6421,6421,手续费及佣金支出,FALSE,account.data_account_type_expenses,l10n_chart_china_standard_business +account_6501,6501,提取未到期责任准备金,FALSE,account.data_account_type_expenses,l10n_chart_china_standard_business +account_6502,6502,提取保险责任准备金,FALSE,account.data_account_type_expenses,l10n_chart_china_standard_business +account_6511,6511,赔付支出,FALSE,account.data_account_type_expenses,l10n_chart_china_standard_business +account_6521,6521,保单红利支出,FALSE,account.data_account_type_expenses,l10n_chart_china_standard_business +account_6531,6531,退保金,FALSE,account.data_account_type_expenses,l10n_chart_china_standard_business +account_6541,6541,分出保费,FALSE,account.data_account_type_expenses,l10n_chart_china_standard_business +account_6542,6542,分保费用,FALSE,account.data_account_type_expenses,l10n_chart_china_standard_business +account_6601,6601,销售费用,FALSE,account.data_account_type_expenses,l10n_chart_china_standard_business +account_6602,6602,管理费用,FALSE,account.data_account_type_expenses,l10n_chart_china_standard_business +account_6603,6603,财务费用,FALSE,account.data_account_type_expenses,l10n_chart_china_standard_business +account_6604,6604,勘探费用,FALSE,account.data_account_type_expenses,l10n_chart_china_standard_business +account_6701,6701,资产减值损失,FALSE,account.data_account_type_expenses,l10n_chart_china_standard_business +account_6711,6711,营业外支出,FALSE,account.data_account_type_expenses,l10n_chart_china_standard_business +account_6801,6801,所得税费用,FALSE,account.data_account_type_expenses,l10n_chart_china_standard_business +account_6901,6901,以前年度损益调整,FALSE,account.data_account_type_expenses,l10n_chart_china_standard_business \ No newline at end of file diff --git a/addons/l10n_cn_standard/data/account_chart_template_data.xml b/addons/l10n_cn_standard/data/account_chart_template_data.xml new file mode 100644 index 00000000000..4302c9f5c5c --- /dev/null +++ b/addons/l10n_cn_standard/data/account_chart_template_data.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + 中国会计科目表 (财会[2006]3号《企业会计准则》) + account.chart.template + default + + + + + diff --git a/addons/l10n_cn_standard/data/account_tax_templates.xml b/addons/l10n_cn_standard/data/account_tax_templates.xml new file mode 100644 index 00000000000..6dc3deef4cc --- /dev/null +++ b/addons/l10n_cn_standard/data/account_tax_templates.xml @@ -0,0 +1,35 @@ + + + + + + + 增值税17%销项税 + taxes + + + 增值税17%进项税 + taxes + + + 增值税17%销项税 - 中国会计科目表-企业会计准则 + percent + + sale + + + + + + + 增值税17%进项税 - 中国会计科目表-企业会计准则 + + purchase + percent + + + + + + + diff --git a/addons/l10n_cn_standard/data/l10n_cn_standard_chart_data.xml b/addons/l10n_cn_standard/data/l10n_cn_standard_chart_data.xml index 79371410418..8fa9fee4a0e 100644 --- a/addons/l10n_cn_standard/data/l10n_cn_standard_chart_data.xml +++ b/addons/l10n_cn_standard/data/l10n_cn_standard_chart_data.xml @@ -1,794 +1,24 @@ - - - - + 转让帐户 1003 - - + + - - 中国会计科目表 (财会[2006]3号《企业会计准则》 - - + 中国会计科目表 (财会[2006]3号《企业会计准则》 + + 1001 1002 - + - - + + - - - - 1015 - 其他货币资金 - - - - - - 1101 - 交易性金融资产 - - - - - - 1121 - 应收票据 - - - - - - 1122 - 应收账款 - - - - - - 1123 - 预付账款 - - - - - - 1131 - 应收股利 - - - - - - 1132 - 应收利息 - - - - - - 1231 - 其他应收款 - - - - - - 1241 - 坏账准备 - - - - - - 1401 - 材料采购 - - - - - - 1402 - 在途物资 - - - - - - 1403 - 原材料 - - - - - - 1404 - 材料成本差异 - - - - - - 1406 - 库存商品 - - - - - - 1407 - 发出商品 - - - - - - 1410 - 商品进销差价 - - - - - - 1411 - 委托加工物资 - - - - - - 1412 - 包装物及低值易耗品 - - - - - - 1461 - 存货跌价准备 - - - - - - 1501 - 待摊费用 - - - - - - 1521 - 持有至到期投资 - - - - - - 1522 - 持有至到期投资减值准备 - - - - - - 1524 - 长期股权投资 - - - - - - 1525 - 长期投资减值准备 - - - - - - 1531 - 长期应收款 - - - - - - 1601 - 固定资产 - - - - - - 1602 - 累计折旧 - - - - - - 1603 - 固定资产减值准备 - - - - - - 1604 - 在建工程 - - - - - - 1605 - 工程物资 - - - - - - 1606 - 固定资产清理 - - - - - - 1701 - 无形资产 - - - - - - 1703 - 无形资产减值准备 - - - - - - 1711 - 商誉 - - - - - - 1801 - 长期待摊费用 - - - - - - 1811 - 递延所得税资产 - - - - - - 1901 - 待处理财产损溢 - - - - - - 2001 - 短期借款 - - - - - - 2101 - 交易性金融负债 - - - - - - 2201 - 应付票据 - - - - - - 2202 - 应付账款 - - - - - - 2205 - 预收账款 - - - - - - 2211 - 应付职工薪酬 - - - - - - 22210101 - 进项税额 - - - - - - 22210102 - 已交税金 - - - - - - 22210103 - 转出未交增值税 - - - - - - 22210104 - 减免税款 - - - - - - 22210105 - 销项税额 - - - - - - 22210106 - 出口退税 - - - - - - 22210107 - 进项税额转出 - - - - - - 22210108 - 出口抵减内销产品应纳税额 - - - - - - 22210109 - 转出多交增值税 - - - - - - 22210110 - 未交增值税 - - - - - - 222102 - 应交营业税 - - - - - - 222103 - 应交消费税 - - - - - - 222104 - 应交资源税 - - - - - - 222105 - 应交所得税 - - - - - - 222106 - 应交土地增值税 - - - - - - 222107 - 应交城市维护建设税 - - - - - - 222108 - 应交房产税 - - - - - - 222109 - 应交土地使用税 - - - - - - 222110 - 应交车船使用税 - - - - - - 222111 - 应交个人所得税 - - - - - - 2231 - 应付股利 - - - - - - 2232 - 应付利息 - - - - - - 2241 - 其他应付款 - - - - - - 2401 - 预提费用 - - - - - - 2601 - 长期借款 - - - - - - 2602 - 长期债券 - - - - - - 2801 - 长期应付款 - - - - - - 2901 - 递延所得税负债 - - - - - - 3101 - 衍生工具 - - - - - - 3102 - 套期工具 - - - - - - 3202 - 被套期项目 - - - - - - 4001 - 实收资本 - - - - - - 4002 - 资本公积 - - - - - - 4101 - 盈余公积 - - - - - - 4103 - 本年利润 - - - - - - 4104 - 利润分配 - - - - - - 4201 - 库存股 - - - - - - 5001 - 生产成本 - - - - - - 5101 - 制造费用 - - - - - - 5201 - 劳务成本 - - - - - - 5301 - 研发支出 - - - - - - 6001 - 主营业务收入 - - - - - - 6051 - 其他业务收入 - - - - - - 6101 - 公允价值变动损益 - - - - - - 6111 - 投资收益 - - - - - - 6301 - 营业外收入 - - - - - - 6401 - 主营业务成本 - - - - - - 6402 - 其他业务支出 - - - - - - 6405 - 营业税金及附加 - - - - - - 6601 - 销售费用 - - - - - - 6602 - 管理费用 - - - - - - 6603 - 财务费用 - - - - - - 6701 - 资产减值损失 - - - - - - 6711 - 营业外支出 - - - - - - 6801 - 所得税 - - - - - - 6901 - 以前年度损益调整 - - - - - - - 7001 - 增益账户 - - - - - - 7002 - 损益表 - - - - - - - - - - - - - - - - - 中国会计科目表 (财会[2006]3号《企业会计准则》) - account.chart.template - default - - - - - - - - 增值税17%销项税 - taxes - - - 增值税17%进项税 - taxes - - - - 增值税17%销项税 - 中国会计科目表-企业会计准则 - percent - - sale - - - - - - - 增值税17%进项税 - 中国会计科目表-企业会计准则 - - purchase - percent - - - - - - diff --git a/addons/l10n_fr/data/account_chart_template_data.xml b/addons/l10n_fr/data/account_chart_template_data.xml index f797e164605..429e5b3030e 100644 --- a/addons/l10n_fr/data/account_chart_template_data.xml +++ b/addons/l10n_fr/data/account_chart_template_data.xml @@ -239,7 +239,7 @@ Résultat de l'exercice (bénéfice) 120 - + @@ -4032,6 +4032,13 @@ + + Crédit d’Impôt Compétitivité Emploi (CICE) + 649 + + + + Redevances pour concessions brevets, licences, marques, procédés, logiciels 6511 diff --git a/addons/mail/models/mail_template.py b/addons/mail/models/mail_template.py index 0576bd66db7..9a5b6f83c2e 100644 --- a/addons/mail/models/mail_template.py +++ b/addons/mail/models/mail_template.py @@ -20,6 +20,8 @@ _logger = logging.getLogger(__name__) def format_date(env, date, pattern=False): + if not date: + return '' date = datetime.datetime.strptime(date[:10], tools.DEFAULT_SERVER_DATE_FORMAT) lang_code = env.context.get('lang') or 'en_US' if not pattern: diff --git a/addons/mail/models/mail_thread.py b/addons/mail/models/mail_thread.py index 828cdaf865b..216aca10619 100644 --- a/addons/mail/models/mail_thread.py +++ b/addons/mail/models/mail_thread.py @@ -1364,9 +1364,9 @@ class MailThread(models.AbstractModel): to_remove.append(node) if node.tag == 'img' and node.get('src', '').startswith('cid:'): cid = node.get('src').split(':', 1)[1] - related_attachment = [attach for attach in attachments if len(attach) == 2 and attach[2] == cid] + related_attachment = [attach for attach in attachments if attach[2] and attach[2].get('cid') == cid] if related_attachment: - node.set('data-filename', related_attachment[0]) + node.set('data-filename', related_attachment[0][0]) postprocessed = True for node in to_remove: diff --git a/addons/mail/static/src/js/utils.js b/addons/mail/static/src/js/utils.js index 2c30a82701e..3bc730d15e8 100644 --- a/addons/mail/static/src/js/utils.js +++ b/addons/mail/static/src/js/utils.js @@ -59,8 +59,9 @@ function _parse_and_transform(nodes, transform_function) { }).join(""); } -// suggested regexp (gruber url matching regexp, adapted to js, see https://gist.github.com/gruber/8891611) -var url_regexp = /\b((?:https?:\/\/|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi; +// Suggested URL Javascript regex of http://stackoverflow.com/questions/3809401/what-is-a-good-regular-expression-to-match-a-url +// Adapted to make http(s):// not required if (and only if) www. is given. So `should.notmatch` does not match. +var url_regexp = /\b(?:https?:\/\/|(www\.))[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,13}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/gi; function linkify(text, attrs) { attrs = attrs || {}; if (attrs.target === undefined) { diff --git a/addons/mass_mailing/security/ir.model.access.csv b/addons/mass_mailing/security/ir.model.access.csv index b8513df98bc..40a182fe6bd 100644 --- a/addons/mass_mailing/security/ir.model.access.csv +++ b/addons/mass_mailing/security/ir.model.access.csv @@ -10,3 +10,4 @@ access_mass_mailing_system,mail.mass_mailing.system,model_mail_mass_mailing,base access_mail_mail_statistics_user,mail.mail.statistics,model_mail_mail_statistics,base.group_user,1,1,1,1 access_mail_mail_statistics_mass_mailing_user,mail.mail.statistics,model_mail_mail_statistics,mass_mailing.group_mass_mailing_user,1,1,1,1 access_mail_statistics_report,mail.statistics.report,model_mail_statistics_report,mass_mailing.group_mass_mailing_user,1,1,1,1 +access_utm_source,access_utm_source,utm.model_utm_source,mass_mailing.group_mass_mailing_user,1,1,1,0 \ No newline at end of file diff --git a/addons/mrp/wizard/mrp_product_produce.py b/addons/mrp/wizard/mrp_product_produce.py index b636fc15ec7..f6a70c4a1f6 100644 --- a/addons/mrp/wizard/mrp_product_produce.py +++ b/addons/mrp/wizard/mrp_product_produce.py @@ -102,7 +102,7 @@ class MrpProductProduce(models.TransientModel): def check_finished_move_lots(self): lots = self.env['stock.move.lots'] produce_move = self.production_id.move_finished_ids.filtered(lambda x: x.product_id == self.product_id and x.state not in ('done', 'cancel')) - if produce_move.product_id.tracking != 'none': + if produce_move and produce_move.product_id.tracking != 'none': if not self.lot_id: raise UserError(_('You need to provide a lot for the finished product')) existing_move_lot = produce_move.move_lot_ids.filtered(lambda x: x.lot_id == self.lot_id) diff --git a/addons/mrp_repair/models/mrp_repair.py b/addons/mrp_repair/models/mrp_repair.py index 10c88ff7b62..cdbca9811a3 100644 --- a/addons/mrp_repair/models/mrp_repair.py +++ b/addons/mrp_repair/models/mrp_repair.py @@ -521,7 +521,7 @@ class RepairFee(models.Model): index=True, ondelete='cascade', required=True) name = fields.Char('Description', index=True, required=True) product_id = fields.Many2one('product.product', 'Product') - product_uom_qty = fields.Float('Quantity', digits=dp.get_precision('Product Unit of Measure'), required=True) + product_uom_qty = fields.Float('Quantity', digits=dp.get_precision('Product Unit of Measure'), required=True, default=1.0) price_unit = fields.Float('Unit Price', required=True) product_uom = fields.Many2one('product.uom', 'Product Unit of Measure', required=True) price_subtotal = fields.Float('Subtotal', compute='_compute_price_subtotal', digits=0) diff --git a/addons/payment/views/payment_views.xml b/addons/payment/views/payment_views.xml index fc0a5d458c7..ed9ad78f316 100644 --- a/addons/payment/views/payment_views.xml +++ b/addons/payment/views/payment_views.xml @@ -221,22 +221,22 @@