diff --git a/addons/account/__openerp__.py b/addons/account/__openerp__.py index 7229f1d3364..6b145f6e974 100644 --- a/addons/account/__openerp__.py +++ b/addons/account/__openerp__.py @@ -131,6 +131,8 @@ module named account_voucher. 'test/account_use_model.yml', 'test/account_validate_account_move.yml', 'test/account_fiscalyear_close.yml', + 'test/account_bank_statement.yml', + 'test/account_cash_statement.yml', 'test/account_report.yml', ], 'installable': True, diff --git a/addons/account/account.py b/addons/account/account.py index 8ef5004df04..5d48f122a1d 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -1105,7 +1105,7 @@ class account_move(osv.osv): help='All manually created new journal entry are usually in the state \'Unposted\', but you can set the option to skip that state on the related journal. In that case, they will be behave as journal entries automatically created by the system on document validation (invoices, bank statements...) and will be created in \'Posted\' state.'), 'line_id': fields.one2many('account.move.line', 'move_id', 'Entries', states={'posted':[('readonly',True)]}), 'to_check': fields.boolean('To Review', help='Check this box if you are unsure of that journal entry and if you want to note it as \'to be reviewed\' by an accounting expert.'), - 'partner_id': fields.related('line_id', 'partner_id', type="many2one", relation="res.partner", string="Partner"), + 'partner_id': fields.related('line_id', 'partner_id', type="many2one", relation="res.partner", string="Partner", store=True), 'amount': fields.function(_amount_compute, method=True, string='Amount', digits_compute=dp.get_precision('Account'), type='float', fnct_search=_search_amount), 'date': fields.date('Date', required=True, states={'posted':[('readonly',True)]}), 'narration':fields.text('Narration'), diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index cf50a1ab62e..c6548a36872 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -86,7 +86,6 @@ class account_bank_statement(osv.osv): def _end_balance(self, cursor, user, ids, name, attr, context=None): res_currency_obj = self.pool.get('res.currency') res_users_obj = self.pool.get('res.users') - res = {} company_currency_id = res_users_obj.browse(cursor, user, user, @@ -216,10 +215,8 @@ class account_bank_statement(osv.osv): def create_move_from_st_line(self, cr, uid, st_line_id, company_currency_id, st_line_number, context=None): res_currency_obj = self.pool.get('res.currency') - res_users_obj = self.pool.get('res.users') account_move_obj = self.pool.get('account.move') account_move_line_obj = self.pool.get('account.move.line') - account_analytic_line_obj = self.pool.get('account.analytic.line') account_bank_statement_line_obj = self.pool.get('account.bank.statement.line') st_line = account_bank_statement_line_obj.browse(cr, uid, st_line_id, context) st = st_line.statement_id @@ -395,8 +392,6 @@ class account_bank_statement(osv.osv): return self.write(cr, uid, done, {'state':'draft'}, context=context) def onchange_journal_id(self, cursor, user, statement_id, journal_id, context=None): - account_journal_obj = self.pool.get('account.journal') - res_users_obj = self.pool.get('res.users') cursor.execute('SELECT balance_end_real \ FROM account_bank_statement \ WHERE journal_id = %s AND NOT state = %s \ diff --git a/addons/account/account_cash_statement.py b/addons/account/account_cash_statement.py index 6431454b715..f88d38734f2 100644 --- a/addons/account/account_cash_statement.py +++ b/addons/account/account_cash_statement.py @@ -19,6 +19,7 @@ # along with this program. If not, see . # ############################################################################## + import time from osv import osv, fields @@ -45,13 +46,13 @@ class account_cashbox_line(osv.osv): res[obj.id] = obj.pieces * obj.number return res - def on_change_sub(self, cr, uid, ids, pieces, number,*a): + def on_change_sub(self, cr, uid, ids, pieces, number, *a): """ Calculates Sub total on change of number @param pieces: Names of fields. @param number: """ - sub=pieces*number + sub = pieces * number return {'value':{'subtotal': sub or 0.0}} _columns = { @@ -61,6 +62,7 @@ class account_cashbox_line(osv.osv): 'starting_id': fields.many2one('account.bank.statement',ondelete='cascade'), 'ending_id': fields.many2one('account.bank.statement',ondelete='cascade'), } + account_cashbox_line() class account_cash_statement(osv.osv): @@ -74,7 +76,7 @@ class account_cash_statement(osv.osv): @param arg: User defined arguments @return: Dictionary of values. """ - res ={} + res = {} for statement in self.browse(cr, uid, ids): amount_total = 0.0 @@ -96,10 +98,10 @@ class account_cash_statement(osv.osv): """ res ={} for statement in self.browse(cr, uid, ids): - amount_total=0.0 + amount_total = 0.0 for line in statement.ending_details_ids: - amount_total+= line.pieces * line.number - res[statement.id]=amount_total + amount_total += line.pieces * line.number + res[statement.id] = amount_total return res def _get_sum_entry_encoding(self, cr, uid, ids, name, arg, context=None): @@ -113,14 +115,13 @@ class account_cash_statement(osv.osv): for statement in self.browse(cr, uid, ids): encoding_total=0.0 for line in statement.line_ids: - encoding_total+= line.amount - res2[statement.id]=encoding_total + encoding_total += line.amount + res2[statement.id] = encoding_total return res2 def _end_balance(self, cursor, user, ids, name, attr, context=None): res_currency_obj = self.pool.get('res.currency') res_users_obj = self.pool.get('res.users') - res = {} company_currency_id = res_users_obj.browse(cursor, user, user, @@ -232,8 +233,8 @@ class account_cash_statement(osv.osv): 'user_id':fields.many2one('res.users', 'Responsible', required=False), } _defaults = { - 'state': lambda *a: 'draft', - 'date': lambda *a:time.strftime("%Y-%m-%d %H:%M:%S"), + 'state': 'draft', + 'date': time.strftime("%Y-%m-%d %H:%M:%S"), 'user_id': lambda self, cr, uid, context=None: uid, 'starting_details_ids':_get_cash_open_box_lines, 'ending_details_ids':_get_default_cash_close_box_lines @@ -295,10 +296,8 @@ class account_cash_statement(osv.osv): @param journal_id: Changed journal_id @return: Dictionary of changed values """ - cash_pool = self.pool.get('account.cashbox.line') statement_pool = self.pool.get('account.bank.statement') - res = {} balance_start = 0.0 @@ -307,8 +306,7 @@ class account_cash_statement(osv.osv): 'balance_start': balance_start }) return res - res = super(account_cash_statement, self).onchange_journal_id(cr, uid, statement_id, journal_id, context=context) - return res + return super(account_cash_statement, self).onchange_journal_id(cr, uid, statement_id, journal_id, context=context) def _equal_balance(self, cr, uid, cash_id, context=None): statement = self.browse(cr, uid, cash_id, context=context) @@ -329,7 +327,6 @@ class account_cash_statement(osv.osv): """ cash_pool = self.pool.get('account.cashbox.line') statement_pool = self.pool.get('account.bank.statement') - statement = statement_pool.browse(cr, uid, ids[0]) vals = {} @@ -347,9 +344,7 @@ class account_cash_statement(osv.osv): 'state':'open', }) - - self.write(cr, uid, ids, vals) - return True + return self.write(cr, uid, ids, vals) def balance_check(self, cr, uid, cash_id, journal_type='bank', context=None): if journal_type == 'bank': @@ -363,7 +358,7 @@ class account_cash_statement(osv.osv): return super(account_cash_statement, self).statement_close(cr, uid, ids, journal_type, context) vals = { 'state':'confirm', - 'closing_date':time.strftime("%Y-%m-%d %H:%M:%S") + 'closing_date': time.strftime("%Y-%m-%d %H:%M:%S") } return self.write(cr, uid, ids, vals, context=context) @@ -386,4 +381,4 @@ class account_cash_statement(osv.osv): account_cash_statement() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account/account_end_fy.xml b/addons/account/account_end_fy.xml index 76d40bc89dc..d0c966898d6 100644 --- a/addons/account/account_end_fy.xml +++ b/addons/account/account_end_fy.xml @@ -14,7 +14,7 @@ action="action_account_period_tree" id="menu_action_account_period_close_tree" parent="account.menu_account_end_year_treatments" - sequence="0" groups="base.group_extended"/> + sequence="0" groups="base.group_extended,group_account_manager,group_account_user"/> diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index 28d2f5a06a6..4d4b0a3022f 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -150,7 +150,7 @@ - + - - - - - account.invoice.supplier.pay - account.invoice - form - - - - - - + + account.invoice.customer.pay + account.invoice + form + + + + + + + + account.invoice.supplier.pay + account.invoice + form + + + + + diff --git a/addons/account_voucher/account_voucher_report.xml b/addons/account_voucher/account_voucher_report.xml index db1b4279620..785fd91df73 100644 --- a/addons/account_voucher/account_voucher_report.xml +++ b/addons/account_voucher/account_voucher_report.xml @@ -19,6 +19,5 @@ auto="False" header = "False" menu="True"/> - diff --git a/addons/account_voucher/invoice.py b/addons/account_voucher/invoice.py index b930db97823..5560f57ce81 100644 --- a/addons/account_voucher/invoice.py +++ b/addons/account_voucher/invoice.py @@ -24,6 +24,7 @@ from tools.translate import _ class invoice(osv.osv): _inherit = 'account.invoice' + def invoice_pay_customer(self, cr, uid, ids, context={}): if not ids: return [] inv = self.browse(cr, uid, ids[0], context=context) @@ -49,3 +50,5 @@ class invoice(osv.osv): } invoice() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account_voucher/report/__init__.py b/addons/account_voucher/report/__init__.py index b451c21b6a0..010f6446338 100644 --- a/addons/account_voucher/report/__init__.py +++ b/addons/account_voucher/report/__init__.py @@ -21,3 +21,5 @@ import account_voucher import account_voucher_print + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account_voucher/report/account_voucher.py b/addons/account_voucher/report/account_voucher.py index c37d921ecbc..7931daffbac 100644 --- a/addons/account_voucher/report/account_voucher.py +++ b/addons/account_voucher/report/account_voucher.py @@ -69,4 +69,6 @@ report_sxw.report_sxw( 'account.voucher', 'addons/account_voucher/report/account_voucher.rml', parser=report_voucher,header="external" -) \ No newline at end of file +) + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account_voucher/report/account_voucher_print.py b/addons/account_voucher/report/account_voucher_print.py index d39b77d8374..8bd8644c03c 100644 --- a/addons/account_voucher/report/account_voucher_print.py +++ b/addons/account_voucher/report/account_voucher_print.py @@ -92,3 +92,5 @@ report_sxw.report_sxw( 'addons/account_voucher/report/account_voucher_print.rml', parser=report_voucher_print,header="external" ) + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account_voucher/report/account_voucher_print.rml b/addons/account_voucher/report/account_voucher_print.rml index 358f28b87d5..18735bd7fc2 100755 --- a/addons/account_voucher/report/account_voucher_print.rml +++ b/addons/account_voucher/report/account_voucher_print.rml @@ -181,7 +181,7 @@ Currency: - [[ voucher.currency_id.code ]] + [[ voucher.currency_id.symbol ]] diff --git a/addons/analytic/analytic.py b/addons/analytic/analytic.py index dd727e993b6..f6263bfeb0d 100644 --- a/addons/analytic/analytic.py +++ b/addons/analytic/analytic.py @@ -236,7 +236,6 @@ class account_analytic_account(osv.osv): if not parent_id: return {} parent = self.read(cr, uid, [parent_id], ['partner_id','code'])[0] - childs = self.search(cr, uid, [('parent_id', '=', parent_id)]) if parent['partner_id']: partner = parent['partner_id'][0] else: diff --git a/addons/auction/report/buyer_list.rml b/addons/auction/report/buyer_list.rml index 4ac6e6694e1..c5e9ef9ca7b 100644 --- a/addons/auction/report/buyer_list.rml +++ b/addons/auction/report/buyer_list.rml @@ -75,13 +75,13 @@ Lot - Adj.([[ company.currency_id.code ]]) + Adj.([[ company.currency_id.symbol ]]) Buyer costs([[ o['amount' ]*100 ]]%) - To pay ([[ company.currency_id.code ]]) + To pay ([[ company.currency_id.symbol ]]) diff --git a/addons/auction/report/report_auction.py b/addons/auction/report/report_auction.py index cf1c680c63b..25cdab88e89 100644 --- a/addons/auction/report/report_auction.py +++ b/addons/auction/report/report_auction.py @@ -18,7 +18,6 @@ # along with this program. If not, see . # ############################################################################## -from mx import DateTime from osv import fields, osv, orm from tools import config from tools.translate import _ diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py index d602fce3a0f..df5aaa4287d 100644 --- a/addons/base_calendar/base_calendar.py +++ b/addons/base_calendar/base_calendar.py @@ -1531,6 +1531,9 @@ true, it will allow you to hide the event alarm information without removing it. result = [] if fields and 'date' not in fields: fields.append('date') + if fields and 'duration' not in fields: + fields.append('duration') + for base_calendar_id, real_id in select: #REVET: Revision ID: olt@tinyerp.com-20100924131709-cqsd1ut234ni6txn diff --git a/addons/base_setup/todo.py b/addons/base_setup/todo.py index ae16f260876..8f16a491bc7 100644 --- a/addons/base_setup/todo.py +++ b/addons/base_setup/todo.py @@ -164,8 +164,8 @@ class res_currency(osv.osv): return [] if isinstance(ids, (int, long)): ids = [ids] - reads = self.read(cr, uid, ids, ['name','code'], context, load='_classic_write') - return [(x['id'], tools.ustr(x['name']) + ' (' + tools.ustr(x['code']) + ')') for x in reads] + reads = self.read(cr, uid, ids, ['name','symbol'], context, load='_classic_write') + return [(x['id'], tools.ustr(x['name']) + ' (' + tools.ustr(x['symbol']) + ')') for x in reads] res_currency() diff --git a/addons/crm/crm_meeting.py b/addons/crm/crm_meeting.py index b81819e1171..4327052c36b 100644 --- a/addons/crm/crm_meeting.py +++ b/addons/crm/crm_meeting.py @@ -21,10 +21,8 @@ from base_calendar import base_calendar from crm import crm_case -from datetime import datetime, timedelta from osv import fields, osv from tools.translate import _ -import time import logging class crm_lead(crm_case, osv.osv): @@ -187,7 +185,7 @@ class res_users(osv.osv): try: data_id = data_obj._get_id(cr, uid, 'crm', 'ir_ui_view_sc_calendar0') view_id = data_obj.browse(cr, uid, data_id, context=context).res_id - copy_id = self.pool.get('ir.ui.view_sc').copy(cr, uid, view_id, default = { + self.pool.get('ir.ui.view_sc').copy(cr, uid, view_id, default = { 'user_id': user_id}, context=context) except ValueError: # Tolerate a missing shortcut. See product/product.py for similar code. diff --git a/addons/crm_caldav/crm_caldav.py b/addons/crm_caldav/crm_caldav.py index 1a2deae90be..c2ed193dc23 100644 --- a/addons/crm_caldav/crm_caldav.py +++ b/addons/crm_caldav/crm_caldav.py @@ -19,9 +19,8 @@ # ############################################################################## -from osv import fields, osv +from osv import osv from base_calendar import base_calendar -from crm import crm from caldav import calendar from datetime import datetime import re diff --git a/addons/document_email/__init__.py b/addons/document_email/__init__.py deleted file mode 100644 index 40d4f14c4d1..00000000000 --- a/addons/document_email/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env python -#-*- coding:utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved -# fp@tinyerp.com -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -############################################################################## - -import document_email diff --git a/addons/document_email/__openerp__.py b/addons/document_email/__openerp__.py deleted file mode 100644 index 6f61ba62858..00000000000 --- a/addons/document_email/__openerp__.py +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env python -#-*- coding:utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved -# fp@tinyerp.com -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -############################################################################## - -{ - "name" : "Email Integrated Document", - "version" : "1.1", - "depends" : ["base", "document", "fetchmail","mail_gateway"], - "description": """Email Integrated Document - * Email based Document submission - * user based document submission - """, - 'author': 'OpenERP SA', - 'website': 'http://www.openerp.com', - 'init_xml': [], - 'update_xml': [ - "document_email.xml" - ], - 'demo_xml': [ - - ], - 'installable': True, - 'active': False -} diff --git a/addons/document_email/document_email.py b/addons/document_email/document_email.py deleted file mode 100644 index e4e94fa6c1f..00000000000 --- a/addons/document_email/document_email.py +++ /dev/null @@ -1,115 +0,0 @@ -#!/usr/bin/env python -#-*- coding:utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved -# fp@tinyerp.com -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU 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 General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -# -############################################################################## - -import os -import binascii - -import netsvc - -from osv import osv -from osv import fields -from tools.translate import _ - -logger = netsvc.Logger() - -class email_to_document(osv.osv): - - _name = 'document.email' - _description = "Emails to Documents Gateway" - - _columns = { - 'name':fields.char('Name', size=64, required=True, readonly=False), - 'user_id':fields.many2one('res.users', 'User', required=True), - 'directory_id':fields.many2one('document.directory', 'Directory', required=True), - 'accept_files':fields.char('File Extension', size=1024, required=True), - 'note': fields.text('Description'), - 'server_id': fields.many2one('email.server',"Mail Server", select=True), - } - - _defaults = { - 'accept_files': lambda *a: "['.txt', '.ppt', '.doc', '.xls', '.pdf', '.jpg', '.png']", - 'user_id': lambda self, cr, uid, ctx: uid, - } - - _sql_constraints = [ - ('name_uniq', 'unique (user_id, server_id)', 'You can not configure one serve for multiple directory !'), - ] - - def message_new(self, cr, uid, msg, context): - """ - Automatically calls when new email message arrives - - @param self: The object pointer - @param cr: the current row, from the database cursor, - @param uid: the current user’s ID for security checks - """ - server_id = context.get('server_id', False) - file_pool = self.pool.get('ir.attachment') - if server_id: - ids = self.search(cr, uid, [('server_id', '=', server_id)]) - dr = self.browse(cr, uid, ids[0]) - id = dr.directory_id.id - - partner = self.pool.get('email.server.tools').get_partner(cr, uid, msg.get('from'), context) - ext = eval(dr.accept_files, {}) - attachents = msg.get('attachments', []) - - for attactment in attachents: - file_ext = os.path.splitext(attactment) - if file_ext[1] not in ext: - logger.notifyChannel('document', netsvc.LOG_WARNING, 'file type %s is not allows to process for directory %s' % (file_ext[1], dr.directory_id.name)) - continue - - data_attach = { - 'name': attactment, - 'datas':binascii.b2a_base64(str(attachents.get(attactment))), - 'datas_fname': attactment, - 'description': msg.get('body', 'Mail attachment'), - 'parent_id': id, - 'partner_id':partner.get('partner_id', False), - 'res_model': 'document.directory', - 'res_id': id, - } - file_pool.create(cr, uid, data_attach) - - return id - return 0 - - def message_update(self, cr, uid, ids, vals={}, msg="", default_act=None, context={}): - """ - @param self: The object pointer - @param cr: the current row, from the database cursor, - @param uid: the current user’s ID for security checks, - @param ids: List of update mail’s IDs - """ - logger.notifyChannel('document', netsvc.LOG_WARNING, 'method not implement to keep multipe version of file') - return True -email_to_document() - -class document_directory(osv.osv): - _inherit = 'document.directory' - - _columns = { - 'email_ids':fields.one2many('document.email', 'directory_id', 'Document to Email', required=False), - } -document_directory() diff --git a/addons/document_email/document_email.xml b/addons/document_email/document_email.xml deleted file mode 100644 index 5509d6e8cfb..00000000000 --- a/addons/document_email/document_email.xml +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - document.directory - document.directory - form - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
-
-
-
-
-
- - - document.email.tree - document.email - tree - - - - - - - - - - - document.email.form - document.email - form - -
- - - - - - - - - - - - - - - - - - - -
-
-
- - - Email to Document - document.email - form - tree,form - - {} - [] - - -
-
diff --git a/addons/hr_attendance/security/ir_rule.xml b/addons/hr_attendance/security/ir_rule.xml index 914acbb1974..5f93aa2a4fd 100644 --- a/addons/hr_attendance/security/ir_rule.xml +++ b/addons/hr_attendance/security/ir_rule.xml @@ -11,7 +11,7 @@ Manager Attendance - [('1','=',1)] + [(1,'=',1)] diff --git a/addons/hr_evaluation/hr_evaluation.py b/addons/hr_evaluation/hr_evaluation.py index 20bd8a0b327..a8b2a3e2c69 100644 --- a/addons/hr_evaluation/hr_evaluation.py +++ b/addons/hr_evaluation/hr_evaluation.py @@ -20,8 +20,9 @@ ############################################################################## import time -from mx import DateTime as dt - +from datetime import datetime +from dateutil.relativedelta import relativedelta +from dateutil import parser from osv import fields, osv import tools from tools.translate import _ @@ -109,8 +110,8 @@ class hr_employee(osv.osv): context = {} for id in self.browse(cr, uid, self.search(cr, uid, [], context=context), context=context): if id.evaluation_plan_id and id.evaluation_date: - if (dt.ISO.ParseAny(id.evaluation_date) + dt.RelativeDateTime(months = int(id.evaluation_plan_id.month_next))).strftime('%Y-%m-%d') <= time.strftime("%Y-%m-%d"): - self.write(cr, uid, id.id, {'evaluation_date' : (dt.ISO.ParseAny(id.evaluation_date) + dt.RelativeDateTime(months =+ int(id.evaluation_plan_id.month_next))).strftime('%Y-%m-%d')}, context=context) + if (parser.parse(id.evaluation_date) + relativedelta(months = int(id.evaluation_plan_id.month_next))).strftime('%Y-%m-%d') <= time.strftime("%Y-%m-%d"): + self.write(cr, uid, id.id, {'evaluation_date' : (parser.parse(id.evaluation_date) + relativedelta(months =+ int(id.evaluation_plan_id.month_next))).strftime('%Y-%m-%d')}, context=context) obj_evaluation.create(cr, uid, {'employee_id' : id.id, 'plan_id': id.evaluation_plan_id}, context=context) return True @@ -123,11 +124,11 @@ class hr_employee(osv.osv): flag = False evaluation_plan = evaluation_plan_obj.browse(cr, uid, [evaluation_plan_id], context=context)[0] if not evaluation_date: - evaluation_date=(dt.ISO.ParseAny(dt.now().strftime('%Y-%m-%d'))+ dt.RelativeDateTime(months=+evaluation_plan.month_first)).strftime('%Y-%m-%d') + evaluation_date=(parser.parse(datetime.date.today().strftime('%Y-%m-%d'))+ relativedelta(months=+evaluation_plan.month_first)).strftime('%Y-%m-%d') flag = True else: - if (dt.ISO.ParseAny(evaluation_date) + dt.RelativeDateTime(months = int(evaluation_plan.month_next))).strftime('%Y-%m-%d') <= time.strftime("%Y-%m-%d"): - evaluation_date=(dt.ISO.ParseAny(evaluation_date)+ dt.RelativeDateTime(months=+evaluation_plan.month_next)).strftime('%Y-%m-%d') + if (parser.parse(evaluation_date) + relativedelta(months = int(evaluation_plan.month_next))).strftime('%Y-%m-%d') <= time.strftime("%Y-%m-%d"): + evaluation_date=(parser.parse(evaluation_date)+ relativedelta(months=+evaluation_plan.month_next)).strftime('%Y-%m-%d') flag = True if ids and flag: obj_evaluation.create(cr, uid, {'employee_id': ids[0], 'plan_id': evaluation_plan_id}, context=context) @@ -174,7 +175,7 @@ class hr_evaluation(osv.osv): 'progress' : fields.float("Progress"), } _defaults = { - 'date' : lambda *a: (dt.ISO.ParseAny(dt.now().strftime('%Y-%m-%d')) + dt.RelativeDateTime(months =+ 1)).strftime('%Y-%m-%d'), + 'date' : lambda *a: (parser.parse(datetime.date.today().strftime('%Y-%m-%d')) + relativedelta(months =+ 1)).strftime('%Y-%m-%d'), 'state' : lambda *a: 'draft', } @@ -225,7 +226,7 @@ class hr_evaluation(osv.osv): int_id = hr_eval_inter_obj.create(cr, uid, { 'evaluation_id': evaluation.id, 'survey_id': phase.survey_id.id, - 'date_deadline': (dt.ISO.ParseAny(dt.now().strftime('%Y-%m-%d')) + dt.RelativeDateTime(months =+ 1)).strftime('%Y-%m-%d'), + 'date_deadline': (parser.parse(datetime.date.today().strftime('%Y-%m-%d')) + relativedelta(months =+ 1)).strftime('%Y-%m-%d'), 'user_id': child.user_id.id, 'user_to_review_id': evaluation.employee_id.id }, context=context) diff --git a/addons/hr_expense/security/ir_rule.xml b/addons/hr_expense/security/ir_rule.xml index 1a3ee41cdcb..4807cf38465 100644 --- a/addons/hr_expense/security/ir_rule.xml +++ b/addons/hr_expense/security/ir_rule.xml @@ -11,7 +11,7 @@ Manager Expense - [('1','=',1)] + [(1,'=',1)] diff --git a/addons/hr_holidays/security/ir_rule.xml b/addons/hr_holidays/security/ir_rule.xml index 12217aaddf2..cbb425fa103 100644 --- a/addons/hr_holidays/security/ir_rule.xml +++ b/addons/hr_holidays/security/ir_rule.xml @@ -11,7 +11,7 @@ Manager Holidays - [('1','=',1)] + [(1,'=',1)] diff --git a/addons/hr_payroll/hr_payroll.py b/addons/hr_payroll/hr_payroll.py index bb5edbd8d18..2004e78f5a8 100644 --- a/addons/hr_payroll/hr_payroll.py +++ b/addons/hr_payroll/hr_payroll.py @@ -312,7 +312,6 @@ class hr_contract(osv.osv): _inherit = 'hr.contract' _description = 'Employee Contract' - _columns = { 'permit_no':fields.char('Work Permit No', size=256, required=False, readonly=False), 'passport_id':fields.many2one('hr.passport', 'Passport', required=False), @@ -335,6 +334,7 @@ class payroll_register(osv.osv): """ Payroll Register """ + _name = 'hr.payroll.register' _description = 'Payroll Register' @@ -495,9 +495,9 @@ class payroll_advice(osv.osv): ''' Bank Advice Note ''' + _name = 'hr.payroll.advice' _description = 'Bank Advice Note' - _columns = { 'register_id':fields.many2one('hr.payroll.register', 'Payroll Register', required=False), 'name':fields.char('Name', size=2048, required=True, readonly=False), @@ -557,9 +557,9 @@ class payroll_advice_line(osv.osv): ''' Bank Advice Lines ''' + _name = 'hr.payroll.advice.line' _description = 'Bank Advice Lines' - _columns = { 'advice_id':fields.many2one('hr.payroll.advice', 'Bank Advice', required=False), 'name':fields.char('Bank Account A/C', size=64, required=True, readonly=False), @@ -595,6 +595,7 @@ class contrib_register(osv.osv): ''' Contribution Register ''' + _name = 'hr.contibution.register' _description = 'Contribution Register' @@ -634,6 +635,7 @@ class contrib_register_line(osv.osv): ''' Contribution Register Line ''' + _name = 'hr.contibution.register.line' _description = 'Contribution Register Line' @@ -669,7 +671,6 @@ class payment_category(osv.osv): _name = 'hr.allounce.deduction.categoty' _description = 'Allowance Deduction Heads' - _columns = { 'name':fields.char('Categoty Name', size=64, required=True, readonly=False), 'code':fields.char('Categoty Code', size=64, required=True, readonly=False), @@ -710,7 +711,6 @@ class company_contribution(osv.osv): _name = 'company.contribution' _description = "Company Contribution" - _columns = { 'category_id':fields.many2one('hr.allounce.deduction.categoty', 'Heads', required=False), 'name':fields.char('Name', size=256, required=True, readonly=False), @@ -784,7 +784,6 @@ class company_contribution_line(osv.osv): _name = 'company.contribution.line' _description = 'Allowance Deduction Categoty' _order = 'sequence' - _columns = { 'contribution_id':fields.many2one('company.contribution', 'Contribution', required=False), 'name':fields.char('Name', size=64, required=False, readonly=False), @@ -799,8 +798,8 @@ class company_contribution_line(osv.osv): company_contribution_line() class hr_holidays_status(osv.osv): + _inherit = "hr.holidays.status" - _columns = { 'company_id':fields.many2one('res.company', 'Company', required=False), 'type':fields.selection([ @@ -824,6 +823,7 @@ class hr_payslip(osv.osv): ''' Pay Slip ''' + _name = 'hr.payslip' _description = 'Pay Slip' @@ -1315,6 +1315,7 @@ class hr_payslip_line(osv.osv): ''' Payslip Line ''' + _name = 'hr.payslip.line' _description = 'Payslip Line' @@ -1396,10 +1397,10 @@ class hr_payslip_line_line(osv.osv): ''' Function Line ''' + _name = 'hr.payslip.line.line' _description = 'Function Line' _order = 'sequence' - _columns = { 'slipline_id':fields.many2one('hr.payslip.line', 'Slip Line', required=False), 'name':fields.char('Name', size=64, required=False, readonly=False), @@ -1417,6 +1418,7 @@ class hr_employee(osv.osv): ''' Employee ''' + _inherit = 'hr.employee' _description = 'Employee' diff --git a/addons/hr_payroll/report/__init__.py b/addons/hr_payroll/report/__init__.py index c0f35b40bfc..925b5e4c97d 100755 --- a/addons/hr_payroll/report/__init__.py +++ b/addons/hr_payroll/report/__init__.py @@ -27,4 +27,6 @@ import report_payroll_advice import report_year_salary import report_payroll_register import report_employees_detail -import report_emp_salary_structure \ No newline at end of file +import report_emp_salary_structure + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/hr_payroll/report/payslip.rml b/addons/hr_payroll/report/payslip.rml index cdbbe6bd5f4..18a2bc7230c 100755 --- a/addons/hr_payroll/report/payslip.rml +++ b/addons/hr_payroll/report/payslip.rml @@ -505,13 +505,13 @@ - Total Earnings([[ o.company_id and o.company_id.currency_id.code or '' ]]) + Total Earnings([[ o.company_id and o.company_id.currency_id.symbol or '' ]]) [[ formatLang(o.allounce + o.basic) ]] [[ o.company_id and o.company_id.currency_id.symbol ]] - Total Deductions([[ o.company_id and o.company_id.currency_id.code or '' ]]) + Total Deductions([[ o.company_id and o.company_id.currency_id.symbol or '' ]]) [[ formatLang(o.deduction) ]] [[ o.company_id and o.company_id.currency_id.symbol or '' ]] @@ -558,7 +558,7 @@ - Net Amount([[ o.company_id and o.company_id.currency_id.code or '' ]]) + Net Amount([[ o.company_id and o.company_id.currency_id.symbol or '' ]]) [[ formatLang(o.net) ]] [[ o.company_id and o.company_id.currency_id.symbol or '' ]] diff --git a/addons/hr_payroll/report/report_emp_salary_structure.py b/addons/hr_payroll/report/report_emp_salary_structure.py index e875e774b43..6d22ab2a2a2 100644 --- a/addons/hr_payroll/report/report_emp_salary_structure.py +++ b/addons/hr_payroll/report/report_emp_salary_structure.py @@ -24,7 +24,6 @@ import time from report import report_sxw -from tools import amount_to_text_en class salary_structure_report(report_sxw.rml_parse): @@ -89,13 +88,6 @@ class salary_structure_report(report_sxw.rml_parse): report_sxw.report_sxw('report.salary.structure', 'hr.employee', 'hr_payroll/report/report_emp_salary_structure.rml', parser=salary_structure_report) - - - - - - - # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr_payroll/report/report_employees_detail.py b/addons/hr_payroll/report/report_employees_detail.py index 67481dc1a7d..a71fda1492c 100644 --- a/addons/hr_payroll/report/report_employees_detail.py +++ b/addons/hr_payroll/report/report_employees_detail.py @@ -1,3 +1,27 @@ +#!/usr/bin/env python +#-*- coding:utf-8 -*- + +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved +# d$ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +############################################################################## + import time import locale import datetime @@ -48,7 +72,7 @@ class employees_salary_report(rml_parse.rml_parse): m = datetime.date(cy, cm, 1).strftime('%b') mnth_name.append(m) self.mnths.append(str(cm)+'-'+str(cy)) - + if cm == 12: cm = 0 cy = ly diff --git a/addons/hr_payroll/report/report_payroll_advice.py b/addons/hr_payroll/report/report_payroll_advice.py index 1c7fbd91357..ec79d2a85e1 100644 --- a/addons/hr_payroll/report/report_payroll_advice.py +++ b/addons/hr_payroll/report/report_payroll_advice.py @@ -1,5 +1,30 @@ +#!/usr/bin/env python +#-*- coding:utf-8 -*- + +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved +# d$ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +############################################################################## + import time from datetime import datetime + from report import report_sxw from tools import amount_to_text_en diff --git a/addons/hr_payroll/report/report_payroll_register.py b/addons/hr_payroll/report/report_payroll_register.py index e991ede4903..a67fc1e6b70 100644 --- a/addons/hr_payroll/report/report_payroll_register.py +++ b/addons/hr_payroll/report/report_payroll_register.py @@ -1,12 +1,35 @@ +#!/usr/bin/env python +#-*- coding:utf-8 -*- + +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved +# d$ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +############################################################################## + import time from datetime import datetime from report import report_sxw -from tools import amount_to_text_en class report_payroll_register(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): super(report_payroll_register, self).__init__(cr, uid, name, context) - + self.total_amount = 0.00 self.total_bysal = 0.00 self.localcontext.update({ @@ -28,7 +51,7 @@ class report_payroll_register(report_sxw.rml_parse): self.grows = 0.0 self.deduct = 0.0 self.net = 0.0 - + def add_line(self, line): self.basic += line.basic self.other += line.other_pay @@ -36,37 +59,37 @@ class report_payroll_register(report_sxw.rml_parse): self.grows += line.grows self.deduct += line.deduction self.net += line.net - + def get_basic(self,obj): for line in obj.line_ids: self.basic += line.basic return self.basic - + def get_other(self,obj): for line in obj.line_ids: self.other += line.other_pay return self.other - + def get_allow(self,obj): for line in obj.line_ids: self.allow += line.allounce return self.allow - + def get_grows(self,obj): for line in obj.line_ids: self.grows += line.grows return self.grows - + def get_deduct(self,obj): for line in obj.line_ids: self.deduct += line.deduction return self.deduct - + def get_net(self,obj): for line in obj.line_ids: self.net += line.net return self.net - + def get_month(self, indate): new_date = datetime.strptime(indate, '%Y-%m-%d') out_date = new_date.strftime('%B')+'-'+new_date.strftime('%Y') @@ -75,10 +98,12 @@ class report_payroll_register(report_sxw.rml_parse): def get_no(self): self.no += 1 return self.no - + report_sxw.report_sxw( - 'report.hr.payroll.register.sheet', - 'hr.payroll.register', - 'hr_payroll/report/payroll_register.rml', + 'report.hr.payroll.register.sheet', + 'hr.payroll.register', + 'hr_payroll/report/payroll_register.rml', parser=report_payroll_register -) +) + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/hr_payroll/report/report_payslip.py b/addons/hr_payroll/report/report_payslip.py index 7de5dfee0d9..3d6a4fc550a 100755 --- a/addons/hr_payroll/report/report_payslip.py +++ b/addons/hr_payroll/report/report_payslip.py @@ -22,95 +22,80 @@ # ############################################################################## -import time from datetime import datetime + from report import report_sxw from tools import amount_to_text_en class payslip_report(report_sxw.rml_parse): - def __init__(self, cr, uid, name, context): - super(payslip_report, self).__init__(cr, uid, name, context) - self.localcontext.update({ - 'convert' : self.convert, - 'get_month' : self.get_month, - 'get_earnings': self.get_earnings, - 'get_deductions':self.get_deductions, - 'get_leave':self.get_leave, - 'get_others':self.get_others, - }) + def __init__(self, cr, uid, name, context): + super(payslip_report, self).__init__(cr, uid, name, context) + self.localcontext.update({ + 'convert': self.convert, + 'get_month': self.get_month, + 'get_earnings': self.get_earnings, + 'get_deductions':self.get_deductions, + 'get_leave':self.get_leave, + 'get_others':self.get_others, + }) + def convert(self, amount, cur): + amt_en = amount_to_text_en.amount_to_text(amount, 'en', cur) + return amt_en - def convert(self,amount, cur): - amt_en = amount_to_text_en.amount_to_text(amount,'en',cur) - return amt_en + def get_others(self, obj): + payslip_line = self.pool.get('hr.payslip.line') + res = [] + ids = [] + for id in range(len(obj)): + if obj[id].category_id.type in ('advance', 'loan', 'otherpay', 'otherdeduct', 'installment'): + ids.append(obj[id].id) + if len(ids): + res = payslip_line.browse(self.cr, self.uid, ids) + return res - def get_others(self,obj): - res = [] - ids = [] - for id in range(len(obj)): - if obj[id].category_id.type in ('advance','loan','otherpay','otherdeduct','installment'): - ids.append(obj[id].id) - payslip_line = self.pool.get('hr.payslip.line') - if len(ids): - res = payslip_line.browse(self.cr, self.uid, ids) - return res + def get_leave(self, obj): + payslip_line = self.pool.get('hr.payslip.line') + res = [] + ids = [] + for id in range(len(obj)): + if obj[id].type == 'leaves': + ids.append(obj[id].id) + if len(ids): + res = payslip_line.browse(self.cr, self.uid, ids) + return res - def get_leave(self,obj): - res = [] - ids = [] - for id in range(len(obj)): - if obj[id].type == 'leaves': - ids.append(obj[id].id) - payslip_line = self.pool.get('hr.payslip.line') - if len(ids): - res = payslip_line.browse(self.cr, self.uid, ids) - return res + def get_earnings(self, obj): + payslip_line = self.pool.get('hr.payslip.line') + res = [] + ids = [] + for id in range(len(obj)): + if obj[id].category_id.type == 'allowance' and obj[id].type != 'leaves': + ids.append(obj[id].id) + if len(ids): + res = payslip_line.browse(self.cr, self.uid, ids) + return res - def get_earnings(self,obj): - res = [] - ids = [] - for id in range(len(obj)): - if obj[id].category_id.type == 'allowance' and obj[id].type != 'leaves': - ids.append(obj[id].id) - payslip_line = self.pool.get('hr.payslip.line') - if len(ids): - res = payslip_line.browse(self.cr, self.uid, ids) - return res + def get_deductions(self, obj): + payslip_line = self.pool.get('hr.payslip.line') + res = [] + ids = [] + for id in range(len(obj)): + if obj[id].category_id.type == 'deduction' and obj[id].type != 'leaves': + ids.append(obj[id].id) + if len(ids): + res = payslip_line.browse(self.cr, self.uid, ids) + return res - def get_deductions(self,obj): - res = [] - ids = [] - for id in range(len(obj)): - if obj[id].category_id.type == 'deduction' and obj[id].type != 'leaves': - ids.append(obj[id].id) - payslip_line = self.pool.get('hr.payslip.line') - if len(ids): - res = payslip_line.browse(self.cr, self.uid, ids) - return res - - def get_month(self,obj): - res = { - 'mname':'' - } - date = datetime.strptime(obj.date, '%Y-%m-%d') - res['mname']= date.strftime('%B')+"-"+date.strftime('%Y') - return res['mname'] + def get_month(self, obj): + res = { + 'mname':'' + } + date = datetime.strptime(obj.date, '%Y-%m-%d') + res['mname']= date.strftime('%B')+"-"+date.strftime('%Y') + return res['mname'] report_sxw.report_sxw('report.payslip.pdf', 'hr.payslip', 'hr_payroll/report/payslip.rml', parser=payslip_report) - - - - - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - - - - - - - - - +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/hr_payroll/report/report_year_salary.py b/addons/hr_payroll/report/report_year_salary.py index 2db2d7d7e2d..f084eb2d340 100755 --- a/addons/hr_payroll/report/report_year_salary.py +++ b/addons/hr_payroll/report/report_year_salary.py @@ -1,5 +1,27 @@ -import time -import locale +#!/usr/bin/env python +#-*- coding:utf-8 -*- + +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved +# d$ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU 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 General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +############################################################################## + import datetime from report import report_sxw import time @@ -51,7 +73,6 @@ class year_salary_report(rml_parse.rml_parse): def get_employee(self,form): ls1=[] ls = [] - periods = [] tol_mnths=['Total',0,0,0,0,0,0,0,0,0,0,0,0] emp = pooler.get_pool(self.cr.dbname).get('hr.employee') emp_ids = form['employee_ids'] @@ -98,5 +119,5 @@ class year_salary_report(rml_parse.rml_parse): report_sxw.report_sxw('report.year.salary', 'hr.payslip', 'hr_payroll/report/report_year_report.rml', parser=year_salary_report,header='internal landscape') - +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr_payroll/report/rml_parse.py b/addons/hr_payroll/report/rml_parse.py index 0eb783de39f..21fbda2f774 100755 --- a/addons/hr_payroll/report/rml_parse.py +++ b/addons/hr_payroll/report/rml_parse.py @@ -19,15 +19,10 @@ # along with this program. If not, see . # ############################################################################## +from time import strptime + from report import report_sxw -import xml.dom.minidom -import os, time -import osv import re -import tools -import pooler -import re -import sys from lxml import etree @@ -56,12 +51,14 @@ class rml_parse(report_sxw.rml_parse): return new else: return self.comma_me(new) + def _ellipsis(self, string, maxlen=100, ellipsis = '...'): ellipsis = ellipsis or '' try: return string[:maxlen - len(ellipsis) ] + (ellipsis, '')[len(string) < maxlen] - except Exception, e: + except Exception: return False + def _strip_name(self, name, maxlen=50): return self._ellipsis(name, maxlen, '...') @@ -119,7 +116,6 @@ class rml_parse(report_sxw.rml_parse): def repair_string(self,chaine): ast = list(chaine) UnicodeAst = [] - _previouslyfound = False i = 0 while i < len(ast): elem = ast[i] @@ -136,21 +132,6 @@ class rml_parse(report_sxw.rml_parse): i += i + 1 return "".join(UnicodeAst) - def ReencodeAscii(self,str): - print sys.stdin.encoding - try: - Stringer = str.decode("ascii") - except UnicodeEncodeError: - print "REENCODING ERROR" - return str.encode("ascii") - except UnicodeDecodeError: - print "DECODING ERROR" - return str.encode("ascii") - - else: - print Stringer - return Stringer - def _add_header(self, node, header='external'): if header=='internal': rml_head = self.rml_header2 @@ -169,3 +150,5 @@ class rml_parse(report_sxw.rml_parse): else : found.getparent().replace(found,tag) return True + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/hr_payroll/wizard/__init__.py b/addons/hr_payroll/wizard/__init__.py index 93222a2e343..4fb72fb4695 100755 --- a/addons/hr_payroll/wizard/__init__.py +++ b/addons/hr_payroll/wizard/__init__.py @@ -24,3 +24,5 @@ import hr_payroll_employees_detail #import hr_payroll_create_analytic import hr_payroll_year_salary + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/hr_payroll_account/__init__.py b/addons/hr_payroll_account/__init__.py index 81979b0ae58..de1b7b6c0ba 100644 --- a/addons/hr_payroll_account/__init__.py +++ b/addons/hr_payroll_account/__init__.py @@ -21,3 +21,5 @@ ############################################################################## import hr_payroll_account + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/hr_payroll_account/__openerp__.py b/addons/hr_payroll_account/__openerp__.py index d65570a1ad9..9da1394382a 100644 --- a/addons/hr_payroll_account/__openerp__.py +++ b/addons/hr_payroll_account/__openerp__.py @@ -46,3 +46,5 @@ 'installable': True, 'active': False, } + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/hr_payroll_account/hr_payroll_account.py b/addons/hr_payroll_account/hr_payroll_account.py index d9f963ed537..629aecc9255 100644 --- a/addons/hr_payroll_account/hr_payroll_account.py +++ b/addons/hr_payroll_account/hr_payroll_account.py @@ -19,7 +19,6 @@ # along with this program. If not, see . # ############################################################################## - import time import netsvc from datetime import date, datetime, timedelta @@ -668,3 +667,4 @@ class account_move_link_slip(osv.osv): } account_move_link_slip() +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/hr_payroll_account/hr_payroll_account_view.xml b/addons/hr_payroll_account/hr_payroll_account_view.xml index 43734060243..f32141a9741 100644 --- a/addons/hr_payroll_account/hr_payroll_account_view.xml +++ b/addons/hr_payroll_account/hr_payroll_account_view.xml @@ -253,6 +253,5 @@
- diff --git a/addons/hr_payroll_account/hr_payroll_account_workflow.xml b/addons/hr_payroll_account/hr_payroll_account_workflow.xml index f3c0eaccb06..ff627f2619d 100644 --- a/addons/hr_payroll_account/hr_payroll_account_workflow.xml +++ b/addons/hr_payroll_account/hr_payroll_account_workflow.xml @@ -1,7 +1,6 @@ - account_check @@ -28,6 +27,5 @@ cancel_sheet - diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py index 44bda56739f..b152e0112eb 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py @@ -23,7 +23,8 @@ import time import netsvc from osv import fields, osv -from mx import DateTime +from datetime import datetime +from dateutil.relativedelta import relativedelta from tools.translate import _ class one2many_mod2(fields.one2many): @@ -210,9 +211,9 @@ class hr_timesheet_sheet(osv.osv): if context is None: context = {} for sheet in self.browse(cr, uid, ids, context=context): - if DateTime.now() <= DateTime.strptime(sheet.date_from, '%Y-%m-%d'): + if datetime.today() <= datetime.strptime(sheet.date_from, '%Y-%m-%d'): self.write(cr, uid, [sheet.id], {'date_current': sheet.date_from,}, context=context) - elif DateTime.now() >= DateTime.strptime(sheet.date_to, '%Y-%m-%d'): + elif datetime.now() >= datetime.strptime(sheet.date_to, '%Y-%m-%d'): self.write(cr, uid, [sheet.id], {'date_current': sheet.date_to,}, context=context) else: self.write(cr, uid, [sheet.id], {'date_current': time.strftime('%Y-%m-%d')}, context=context) @@ -222,11 +223,11 @@ class hr_timesheet_sheet(osv.osv): if context is None: context = {} for sheet in self.browse(cr, uid, ids, context=context): - if DateTime.strptime(sheet.date_current, '%Y-%m-%d') <= DateTime.strptime(sheet.date_from, '%Y-%m-%d'): + if datetime.strptime(sheet.date_current, '%Y-%m-%d') <= datetime.strptime(sheet.date_from, '%Y-%m-%d'): self.write(cr, uid, [sheet.id], {'date_current': sheet.date_from,}, context=context) else: self.write(cr, uid, [sheet.id], { - 'date_current': (DateTime.strptime(sheet.date_current, '%Y-%m-%d') + DateTime.RelativeDateTime(days=-1)).strftime('%Y-%m-%d'), + 'date_current': (datetime.strptime(sheet.date_current, '%Y-%m-%d') + relativedelta(days=-1)).strftime('%Y-%m-%d'), }, context=context) return True @@ -234,11 +235,11 @@ class hr_timesheet_sheet(osv.osv): if context is None: context = {} for sheet in self.browse(cr, uid, ids, context=context): - if DateTime.strptime(sheet.date_current, '%Y-%m-%d') >= DateTime.strptime(sheet.date_to, '%Y-%m-%d'): + if datetime.strptime(sheet.date_current, '%Y-%m-%d') >= datetime.strptime(sheet.date_to, '%Y-%m-%d'): self.write(cr, uid, [sheet.id], {'date_current': sheet.date_to,}, context=context) else: self.write(cr, uid, [sheet.id], { - 'date_current': (DateTime.strptime(sheet.date_current, '%Y-%m-%d') + DateTime.RelativeDateTime(days=1)).strftime('%Y-%m-%d'), + 'date_current': (datetime.strptime(sheet.date_current, '%Y-%m-%d') + relativedelta(days=1)).strftime('%Y-%m-%d'), }, context=context) return True @@ -246,9 +247,9 @@ class hr_timesheet_sheet(osv.osv): if context is None: context = {} for sheet in self.browse(cr, uid, ids, context=context): - if DateTime.strptime(sheet.date_current, '%Y-%m-%d') <= DateTime.strptime(sheet.date_from, '%Y-%m-%d'): + if datetime.strptime(sheet.date_current, '%Y-%m-%d') <= datetime.strptime(sheet.date_from, '%Y-%m-%d'): self.write(cr, uid, [sheet.id], {'date_current': sheet.date_from,}, context=context) - elif DateTime.strptime(sheet.date_current, '%Y-%m-%d') >= DateTime.strptime(sheet.date_to, '%Y-%m-%d'): + elif datetime.strptime(sheet.date_current, '%Y-%m-%d') >= datetime.strptime(sheet.date_to, '%Y-%m-%d'): self.write(cr, uid, [sheet.id], {'date_current': sheet.date_to,}, context=context) return True @@ -318,7 +319,7 @@ class hr_timesheet_sheet(osv.osv): if r=='month': return time.strftime('%Y-%m-01') elif r=='week': - return (DateTime.now() + DateTime.RelativeDateTime(weekday=(DateTime.Monday,0))).strftime('%Y-%m-%d') + return (datetime.today() + relativedelta(weekday=0)).strftime('%Y-%m-%d') elif r=='year': return time.strftime('%Y-01-01') return time.strftime('%Y-%m-%d') @@ -327,9 +328,9 @@ class hr_timesheet_sheet(osv.osv): user = self.pool.get('res.users').browse(cr, uid, uid, context=context) r = user.company_id and user.company_id.timesheet_range or 'month' if r=='month': - return (DateTime.now() + DateTime.RelativeDateTime(months=+1,day=1,days=-1)).strftime('%Y-%m-%d') + return (datetime.today() + relativedelta(months=+1,day=1,days=-1)).strftime('%Y-%m-%d') elif r=='week': - return (DateTime.now() + DateTime.RelativeDateTime(weekday=(DateTime.Sunday,0))).strftime('%Y-%m-%d') + return (datetime.today() + relativedelta(weekday=6)).strftime('%Y-%m-%d') elif r=='year': return time.strftime('%Y-12-31') return time.strftime('%Y-%m-%d') diff --git a/addons/l10n_be/__openerp__.py b/addons/l10n_be/__openerp__.py index 05de2e74294..bbc56b91ebb 100644 --- a/addons/l10n_be/__openerp__.py +++ b/addons/l10n_be/__openerp__.py @@ -42,7 +42,6 @@ 'author': 'OpenERP SA', 'depends': [ 'account', - 'account_report', 'base_vat', 'base_iban', 'account_chart', @@ -59,7 +58,7 @@ 'fiscal_templates.xml', 'security/ir.model.access.csv' ], - 'demo_xml': ['account.report.report.csv'], + 'demo_xml': [], 'installable': True, 'certificate': '0031977724637', } diff --git a/addons/l10n_be/account.report.report.csv b/addons/l10n_be/account.report.report.csv deleted file mode 100644 index 8bf965c741c..00000000000 --- a/addons/l10n_be/account.report.report.csv +++ /dev/null @@ -1,21 +0,0 @@ -"expression","note","parent_id","sequence","badness_limit","goodness_limit","type","code","name" -0,,,,0,1,"indicator","BILAN","Bilan" -"report('BIMMO','BSTOCK','BREAL','BDISPO')",,"BILAN",,0,1,"fiscal","Actif","Actif" -"balance('2')",,"Actif",,0,1,"indicator","BIMMO","Valeurs immobilisées" -"balance('3')",,"Actif",2,0,1,"indicator","BSTOCK","Stocks" -"balance('4')",,"Actif",3,0,1,"indicator","BREAL","Réalisable" -"balance('5')",,"Actif",4,0,1,"fiscal","BDISPO","Disponible" -"report('BCAP') + report('BRESNET')",,"BILAN",1,0,1,"fiscal","PASSIF","Passif" -"balance('1')",,"PASSIF",1,0,1,"indicator","BCAP","Capitaux propores" -"-balance('7')+balance('6')",,"PASSIF",,0,1,"fiscal","BRESNET","Résultat net" -0,,,,0,1,"fiscal","CRES","Compte des résultats" -"report('CCHAR','CBENEF')",,"CRES",,0,1,"fiscal","CRESACTIF","Résultat Actif" -"balance('6')",,"CRESACTIF",,0,1,"fiscal","CCHAR","Total des charges" -"report('CRESPROD')",,"CRES",,0,1,"fiscal","CRESPASSIF","Résultat Passif" -"-balance('7')",,"CRESPASSIF",,0,1,"fiscal","CRESPROD","Total des produits" -"-balance('7')+balance('6')",,"CRESACTIF",,0,1,"fiscal","CBENEF","Résultat (Bénéfice)" -0,,,,0,1,"indicator","IIMMO","Immobilisations" -"balance('1')/balance(map(str(range(21,29))))","Dans une entreprise normalement équilibrée, les valeurs immobilisées sont couvertes en premier lieu par les capitaux propres et, en second lieu, par tout ou partie du passif à long terme. Idéalement, ce ratio (rapport entre capitaux permanents et les valeurs immobilisées) doit être suppérieur à l'unité.","IIMMO",,0,1,"indicator","CIMMO","Couverture des immobilisations" -0,,,,0,1,"indicator","ITRE","Trésorerie" -"balance('3','4','5') / balance('101','13','15','16','17','18')","Détermine si l'entreprise a la possibilité de s'acquitter de ses dettes à court terme dans des conditions normales. Calculé comme suit: (Stocks + Réalisable + Disponible ) / Passif exigible à court terme","ITRE",,0,1,"indicator","IFR","Indice du fond de roulement" -"balance('4','5') / balance('101','13','15','16','17','18')",,"ITRE",,0,1,"indicator","RTRE","Ratio de trésorerie" diff --git a/addons/l10n_ch/invoice.py b/addons/l10n_ch/invoice.py index 1057fc379fd..1f836c4466a 100644 --- a/addons/l10n_ch/invoice.py +++ b/addons/l10n_ch/invoice.py @@ -30,7 +30,7 @@ # ############################################################################## -from mx import DateTime +from datetime import datetime from osv import fields, osv from tools import mod10r @@ -71,8 +71,8 @@ class account_invoice(osv.osv): if invoice.move_id: for line in invoice.move_id.line_id: if not line.date_maturity or \ - DateTime.strptime(line.date_maturity, '%Y-%m-%d') \ - < DateTime.now(): + datetime.strptime(line.date_maturity, '%Y-%m-%d') \ + < datetime.today(): res[invoice.id] += line.amount_to_pay return res @@ -209,4 +209,4 @@ class account_tax_code(osv.osv): account_tax_code() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_ch/report/bvr_invoice_report.rml b/addons/l10n_ch/report/bvr_invoice_report.rml index 46798ae7da4..ee69eedee2e 100755 --- a/addons/l10n_ch/report/bvr_invoice_report.rml +++ b/addons/l10n_ch/report/bvr_invoice_report.rml @@ -241,7 +241,7 @@ [[ round(l.discount) ]] - [[ comma_me(l.price_subtotal) ]] [[o.currency_id.code ]] + [[ comma_me(l.price_subtotal) ]] [[o.currency_id.symbol ]] @@ -293,7 +293,7 @@ Total (excl. taxes): - [[ comma_me(o.amount_untaxed) ]] [[o.currency_id.code ]] + [[ comma_me(o.amount_untaxed) ]] [[o.currency_id.symbol ]] @@ -301,7 +301,7 @@ Taxes: - [[ comma_me(o.amount_tax) ]] [[o.currency_id.code ]] + [[ comma_me(o.amount_tax) ]] [[o.currency_id.symbol ]] @@ -309,7 +309,7 @@ Total (incl. taxes): - [[ comma_me(o.amount_total) ]] [[o.currency_id.code ]] + [[ comma_me(o.amount_total) ]] [[o.currency_id.symbol ]] diff --git a/addons/l10n_ch/wizard/create_dta.py b/addons/l10n_ch/wizard/create_dta.py index d3e2856387d..5de49008ae2 100644 --- a/addons/l10n_ch/wizard/create_dta.py +++ b/addons/l10n_ch/wizard/create_dta.py @@ -405,7 +405,7 @@ def _create_dta(obj, cr, uid, data, context=None): v['sequence'] = str(seq).rjust(5).replace(' ', '0') v['amount_to_pay']= str(pline.amount_currency).replace('.', ',') v['number'] = pline.name - v['currency'] = pline.currency.code + v['currency'] = pline.currency.symbol v['partner_bank_name'] = pline.bank_id.bank.name or False v['partner_bank_clearing'] = pline.bank_id.bank.clearing or False diff --git a/addons/l10n_fr/__openerp__.py b/addons/l10n_fr/__openerp__.py index 0de26734781..287cdf47227 100644 --- a/addons/l10n_fr/__openerp__.py +++ b/addons/l10n_fr/__openerp__.py @@ -35,7 +35,7 @@ Credits: Sistheo Zeekom CrysaLEAD """, - "depends" : ['base', 'account', 'account_chart', 'account_report', 'base_vat'], + "depends" : ['base', 'account', 'account_chart', 'base_vat'], "init_xml" : [], "update_xml" : [ "fr_report_demo.xml", @@ -44,7 +44,6 @@ Credits: Sistheo Zeekom CrysaLEAD "fr_pcg_taxes_demo.xml", "fr_tax_demo.xml", "fr_fiscal_templates_demo.xml", - "fr_pcg_account_report_demo.xml", "security/ir.model.access.csv", "wizard/fr_report_bilan_view.xml", "wizard/fr_report_compute_resultant_view.xml", diff --git a/addons/l10n_fr/fr_pcg_account_report_demo.xml b/addons/l10n_fr/fr_pcg_account_report_demo.xml deleted file mode 100644 index 3e195d4f8f4..00000000000 --- a/addons/l10n_fr/fr_pcg_account_report_demo.xml +++ /dev/null @@ -1,824 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/addons/l10n_lu/__openerp__.py b/addons/l10n_lu/__openerp__.py index d1f6ba49905..c7fd50ad037 100644 --- a/addons/l10n_lu/__openerp__.py +++ b/addons/l10n_lu/__openerp__.py @@ -32,7 +32,7 @@ This module installs: *the main taxes used in Luxembourg""", 'author': 'OpenERP SA', 'website': 'http://openerp.com', - 'depends': ['account', 'account_report', 'base_vat', 'base_iban'], + 'depends': ['account', 'base_vat', 'base_iban'], 'init_xml': [], 'update_xml': [ 'account.tax.code.template.csv', @@ -42,7 +42,7 @@ This module installs: 'wizard/print_vat_view.xml' ], 'test': ['test/l10n_lu_report.yml'], - 'demo_xml': ['account.report.report.csv'], + 'demo_xml': [], 'installable': True, 'active': False, 'certificate': '0078164766621', diff --git a/addons/l10n_lu/account.report.report.csv b/addons/l10n_lu/account.report.report.csv deleted file mode 100644 index 89e497ce8c6..00000000000 --- a/addons/l10n_lu/account.report.report.csv +++ /dev/null @@ -1,21 +0,0 @@ -"expression","note","parent_id","sequence","badness_limit","goodness_limit","type","code","name" -0,,,,0,1,"indicator","BILAN","Bilan" -"report('BIMMO','BSTOCK','BREAL','BDISPO')",,"BILAN",,0,1,"fiscal","Actif","Actif" -"balance(['2'])",,"Actif",,0,1,"indicator","BIMMO","Valeurs immobilisées" -"balance(['3']",,"Actif",2,0,1,"indicator","BSTOCK","Stocks" -"balance(['4'])",,"Actif",3,0,1,"indicator","BREAL","Réalisable" -"balance(['5'])",,"Actif",4,0,1,"fiscal","BDISPO","Disponible" -"report('BCAP') + report('BRESNET')",,"BILAN",1,0,1,"fiscal","PASSIF","Passif" -"balance(['1'])",,"PASSIF",1,0,1,"indicator","BCAP","Capitaux propores" -"-balance(['7'])+balance(['6'])",,"PASSIF",,0,1,"fiscal","BRESNET","Résultat net" -0,,,,0,1,"fiscal","CRES","Compte des résultats" -"report('CCHAR','CBENEF')",,"CRES",,0,1,"fiscal","CRESACTIF","Résultat Actif" -"balance(['6'])",,"CRESACTIF",,0,1,"fiscal","CCHAR","Total des charges" -"report('CRESPROD')",,"CRES",,0,1,"fiscal","CRESPASSIF","Résultat Passif" -"-balance(['7'])",,"CRESPASSIF",,0,1,"fiscal","CRESPROD","Total des produits" -"-balance(['7'])+balance(['6'])",,"CRESACTIF",,0,1,"fiscal","CBENEF","Résultat (Bénéfice)" -0,,,,0,1,"indicator","IIMMO","Immobilisations" -"balance(['1'])/balance(map(str(range(21,29))))","Dans une entreprise normalement équilibrée, les valeurs immobilisées sont couvertes en premier lieu par les capitaux propres et, en second lieu, par tout ou partie du passif à long terme. Idéalement, ce ratio (rapport entre capitaux permanents et les valeurs immobilisées) doit être suppérieur à l'unité.","IIMMO",,0,1,"indicator","CIMMO","Couverture des immobilisations" -0,,,,0,1,"indicator","ITRE","Trésorerie" -"balance(['3','4','5']) / balance(['101','13','15','16','17','18'])","Détermine si l'entreprise a la possibilité de s'acquitter de ses dettes à court terme dans des conditions normales. Calculé comme suit: (Stocks + Réalisable + Disponible ) / Passif exigible à court terme","ITRE",,0,1,"indicator","IFR","Indice du fond de roulement" -"balance(['4','5']) / balance(['101','13','15','16','17','18'])",,"ITRE",,0,1,"indicator","RTRE","Ratio de trésorerie" diff --git a/addons/mrp/i18n/de.po b/addons/mrp/i18n/de.po index 2e84ba9f1e2..094b42b8735 100644 --- a/addons/mrp/i18n/de.po +++ b/addons/mrp/i18n/de.po @@ -396,8 +396,8 @@ msgid "" "partner location if you subcontract the manufacturing operations." msgstr "" "Leer lassen, wenn die Produktion an jenen Orten erfolgt, an denen die " -"Fertigprodukte gebraucht werden.\r\n" -"Setze einen Ort, wenn an fixen Orten produziert wird.\r\n" +"Fertigprodukte gebraucht werden.\n" +"Setze einen Ort, wenn an fixen Orten produziert wird.\n" "Das kann auch ein Partner-Ort sein, wenn Sie Subkontrakte haben." #. module: mrp diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index 50ed21eb298..d0402708f5f 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -81,9 +81,11 @@ class mrp_routing(osv.osv): "Set a location if you produce at a fixed location. This can be a partner location " \ "if you subcontract the manufacturing operations." ), + 'company_id': fields.many2one('res.company', 'Company'), } _defaults = { 'active': lambda *a: 1, + 'company_id': lambda self, cr, uid, context: self.pool.get('res.company')._company_default_get(cr, uid, 'mrp.routing', context=context) } mrp_routing() @@ -103,7 +105,8 @@ class mrp_routing_workcenter(osv.osv): 'routing_id': fields.many2one('mrp.routing', 'Parent Routing', select=True, ondelete='cascade', help="Routing indicates all the workcenters used, for how long and/or cycles." \ "If Routing is indicated then,the third tab of a production order (workcenters) will be automatically pre-completed."), - 'note': fields.text('Description') + 'note': fields.text('Description'), + 'company_id': fields.related('routing_id', 'company_id', type='many2one', relation='res.company', string='Company'), } _defaults = { 'cycle_nbr': lambda *a: 1.0, @@ -192,7 +195,7 @@ class mrp_bom(osv.osv): 'product_qty': fields.float('Product Qty', required=True), 'product_uom': fields.many2one('product.uom', 'Product UOM', required=True, help="UoM (Unit of Measure) is the unit of measurement for the inventory control"), 'product_rounding': fields.float('Product Rounding', help="Rounding applied on the product quantity."), - 'product_efficiency': fields.float('Product Efficiency', required=True, help="Material efficiency. A factor of 0.9 means a loss of 10% in the production."), + 'product_efficiency': fields.float('Manufacturing Efficiency', required=True, help="A factor of 0.9 means a loss of 10% within the production process."), 'bom_lines': fields.one2many('mrp.bom', 'bom_id', 'BoM Lines'), 'bom_id': fields.many2one('mrp.bom', 'Parent BoM', ondelete='cascade', select=True), 'routing_id': fields.many2one('mrp.routing', 'Routing', help="The list of operations (list of workcenters) to produce the finished product. The routing is mainly used to compute workcenter costs during operations and to plan future loads on workcenters based on production planning."), @@ -441,7 +444,7 @@ class mrp_production(osv.osv): 'origin': fields.char('Source Document', size=64, help="Reference of the document that generated this production order request."), 'priority': fields.selection([('0','Not urgent'),('1','Normal'),('2','Urgent'),('3','Very Urgent')], 'Priority'), - 'product_id': fields.many2one('product.product', 'Product', required=True, domain=[('type','<>','service')]), + 'product_id': fields.many2one('product.product', 'Product', required=True, ), 'product_qty': fields.float('Product Qty', required=True, states={'draft':[('readonly',False)]}, readonly=True), 'product_uom': fields.many2one('product.uom', 'Product UOM', required=True, states={'draft':[('readonly',False)]}, readonly=True), 'product_uos_qty': fields.float('Product UoS Qty', states={'draft':[('readonly',False)]}, readonly=True), @@ -951,7 +954,7 @@ class mrp_production_workcenter_line(osv.osv): 'cycle': fields.float('Nbr of cycles', digits=(16,2)), 'hour': fields.float('Nbr of hours', digits=(16,2)), 'sequence': fields.integer('Sequence', required=True, help="Gives the sequence order when displaying a list of work orders."), - 'production_id': fields.many2one('mrp.production', 'Production Order', select=True, ondelete='cascade'), + 'production_id': fields.many2one('mrp.production', 'Production Order', select=True, ondelete='cascade', required=True), } _defaults = { 'sequence': lambda *a: 1, diff --git a/addons/mrp/mrp_demo.xml b/addons/mrp/mrp_demo.xml index e9c4f9f37b2..cea5c60ee56 100644 --- a/addons/mrp/mrp_demo.xml +++ b/addons/mrp/mrp_demo.xml @@ -701,6 +701,17 @@ + + + + + + + + + + + diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml index c946777b219..ca488ac0818 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -129,7 +129,6 @@ - @@ -145,31 +144,31 @@ + + - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - @@ -185,14 +184,14 @@ - - - + + + + + - - @@ -222,9 +221,11 @@ + + @@ -238,9 +239,10 @@ - + + @@ -253,10 +255,13 @@ form
- - - - + + + + + + + @@ -277,6 +282,7 @@ + @@ -286,9 +292,16 @@ search + + + + + + + @@ -320,11 +333,11 @@ - - + + - + @@ -410,7 +423,7 @@ - Master Bill of Materials + Bill of Materials ir.actions.act_window mrp.bom form @@ -566,8 +579,9 @@ - +