diff --git a/addons/account/__terp__.py b/addons/account/__terp__.py index eb9786c9d63..2679bc5e515 100644 --- a/addons/account/__terp__.py +++ b/addons/account/__terp__.py @@ -70,6 +70,6 @@ ], 'installable': True, 'active': False, - 'certificate': '80331923549', + 'certificate': '0080331923549', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/account/account.py b/addons/account/account.py index 938ea74d6ae..328cdbe0bb4 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -52,17 +52,17 @@ class account_payment_term(osv.osv): amount = value result = [] for line in pt.line_ids: - if line.value=='fixed': + if line.value == 'fixed': amt = round(line.value_amount, 2) - elif line.value=='procent': + elif line.value == 'procent': amt = round(value * line.value_amount, 2) - elif line.value=='balance': + elif line.value == 'balance': amt = round(amount, 2) if amt: next_date = mx.DateTime.strptime(date_ref, '%Y-%m-%d') + RelativeDateTime(days=line.days) - if line.days2<0: + if line.days2 < 0: next_date += RelativeDateTime(day=line.days2) - if line.days2>0: + if line.days2 > 0: next_date += RelativeDateTime(day=line.days2, months=1) result.append( (next_date.strftime('%Y-%m-%d'), amt) ) amount -= amt @@ -74,14 +74,14 @@ class account_payment_term_line(osv.osv): _name = "account.payment.term.line" _description = "Payment Term Line" _columns = { - 'name': fields.char('Line Name', size=32,required=True), + 'name': fields.char('Line Name', size=32, required=True), 'sequence': fields.integer('Sequence', required=True, help="The sequence field is used to order the payment term lines from the lowest sequences to the higher ones"), - 'value': fields.selection([('procent','Percent'),('balance','Balance'),('fixed','Fixed Amount')], 'Value',required=True), + 'value': fields.selection([('procent', 'Percent'), ('balance', 'Balance'), ('fixed', 'Fixed Amount')], 'Value',required=True), 'value_amount': fields.float('Value Amount'), - 'days': fields.integer('Number of Days',required=True, help="Number of days to add before computation of the day of month." \ + 'days': fields.integer('Number of Days', required=True, help="Number of days to add before computation of the day of month." \ "If Date=15/01, Number of Days=22, Day of Month=-1, then the due date is 28/02."), - 'days2': fields.integer('Day of the Month',required=True, help="Day of the month, set -1 for the last day of the current month. If it's positive, it gives the day of the next month. Set 0 for net days (otherwise it's based on the beginning of the month)."), - 'payment_id': fields.many2one('account.payment.term','Payment Term', required=True, select=True), + 'days2': fields.integer('Day of the Month', required=True, help="Day of the month, set -1 for the last day of the current month. If it's positive, it gives the day of the next month. Set 0 for net days (otherwise it's based on the beginning of the month)."), + 'payment_id': fields.many2one('account.payment.term', 'Payment Term', required=True, select=True), } _defaults = { 'value': lambda *a: 'balance', @@ -100,7 +100,7 @@ class account_account_type(osv.osv): 'code': fields.char('Code', size=32, required=True), 'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of account types."), 'partner_account': fields.boolean('Partner account'), - 'close_method': fields.selection([('none','None'), ('balance','Balance'), ('detail','Detail'),('unreconciled','Unreconciled')], 'Deferral Method', required=True), + 'close_method': fields.selection([('none', 'None'), ('balance', 'Balance'), ('detail', 'Detail'), ('unreconciled', 'Unreconciled')], 'Deferral Method', required=True), 'sign': fields.selection([(-1, 'Negative'), (1, 'Positive')], 'Sign on Reports', required=True, help='Allows you to change the sign of the balance amount displayed in the reports, so that you can see positive figures instead of negative ones in expenses accounts.'), } _defaults = { @@ -131,7 +131,6 @@ class account_account(osv.osv): _name = "account.account" _description = "Account" _parent_store = True - _parent_order = 'length(code),code' def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False): @@ -139,11 +138,11 @@ class account_account(osv.osv): context = {} pos = 0 - while pos','view'), ('code', '<>', 'closed')]), @@ -527,7 +526,6 @@ class account_fiscalyear(osv.osv): def create_period(self,cr, uid, ids, context={}, interval=1): for fy in self.browse(cr, uid, ids, context): - dt = fy.date_start ds = mx.DateTime.strptime(fy.date_start, '%Y-%m-%d') while ds.strftime('%Y-%m-%d') obj_period.date_start or obj_period.fiscalyear_id.date_start > obj_period.date_stop: + + if obj_period.fiscalyear_id.date_stop < obj_period.date_stop or \ + obj_period.fiscalyear_id.date_stop < obj_period.date_start or \ + obj_period.fiscalyear_id.date_start > obj_period.date_start or \ + obj_period.fiscalyear_id.date_start > obj_period.date_stop: return False pids = self.search(cr, uid, [('date_stop','>=',obj_period.date_start),('date_start','<=',obj_period.date_stop),('special','=',False),('id','<>',obj_period.id)]) @@ -862,7 +864,7 @@ class account_move(osv.osv): def unlink(self, cr, uid, ids, context={}, check=True): toremove = [] for move in self.browse(cr, uid, ids, context): - if move['state'] <> 'draft': + if move['state'] != 'draft': raise osv.except_osv(_('UserError'), _('You can not delete posted movement: "%s"!') % \ move['name']) @@ -935,6 +937,8 @@ class account_move(osv.osv): # Validate a balanced move. If it is a centralised journal, create a move. # def validate(self, cr, uid, ids, context={}): + if context and ('__last_update' in context): + del context['__last_update'] ok = True for move in self.browse(cr, uid, ids, context): #unlink analytic lines on move_lines @@ -960,7 +964,7 @@ class account_move(osv.osv): if line.account_id.currency_id: if line.account_id.currency_id.id != line.currency_id.id and (line.account_id.currency_id.id != line.account_id.company_id.currency_id.id or line.currency_id): - raise osv.except_osv(_('Error'), _("""Couldn't create move with currency different from the secondary currency of the account "%s - %s". Clear the secondary currency field of the account definition if you want to accept all currencies.""" % (line.account_id.code, line.account_id.name))) + raise osv.except_osv(_('Error'), _("""Couldn't create move with currency different from the secondary currency of the account "%s - %s". Clear the secondary currency field of the account definition if you want to accept all currencies.""" % (line.account_id.code, line.account_id.name))) if abs(amount) < 0.0001: if not len(line_draft_ids): @@ -1108,9 +1112,9 @@ class account_tax_code(osv.osv): fiscalyear_id = self.pool.get('account.fiscalyear').find(cr, uid, exception=False) where = '' if fiscalyear_id: - pids = map(lambda x: str(x.id), self.pool.get('account.fiscalyear').browse(cr, uid, fiscalyear_id).period_ids) - if pids: - where = ' and period_id in (' + (','.join(pids))+')' + pids = map(lambda x: str(x.id), self.pool.get('account.fiscalyear').browse(cr, uid, fiscalyear_id).period_ids) + if pids: + where = ' and period_id in (' + (','.join(pids))+')' return self._sum(cr, uid, ids, name, args, context, where=where) diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index eafc2c3f605..7f86f86420d 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -113,7 +113,7 @@ class account_move_line(osv.osv): account = journal_obj.default_debit_account_id - if account and ((not fields) or ('debit' in fields) or ('credit' in fields)) and 'partner_id' in data: + if account and ((not fields) or ('debit' in fields) or ('credit' in fields)) and 'partner_id' in data and (data['partner_id']): part = self.pool.get('res.partner').browse(cr, uid, data['partner_id']) account = self.pool.get('account.fiscal.position').map_account(cr, uid, part and part.property_account_position or False, account.id) account = self.pool.get('account.account').browse(cr, uid, account) @@ -707,6 +707,7 @@ class account_move_line(osv.osv): return result def unlink(self, cr, uid, ids, context={}, check=True): + print "CC" self._update_check(cr, uid, ids, context) result = False for line in self.browse(cr, uid, ids, context): diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index ab8678439fb..cdc0786c6eb 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -1309,7 +1309,7 @@ - + Entry Lines account.move.line form tree,form diff --git a/addons/account/invoice.py b/addons/account/invoice.py index a79bf281723..edb44b623e8 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -632,7 +632,7 @@ class account_invoice(osv.osv): journal = self.pool.get('account.journal').browse(cr, uid, journal_id) if journal.centralisation: raise osv.except_osv(_('UserError'), - _('Can not create invoice move on centralised journal')) + _('Cannot create invoice move on centralised journal')) move = {'ref': inv.number, 'line_id': line, 'journal_id': journal_id, 'date': date} period_id=inv.period_id and inv.period_id.id or False if not period_id: diff --git a/addons/account/product.py b/addons/account/product.py index b053a6e2826..b26d9b12208 100644 --- a/addons/account/product.py +++ b/addons/account/product.py @@ -34,7 +34,7 @@ class product_category(osv.osv): string="Income Account", method=True, view_load=True, - help="This account will be used instead of the default one to value incoming stock for the current product category"), + help="This account will be used to value incoming stock for the current product category"), 'property_account_expense_categ': fields.property( 'account.account', type='many2one', @@ -42,7 +42,7 @@ class product_category(osv.osv): string="Expense Account", method=True, view_load=True, - help="This account will be used instead of the default one to value outgoing stock for the current product category"), + help="This account will be used to value outgoing stock for the current product category"), } product_category() diff --git a/addons/account/report/invoice.rml b/addons/account/report/invoice.rml index c38a1b39623..3542841e7b4 100644 --- a/addons/account/report/invoice.rml +++ b/addons/account/report/invoice.rml @@ -326,7 +326,7 @@ [[ l.name ]] - [[ ', '.join([lt.name for lt in l.invoice_line_tax_id]) ]] + [[ ', '.join([ lt.description or '' for lt in l.invoice_line_tax_id ]) ]] [[ formatLang(l.quantity)]] @@ -489,7 +489,7 @@ - [[ t.name ]] + [[ lt.description and lt.description + ' - ' + t.name or t.name ]] [[ formatLang(t.base) ]] diff --git a/addons/account/wizard/wizard_account_chart.py b/addons/account/wizard/wizard_account_chart.py index 46df6357473..f60dfdcf0a2 100644 --- a/addons/account/wizard/wizard_account_chart.py +++ b/addons/account/wizard/wizard_account_chart.py @@ -27,7 +27,7 @@ class wizard_account_chart(wizard.interface): _account_chart_arch = '''
-
- + diff --git a/addons/crm_profiling/__terp__.py b/addons/crm_profiling/__terp__.py index 37629b2071e..6ea05a5fd34 100644 --- a/addons/crm_profiling/__terp__.py +++ b/addons/crm_profiling/__terp__.py @@ -45,6 +45,6 @@ 'demo_xml': ['crm_profiling_demo.xml'], 'installable': True, 'active': False, - 'certificate': '33984979005', + 'certificate': '0033984979005', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/crm_vertical/__terp__.py b/addons/crm_vertical/__terp__.py index 44e8113a165..34453baad14 100644 --- a/addons/crm_vertical/__terp__.py +++ b/addons/crm_vertical/__terp__.py @@ -33,6 +33,6 @@ 'update_xml': [], 'demo_xml': [], 'installable': True, - 'certificate': '59915476845', + 'certificate': '0059915476845', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/delivery/__terp__.py b/addons/delivery/__terp__.py index 1aec98e6f6f..856404465dc 100644 --- a/addons/delivery/__terp__.py +++ b/addons/delivery/__terp__.py @@ -38,6 +38,6 @@ 'demo_xml': ['delivery_demo.xml'], 'installable': True, 'active': False, - 'certificate': '33981912253', + 'certificate': '0033981912253', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/document/__terp__.py b/addons/document/__terp__.py index c6a772f5287..f7e326bbc65 100644 --- a/addons/document/__terp__.py +++ b/addons/document/__terp__.py @@ -43,6 +43,6 @@ 'demo_xml': [], 'installable': True, 'active': False, - 'certificate': '70515416461', + 'certificate': '0070515416461', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/document/document.py b/addons/document/document.py index 6cc2e7fd7e3..36d71c27a82 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -510,24 +510,31 @@ class document_file(osv.osv): if not value: return True #if (not context) or context.get('store_method','fs')=='fs': - path = self._get_filestore(cr) - if not os.path.isdir(path): - os.makedirs(path) - flag = None - # This can be improved - for dirs in os.listdir(path): - if os.path.isdir(os.path.join(path,dirs)) and len(os.listdir(os.path.join(path,dirs)))<4000: - flag = dirs - break - flag = flag or create_directory(path) - filename = random_name() - fname = os.path.join(path, flag, filename) - fp = file(fname,'wb') - v = base64.decodestring(value) - fp.write(v) - filesize = os.stat(fname).st_size - cr.execute('update ir_attachment set store_fname=%s,store_method=%s,file_size=%s where id=%s', (os.path.join(flag,filename),'fs',len(v),id)) - return True + try: + path = self._get_filestore(cr) + if not os.path.isdir(path): + try: + os.makedirs(path) + except: + raise except_orm('Permission Denied !', 'You do not permissions to write on the server side.') + + flag = None + # This can be improved + for dirs in os.listdir(path): + if os.path.isdir(os.path.join(path,dirs)) and len(os.listdir(os.path.join(path,dirs)))<4000: + flag = dirs + break + flag = flag or create_directory(path) + filename = random_name() + fname = os.path.join(path, flag, filename) + fp = file(fname,'wb') + v = base64.decodestring(value) + fp.write(v) + filesize = os.stat(fname).st_size + cr.execute('update ir_attachment set store_fname=%s,store_method=%s,file_size=%s where id=%s', (os.path.join(flag,filename),'fs',len(v),id)) + return True + except Exception,e : + raise except_orm('Error!', str(e)) _columns = { 'user_id': fields.many2one('res.users', 'Owner', select=1), @@ -609,7 +616,7 @@ class document_file(osv.osv): def create(self, cr, uid, vals, context={}): vals['title']=vals['name'] - vals['parent_id'] = context.get('parent_id',False) + vals['parent_id'] = context.get('parent_id',False) or vals.get('parent_id',False) if not vals.get('res_id', False) and context.get('default_res_id',False): vals['res_id']=context.get('default_res_id',False) if not vals.get('res_model', False) and context.get('default_res_model',False): diff --git a/addons/document_ics/__terp__.py b/addons/document_ics/__terp__.py index 0a9a626d3cc..d5adf71e88f 100644 --- a/addons/document_ics/__terp__.py +++ b/addons/document_ics/__terp__.py @@ -34,6 +34,6 @@ 'demo_xml': ['document_demo.xml'], 'installable': True, 'active': False, - 'certificate': '71242387229', + 'certificate': '0071242387229', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/event/__terp__.py b/addons/event/__terp__.py index 2cd05130736..49cfe71a53b 100644 --- a/addons/event/__terp__.py +++ b/addons/event/__terp__.py @@ -51,6 +51,6 @@ 'demo_xml': ['event_demo.xml'], 'installable': True, 'active': False, - 'certificate': '83059161581', + 'certificate': '0083059161581', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/event_project/__terp__.py b/addons/event_project/__terp__.py index 741f9796509..cd846203c75 100644 --- a/addons/event_project/__terp__.py +++ b/addons/event_project/__terp__.py @@ -36,6 +36,6 @@ 'demo_xml': [], 'installable': True, 'active': False, - 'certificate': '69726863885', + 'certificate': '0069726863885', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/google_map/__terp__.py b/addons/google_map/__terp__.py index 6b6b15b0838..9d5df2f8aed 100644 --- a/addons/google_map/__terp__.py +++ b/addons/google_map/__terp__.py @@ -36,6 +36,6 @@ url widget.""", 'demo_xml': [], 'installable': True, 'active': False, - 'certificate': '29498930765', + 'certificate': '0029498930765', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr/__terp__.py b/addons/hr/__terp__.py index efdd3d961af..0fc937404e3 100644 --- a/addons/hr/__terp__.py +++ b/addons/hr/__terp__.py @@ -49,6 +49,6 @@ 'demo_xml': ['hr_demo.xml', 'hr_department_demo.xml'], 'installable': True, 'active': False, - 'certificate': '86710558965', + 'certificate': '0086710558965', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr/hr.py b/addons/hr/hr.py index 924742ee017..b1de55a6ed5 100644 --- a/addons/hr/hr.py +++ b/addons/hr/hr.py @@ -126,6 +126,7 @@ class hr_employee(osv.osv): 'marital': fields.selection([('maried','Maried'),('unmaried','Unmaried'),('divorced','Divorced'),('other','Other')],'Marital Status', size=32), 'address_id': fields.many2one('res.partner.address', 'Working Address'), + 'address_home_id': fields.many2one('res.partner.address', 'Home Address'), 'work_phone': fields.char('Work Phone', size=32), 'work_email': fields.char('Work Email', size=128), 'work_location': fields.char('Office Location', size=32), diff --git a/addons/hr/hr_view.xml b/addons/hr/hr_view.xml index 25ebec25fdd..ff9f5f9be43 100644 --- a/addons/hr/hr_view.xml +++ b/addons/hr/hr_view.xml @@ -49,6 +49,7 @@ + diff --git a/addons/hr_attendance/__terp__.py b/addons/hr_attendance/__terp__.py index 6afa17c958c..5f59acab357 100644 --- a/addons/hr_attendance/__terp__.py +++ b/addons/hr_attendance/__terp__.py @@ -38,6 +38,6 @@ 'demo_xml': ['hr_attendance_demo.xml'], 'installable': True, 'active': False, - 'certificate': '63495605613', + 'certificate': '0063495605613', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr_contract/__terp__.py b/addons/hr_contract/__terp__.py index a253d60109e..2afd71a042a 100644 --- a/addons/hr_contract/__terp__.py +++ b/addons/hr_contract/__terp__.py @@ -45,6 +45,6 @@ 'demo_xml': [], 'installable': True, 'active': False, - 'certificate': '46298028637', + 'certificate': '0046298028637', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr_expense/__terp__.py b/addons/hr_expense/__terp__.py index 8c08af34e70..fd7ad9d2530 100644 --- a/addons/hr_expense/__terp__.py +++ b/addons/hr_expense/__terp__.py @@ -51,9 +51,9 @@ 'hr_expense_report.xml', 'process/hr_expense_process.xml' ], - 'demo_xml': ['hr_expense_demo.xml', 'hr.expense.expense.csv'], + 'demo_xml': ['hr.expense.expense.csv'], 'installable': True, 'active': False, - 'certificate': '62479841789', + 'certificate': '0062479841789', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr_expense/hr.expense.expense.csv b/addons/hr_expense/hr.expense.expense.csv index 56cc2cd0056..9cf0cf7d2aa 100644 --- a/addons/hr_expense/hr.expense.expense.csv +++ b/addons/hr_expense/hr.expense.expense.csv @@ -1,4 +1,3 @@ name,ref,employee_id,line_ids/date_value,line_ids/name,line_ids/analytic_account,line_ids/unit_quantity,line_ids/ref,line_ids/unit_amount September Expenses,09/06,Fabien Pinckaers,2006-09-05,Travel by Car - Customer Seagate 2 - Double,Thymbra,130.0,,0.22 -,,,2006-09-05,Travel by Car - Trainging,Trainings,100.0,,0.22 ,,,2006-09-05,Basic PC - Server for Seagate,Seagate P2,1.0,S1234435,300.0 diff --git a/addons/hr_expense/hr_expense_demo.xml b/addons/hr_expense/hr_expense_demo.xml deleted file mode 100644 index 1168fd29679..00000000000 --- a/addons/hr_expense/hr_expense_demo.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/addons/hr_holidays/__terp__.py b/addons/hr_holidays/__terp__.py index 948df531ceb..c8d7e445c9b 100644 --- a/addons/hr_holidays/__terp__.py +++ b/addons/hr_holidays/__terp__.py @@ -41,6 +41,6 @@ 'demo_xml': [], 'installable': True, 'active': False, - 'certificate': '86579209325', + 'certificate': '0086579209325', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr_timesheet/__terp__.py b/addons/hr_timesheet/__terp__.py index c17deafa743..56bca69936a 100644 --- a/addons/hr_timesheet/__terp__.py +++ b/addons/hr_timesheet/__terp__.py @@ -50,6 +50,6 @@ to set up a management by affair. 'demo_xml': ['hr_timesheet_demo.xml'], 'installable': True, 'active': False, - 'certificate': '71405533469', + 'certificate': '0071405533469', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr_timesheet_invoice/__terp__.py b/addons/hr_timesheet_invoice/__terp__.py index 899c466bdf7..34cb8b8a16d 100644 --- a/addons/hr_timesheet_invoice/__terp__.py +++ b/addons/hr_timesheet_invoice/__terp__.py @@ -42,6 +42,6 @@ reports, eso.""", 'demo_xml': ['hr_timesheet_invoice_demo.xml'], 'installable': True, 'active': False, - 'certificate': '56091842381', + 'certificate': '0056091842381', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/hr_timesheet_sheet/__terp__.py b/addons/hr_timesheet_sheet/__terp__.py index 006569b4c0e..129592adfaa 100644 --- a/addons/hr_timesheet_sheet/__terp__.py +++ b/addons/hr_timesheet_sheet/__terp__.py @@ -57,6 +57,6 @@ The validation can be configured in te company: 'demo_xml': ['hr_timesheet_sheet_demo.xml'], 'installable': True, 'active': False, - 'certificate': '73297700829', + 'certificate': '0073297700829', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/idea/__terp__.py b/addons/idea/__terp__.py index 37b6d0c52ab..a30d2854d32 100644 --- a/addons/idea/__terp__.py +++ b/addons/idea/__terp__.py @@ -38,6 +38,6 @@ ], 'demo_xml': [], 'installable': True, - 'certificate': '71515601309', + 'certificate': '0071515601309', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_be/__init__.py b/addons/l10n_be/__init__.py index f5dd0969f16..c652b702c26 100644 --- a/addons/l10n_be/__init__.py +++ b/addons/l10n_be/__init__.py @@ -20,6 +20,7 @@ # ############################################################################## +import company import wizard # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_be/__terp__.py b/addons/l10n_be/__terp__.py index 05c87181e45..910df2d39e2 100644 --- a/addons/l10n_be/__terp__.py +++ b/addons/l10n_be/__terp__.py @@ -58,6 +58,6 @@ 'account.report.report.csv' ], 'installable': True, - 'certificate': '31977724637', + 'certificate': '0031977724637', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_be/account_pcmn_belgium.xml b/addons/l10n_be/account_pcmn_belgium.xml index ccae720c08b..b5d183565c9 100644 --- a/addons/l10n_be/account_pcmn_belgium.xml +++ b/addons/l10n_be/account_pcmn_belgium.xml @@ -6628,6 +6628,16 @@ + + + Cocontractants 0% + NSCS 0 + + percent + + + sale + TVA 0% @@ -6638,16 +6648,6 @@ sale - - - Cocontractants 0% - NSS 0 - - percent - - - sale - TVA 6% @@ -6655,7 +6655,7 @@ percent - + @@ -6669,7 +6669,7 @@ percent - + @@ -6683,7 +6683,7 @@ percent - + @@ -6705,7 +6705,7 @@ Biens et Services Divers Déductibles 0% (1) - + percent @@ -6715,7 +6715,7 @@ Biens et Services Divers Déductibles 0% (2) - + percent @@ -6724,7 +6724,7 @@ Marchandises Déductibles 0% - NSGSD 0 + NSTF 0 percent @@ -6744,23 +6744,12 @@ Marchandises Déductibles 0% (2) - + percent purchase - - - - Cocontractants 0% - NSS 0 - - percent - - - sale - Biens et Services Divers Déductibles 6% @@ -6776,7 +6765,7 @@ Biens et Services Divers Déductibles 6% (1) percent - + @@ -6788,7 +6777,7 @@ Biens et Services Divers Déductibles 6% (2) - + percent @@ -6809,7 +6798,7 @@ Biens et Services Divers Déductibles 12% (1) percent - + @@ -6821,7 +6810,7 @@ Biens et Services Divers Déductibles 12% (2) - + percent @@ -6842,7 +6831,7 @@ Biens Déductibles 21% (1) percent - + @@ -6854,7 +6843,7 @@ Biens Déductibles 21% (2) - + percent @@ -6875,7 +6864,7 @@ Services Divers Déductibles 21% (1) percent - + @@ -6887,7 +6876,7 @@ Services Divers Déductibles 21% (2) - + percent @@ -6910,7 +6899,7 @@ Marchandises Déductibles 6% (1) percent - + @@ -6922,7 +6911,7 @@ Marchandises Déductibles 6% (2) - + percent @@ -6943,7 +6932,7 @@ Marchandises Déductibles 12% (1) percent - + @@ -6955,7 +6944,7 @@ Marchandises Déductibles 12% (2) - + percent @@ -6976,7 +6965,7 @@ Marchandises Déductibles 21% (1) percent - + @@ -6988,7 +6977,7 @@ Marchandises Déductibles 21% (2) - + percent @@ -6999,9 +6988,9 @@ - VAT 0% Exportations + TVA 0% Exportations ISEXP 0 - + percent @@ -7028,9 +7017,9 @@ - VAT 0% Intracommunautaire + TVA 0% Intracommunautaire VI 0 - + percent @@ -7052,7 +7041,7 @@ Biens Déductibles 21% (1) percent - + @@ -7063,10 +7052,13 @@ Biens Déductibles 21% (2) - + percent + + + purchase @@ -7075,7 +7067,7 @@ Biens Déductibles 21% (3) - + percent @@ -7096,7 +7088,7 @@ Marchandises Déductibles 21% (1) percent - + @@ -7107,10 +7099,13 @@ Marchandises Déductibles 21% (2) - + percent + + + purchase @@ -7119,7 +7114,7 @@ Marchandises Déductibles 21% (3) - + percent @@ -7140,10 +7135,10 @@ Services Divers Déductibles 21% (1) percent - + - + purchase @@ -7151,10 +7146,13 @@ Services Divers Déductibles 21% (2) - + percent + + - + + purchase @@ -7163,7 +7161,7 @@ Services Divers Déductibles 21% (3) - + percent diff --git a/addons/l10n_be/company.py b/addons/l10n_be/company.py new file mode 100644 index 00000000000..0ef41919dcb --- /dev/null +++ b/addons/l10n_be/company.py @@ -0,0 +1,43 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved +# $Id$ +# +# 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 . +# +############################################################################## + +from osv import osv + +class res_company(osv.osv): + _inherit = "res.company" + _description = 'res.company' + + + def _get_default_ad(self, addresses): + city = post_code = address = "" + for ads in addresses: + if ads.type == 'default': + city = ads.city or "" + post_code = ads.zip or "" + if ads.street: + address = ads.street or "" + if ads.street2: + address += " " + ads.street2 + return city, post_code, address +res_company() + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_be/fiscal_templates.xml b/addons/l10n_be/fiscal_templates.xml index 99a564b1a37..ff7b0e82f49 100644 --- a/addons/l10n_be/fiscal_templates.xml +++ b/addons/l10n_be/fiscal_templates.xml @@ -91,11 +91,6 @@ - - - - - diff --git a/addons/l10n_be/l10n_be_wizard.xml b/addons/l10n_be/l10n_be_wizard.xml index 12e38eba2ea..32960abc714 100644 --- a/addons/l10n_be/l10n_be_wizard.xml +++ b/addons/l10n_be/l10n_be_wizard.xml @@ -1,27 +1,35 @@ + + + + + diff --git a/addons/l10n_be/wizard/account_vat_declaration.py b/addons/l10n_be/wizard/account_vat_declaration.py index 1dfd85aa52f..7a6baef2f11 100644 --- a/addons/l10n_be/wizard/account_vat_declaration.py +++ b/addons/l10n_be/wizard/account_vat_declaration.py @@ -25,6 +25,8 @@ import datetime import pooler import base64 +from tools.translate import _ + form_fyear = """
@@ -48,6 +50,7 @@ fields = { 'readonly': True,}, } + class wizard_vat_declaration(wizard.interface): def _create_xml(self, cr, uid, data, context): @@ -58,7 +61,7 @@ class wizard_vat_declaration(wizard.interface): user_cmpny = obj_company.name vat_no=obj_company.partner_id.vat if not vat_no: - raise wizard.except_wizard('Data Insufficient','No VAT Number Associated with Main Company!') + raise wizard.except_wizard(_('Data Insufficient'),_('No VAT Number Associated with Main Company!')) tax_ids = pool_obj.get('account.tax.code').search(cr,uid,[]) ctx = context.copy() @@ -69,30 +72,34 @@ class wizard_vat_declaration(wizard.interface): if not obj_company.partner_id.address: address=post_code=city='' - for ads in obj_company.partner_id.address: - if ads.type=='default': - if ads.zip_id: - city=ads.zip_id.city - post_code=ads.zip_id.name - if ads.street: - address=ads.street - if ads.street2: - address +=ads.street2 + city, post_code, address = pooler.get_pool(cr.dbname).get('res.company')._get_default_ad(obj_company.partner_id.address) obj_fyear = pool_obj.get('account.fiscalyear') year_id = obj_fyear.find(cr, uid) - current_year = obj_fyear.browse(cr,uid,year_id).name - month=time.strftime('%m') + + account_period=pool_obj.get('account.period').browse(cr, uid, data['form']['period']) + current_year = account_period.fiscalyear_id.name + period_code = account_period.code - period_code = pool_obj.get('account.period').browse(cr, uid, data['form']['period']).code send_ref = user_cmpny if period_code: send_ref = send_ref + period_code data_of_file='\n' - data_of_file +='\n\t\n\t\t'+str(vat_no)+'\n\t\t'+str(obj_company.name)+'\n\t\t
'+str(address)+'
' - data_of_file +='\n\t\t'+str(post_code)+'\n\t\t'+str(city)+'\n\t\t'+send_ref+'\n\t
' - data_of_file +='\n\t\n\t\t1\n\t\t'+str(vat_no)+'\n\t\t\n\t\t\t'+str(month)+'\n\t\t\t'+str(current_year[-4:])+'\n\t\t\n\t\t' + data_of_file +='\n\t\n\t\t'+str(vat_no)+'\n\t\t'+str(obj_company.name)+'\n\t\t
'+address+'
' + data_of_file +='\n\t\t'+post_code+'\n\t\t'+city+'\n\t\t'+send_ref+'\n\t
' + data_of_file +='\n\t\n\t\t1\n\t\t'+str(vat_no)+'\n\t\t\n\t\t\t' + + starting_month = account_period.date_start[5:7] + ending_month = account_period.date_stop[5:7] + if starting_month != ending_month: + #starting month and ending month of selected period are not the same + #it means that the accounting isn't based on periods of 1 month but on quarters + quarter = str(((int(starting_month) - 1) / 3) + 1) + data_of_file += ''+quarter+'\n\t\t\t' + else: + data_of_file += ''+starting_month+'\n\t\t\t' + data_of_file += '' + str(account_period.date_stop[:4]) + '\n\t\t\n\t\t' data_of_file +='\n\t\t\n\t\t\t' for item in tax_info: diff --git a/addons/l10n_be/wizard/partner_vat_listing.py b/addons/l10n_be/wizard/partner_vat_listing.py index cac723612ae..051ecd1b273 100644 --- a/addons/l10n_be/wizard/partner_vat_listing.py +++ b/addons/l10n_be/wizard/partner_vat_listing.py @@ -62,27 +62,23 @@ class wizard_vat(wizard.interface): def _create_xml(self, cr, uid, data, context): datas=[] - # now wizard will use user->company instead of directly company from res.company - seq_controlref = pooler.get_pool(cr.dbname).get('ir.sequence').get(cr, uid,'controlref') seq_declarantnum = pooler.get_pool(cr.dbname).get('ir.sequence').get(cr, uid,'declarantnum') obj_cmpny = pooler.get_pool(cr.dbname).get('res.users').browse(cr, uid, uid).company_id company_vat = obj_cmpny.partner_id.vat - if not company_vat: #if not vat_company: + if not company_vat: raise wizard.except_wizard('Data Insufficient','No VAT Number Associated with Main Company!') cref = company_vat + seq_controlref dnum = cref + seq_declarantnum -# obj_company=pooler.get_pool(cr.dbname).get('res.company').browse(cr,uid,1) -# vat_company=obj_company.partner_id.vat -#TODO: can be improved if we replace this test => add a new field on res_partner for cases when a partner has a number and is not subjected to the VAT... have to see if this situation could happen - p_id_list=pooler.get_pool(cr.dbname).get('res.partner').search(cr,uid,[('vat','!=',False)]) + p_id_list=pooler.get_pool(cr.dbname).get('res.partner').search(cr,uid,[('vat_subjected','!=',False)]) if not p_id_list: raise wizard.except_wizard('Data Insufficient!','No partner has a VAT Number asociated with him.') obj_year=pooler.get_pool(cr.dbname).get('account.fiscalyear').browse(cr,uid,data['form']['fyear']) - period="to_date('" + str(obj_year.date_start) + "','yyyy-mm-dd') and to_date('" + str(obj_year.date_stop) +"','yyyy-mm-dd')" + period_ids = pooler.get_pool(cr.dbname).get('account.period').search(cr, uid, [('fiscalyear_id', '=', data['form']['fyear'])]) + period = "("+','.join(map(lambda x: str(x), period_ids)) +")" street=zip_city=country='' addr = pooler.get_pool(cr.dbname).get('res.partner').address_get(cr, uid, [obj_cmpny.partner_id.id], ['invoice']) @@ -109,39 +105,57 @@ class wizard_vat(wizard.interface): data_file +='\n\n\t\n\t\t'+str(company_vat)+'\n\t\t'+str(obj_cmpny.name)+'\n\t\t'+ str(street) +'\n\t\t'+ str(zip_city) +'' data_file +='\n\t\t'+ str(country) +'\n\t\n' data_comp ='\n\n\t'+str(company_vat)+'\n\t'+str(obj_cmpny.name)+'\n\t'+ str(street) +'\n\t'+ str(zip_city) +'\n\t'+ str(country) +'\n' - data_period ='\n'+ str(obj_year.name[-4:]) +'' + data_period ='\n'+ str(obj_year.date_stop[:4]) +'' error_message=[] + for p_id in p_id_list: - record=[] # this holds record per partner - obj_partner=pooler.get_pool(cr.dbname).get('res.partner').browse(cr,uid,p_id) - cr.execute('select b.code,sum(credit)-sum(debit) from account_move_line l left join account_account a on (l.account_id=a.id) left join account_account_type b on (a.user_type=b.id) where b.code in ('"'produit'"','"'tax'"') and l.partner_id=%%s and l.date between %s group by b.code' % (period,), (p_id,)) + record = {} # this holds record per partner + obj_partner = pooler.get_pool(cr.dbname).get('res.partner').browse(cr,uid,p_id) + + #This listing is only for customers located in belgium, that's the + #reason why we skip all the partners that haven't their + #(or one of their) default address(es) located in Belgium. + go_ahead = False + for ads in obj_partner.address: + if ads.type == 'default' and (ads.country_id and ads.country_id.code == 'BE'): + go_ahead = True + break + if not go_ahead: + continue + query = 'select b.code,sum(credit)-sum(debit) from account_move_line l left join account_account a on (l.account_id=a.id) left join account_account_type b on (a.user_type=b.id) where b.code in ('"'produit'"','"'tax'"') and l.partner_id='+str(p_id)+' and l.period_id in '+period+' group by b.code' + cr.execute(query) line_info=cr.fetchall() if not line_info: continue - record.append(obj_partner.vat) - addr = pooler.get_pool(cr.dbname).get('res.partner').address_get(cr, uid, [obj_partner.id], ['invoice']) - if addr.get('invoice',False): - ads=pooler.get_pool(cr.dbname).get('res.partner.address').browse(cr,uid,[addr['invoice']])[0] + record['vat'] = obj_partner.vat + + #it seems that this listing is only for belgian customers + record['country'] = 'BE' + + #...deprecated... + #~addr = pooler.get_pool(cr.dbname).get('res.partner').address_get(cr, uid, [obj_partner.id], ['invoice']) - if ads.country_id: - record.append(ads.country_id.code) - else: - error_message.append('Data Insufficient! : '+ 'The Partner "'+obj_partner.name + '"'' has no country associated with its Invoice address!') + #~ if addr.get('invoice',False): + #~ads=pooler.get_pool(cr.dbname).get('res.partner.address').browse(cr,uid,[addr['invoice']])[0] + + #~ if ads.country_id: + #~ record.append(ads.country_id.code) + #~ else: + #~ error_message.append('Data Insufficient! : '+ 'The Partner "'+obj_partner.name + '"'' has no country associated with its Invoice address!') - if len(record)<2: - record.append('') - error_message.append('Data Insufficient! : '+ 'The Partner "'+obj_partner.name + '"'' has no Invoice address!') - if len(line_info)==1: - if line_info[0][0]=='produit': - record.append(0.00) - record.append(line_info[0][1]) + #~ if len(record)<2: + #~ record.append('') + #~ error_message.append('Data Insufficient! : '+ 'The Partner "'+obj_partner.name + '"'' has no Invoice address!') + + record['amount'] = 0 + record['turnover'] = 0 + + for item in line_info: + if item[0]=='produit': + record['turnover'] += item[1] else: - record.append(line_info[0][1]) - record.append(0.00) - else: - for item in line_info: - record.append(item[1]) + record['amount'] += item[1] datas.append(record) seq=0 @@ -152,12 +166,12 @@ class wizard_vat(wizard.interface): data['form']['msg']='Exception : \n' +'-'*50+'\n'+ '\n'.join(error_message) return data['form'] for line in datas: - if line[3]< data['form']['limit_amount']: + if line['turnover'] < data['form']['limit_amount']: continue seq +=1 - sum_tax +=line[2] - sum_turnover +=line[3] - data_clientinfo +='\n\n\t\n\t\t'+line[0] +'\n\t\t'+line[1] +'\n\t\n\t'+str(int(line[2] * 100)) +'\n\t'+str(int(line[3] * 100)) +'\n' + sum_tax +=line['amount'] + sum_turnover +=line['turnover'] + data_clientinfo +='\n\n\t\n\t\t'+line['vat'] +'\n\t\t'+line['country'] +'\n\t\n\t'+str(int(line['amount'] * 100)) +'\n\t'+str(int(line['turnover'] * 100)) +'\n' data_decl ='\n' data_file += str(data_decl) + str(data_comp) + str(data_period) + str(data_clientinfo) + '\n' diff --git a/addons/l10n_chart_uk_minimal/__terp__.py b/addons/l10n_chart_uk_minimal/__terp__.py index 3b714b16986..b4881867bb8 100644 --- a/addons/l10n_chart_uk_minimal/__terp__.py +++ b/addons/l10n_chart_uk_minimal/__terp__.py @@ -76,6 +76,6 @@ ], 'demo_xml': [], 'installable': True, - 'certificate': '64392144797', + 'certificate': '0064392144797', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_fr/__terp__.py b/addons/l10n_fr/__terp__.py index 6d9bccc590d..b3a1f507ce1 100644 --- a/addons/l10n_fr/__terp__.py +++ b/addons/l10n_fr/__terp__.py @@ -51,7 +51,7 @@ Credits: Sistheo Zeekom CrysaLEAD "security/ir.model.access.csv", ], "demo_xml" : [], - "certificate" : "435321693876313629", + "certificate" : "00435321693876313629", "active": False, "installable": True } diff --git a/addons/l10n_lu/__terp__.py b/addons/l10n_lu/__terp__.py index 62d39d81e67..169d95df3fc 100644 --- a/addons/l10n_lu/__terp__.py +++ b/addons/l10n_lu/__terp__.py @@ -44,6 +44,6 @@ This module installs: ], 'demo_xml': ['account.report.report.csv'], 'installable': True, - 'certificate': '78164766621', + 'certificate': '0078164766621', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_lu/account.tax.template.csv b/addons/l10n_lu/account.tax.template.csv index 93b4aaa28ea..3b751c5d448 100644 --- a/addons/l10n_lu/account.tax.template.csv +++ b/addons/l10n_lu/account.tax.template.csv @@ -1,35 +1,36 @@ -"ref_base_code_id:id","ref_base_sign","name","ref_tax_code_id:id","account_collected_id:id","amount","chart_template_id:id","tax_code_id:id","child_depend","include_base_amount","parent_id:id","tax_sign","account_paid_id:id","base_code_id:id","id","ref_tax_sign" -"account_tax_code_template_9",-1,"Intra Travail à façon 0%",,,"0.0000","l10nlu_chart_template",,0,0,,1,,"account_tax_code_template_9","account_tax_template_1",1 -"account_tax_code_template_9",-1,"Intra Livraison avec installation 0%",,,"0.0000","l10nlu_chart_template",,0,0,,1,,"account_tax_code_template_9","account_tax_template_2",1 -"account_tax_code_template_9",-1,"Intra transfert de biens 0%",,,"0.0000","l10nlu_chart_template",,0,0,,1,,"account_tax_code_template_9","account_tax_template_3",1 -"account_tax_code_template_13",-1,"Vente de tabacs 0%",,,"0.0000","l10nlu_chart_template",,0,0,,1,,"account_tax_code_template_13","account_tax_template_9",1 -"account_tax_code_template_10",-1,"Exportations 0%",,,"0.0000","l10nlu_chart_template",,0,0,,1,,"account_tax_code_template_10","account_tax_template_10",1 -,1,"Achats frais généraux 0%",,,"0.0000","l10nlu_chart_template",,0,0,,1,,,"account_tax_template_11",1 -"account_tax_code_template_29",-1,"Ventes 3%","account_tax_code_template_34","account_451000","0.0300","l10nlu_chart_template","account_tax_code_template_34",0,0,,1,"account_451000","account_tax_code_template_29","account_tax_template_5",-1 -"account_tax_code_template_28",-1,"Ventes 6%","account_tax_code_template_33","account_451000","0.0600","l10nlu_chart_template","account_tax_code_template_33",0,0,,1,"account_451000","account_tax_code_template_28","account_tax_template_6",-1 -"account_tax_code_template_30",-1,"Ventes 12%","account_tax_code_template_35","account_451000","0.1200","l10nlu_chart_template","account_tax_code_template_35",0,0,,1,"account_451000","account_tax_code_template_30","account_tax_template_7",-1 -"account_tax_code_template_27",-1,"Ventes 15%","account_tax_code_template_32","account_451000","0.1500","l10nlu_chart_template","account_tax_code_template_32",0,0,,1,"account_451000","account_tax_code_template_27","account_tax_template_8",-1 -,1,"Achats frais généraux 15%","account_tax_code_template_18","account_411000","0.1500","l10nlu_chart_template","account_tax_code_template_18",0,0,,1,"account_411000",,"account_tax_template_12",-1 -,1,"Achats Intra-Co",,,1,"l10nlu_chart_template",,1,0,,1,,"account_tax_code_template_38","account_tax_template_13",1 -,1,"Achats de Services Art.26",,,1,"l10nlu_chart_template",,1,0,,1,,"account_tax_code_template_38","account_tax_template_18",1 -,1,"Ventes de Services Art.26",,,1,"l10nlu_chart_template",,1,0,,1,,"account_tax_code_template_38","account_tax_template_21",1 -,1,"Livraison de Biens Triangulaire 1",,"account_411500","0.1500","l10nlu_chart_template","account_tax_code_template_45",0,0,,1,"account_411000","account_tax_code_template_38","account_tax_template_26",1 -,1,"Livraisons de biens triangulaire 2",,"account_411000","-0.1500","l10nlu_chart_template","account_tax_code_template_22",0,0,,-1,"account_451000",,"account_tax_template_25",1 -,1,"Importations a des fins de l'entreprise",,,1,"l10nlu_chart_template",,1,0,,1,,"account_tax_code_template_38","account_tax_template_30",1 -,1,"Importations a des fins privées",,,1,"l10nlu_chart_template",,1,0,,1,,"account_tax_code_template_38","account_tax_template_33",1 -,1,"Livraisons de Biens Art.26",,,1,"l10nlu_chart_template",,1,0,,1,,"account_tax_code_template_38","account_tax_template_36",1 -,1,"Livraison de Biens triangulaire",,,1,"l10nlu_chart_template",,1,0,,1,,"account_tax_code_template_38","account_tax_template_24",1 -,1,"Livraisons de biens triangulaire 2",,"account_411000","-0.1500","l10nlu_chart_template","account_tax_code_template_22",0,0,"account_tax_template_24",-1,"account_451000",,"account_tax_template_22",1 -,1,"Livraison de Biens Triangulaire 1",,"account_411500","0.1500","l10nlu_chart_template","account_tax_code_template_45",0,0,"account_tax_template_24",1,"account_411000","account_tax_code_template_38","account_tax_template_23",1 -,1,"Importations Intra-Co2",,"account_451000","-0.1500","l10nlu_chart_template","account_tax_code_template_56",0,0,"account_tax_template_30",-1,"account_411000","account_tax_code_template_51","account_tax_template_28",1 -,1,"Importations Intra-Co 1",,"account_411500","0.1500","l10nlu_chart_template","account_tax_code_template_20",0,0,"account_tax_template_30",1,"account_411000",,"account_tax_template_29",1 -,1,"Importations Fins Privées",,"account_451000","-0.1500","l10nlu_chart_template","account_tax_code_template_64",0,0,"account_tax_template_33",-1,"account_411000","account_tax_code_template_60","account_tax_template_31",1 -,1,"Importations Fins Privées",,"account_411500","0.1500","l10nlu_chart_template","account_tax_code_template_20",0,0,"account_tax_template_33",1,"account_411000",,"account_tax_template_32",1 -,1,"Livraison de Biens Art26",,"account_411000","-0.1500","l10nlu_chart_template","account_tax_code_template_22",0,0,"account_tax_template_36",-1,"account_451000",,"account_tax_template_34",1 -,1,"Livraisons de Biens Art26",,"account_411500","0.1500","l10nlu_chart_template","account_tax_code_template_82",0,0,"account_tax_template_36",1,"account_411000","account_tax_code_template_78","account_tax_template_35",1 -,1,"Achats Intra-Co 1",,"account_411500","0.1500","l10nlu_chart_template","account_tax_code_template_19",0,0,"account_tax_template_13",1,"account_411000","account_tax_code_template_38","account_tax_template_14",1 -,1,"Achats Intra-CO2",,"account_451000","-0.1500","l10nlu_chart_template","account_tax_code_template_45",0,0,"account_tax_template_13",-1,"account_411000",,"account_tax_template_15",1 -,1,"Services Intra-Co2",,"account_451000","-0.1500","l10nlu_chart_template","account_tax_code_template_45",0,0,"account_tax_template_18",-1,"account_411000",,"account_tax_template_17",1 -,1,"Services Intra-Co 1",,"account_411500","0.1500","l10nlu_chart_template","account_tax_code_template_22",0,0,"account_tax_template_18",1,"account_411000","account_tax_code_template_38","account_tax_template_16",1 -,1,"Services Intra-Co2",,"account_411000","-0.1500","l10nlu_chart_template","account_tax_code_template_22",0,0,"account_tax_template_21",-1,"account_451000",,"account_tax_template_19",1 -,1,"Services Intra-Co 1",,"account_411500","0.1500","l10nlu_chart_template","account_tax_code_template_86",0,0,"account_tax_template_21",1,"account_411000","account_tax_code_template_74","account_tax_template_20",1 +"ref_base_code_id:id","ref_base_sign","name","description","type_tax_use","ref_tax_code_id:id","account_collected_id:id","amount","chart_template_id:id","tax_code_id:id","child_depend","include_base_amount","parent_id:id","tax_sign","account_paid_id:id","base_code_id:id","id","ref_tax_sign" +"account_tax_code_template_9",-1,"Intra Travail à façon 0%","ESWRK0","sale",,,"0.0000","l10nlu_chart_template",,0,0,,1,,"account_tax_code_template_9","account_tax_template_1",1 +"account_tax_code_template_9",-1,"Intra Livraison avec installation 0%","ESDLI0","sale",,,"0.0000","l10nlu_chart_template",,0,0,,1,,"account_tax_code_template_9","account_tax_template_2",1 +"account_tax_code_template_9",-1,"Intra transfert de biens 0%","ESTRF0","sale",,,"0.0000","l10nlu_chart_template",,0,0,,1,,"account_tax_code_template_9","account_tax_template_3",1 +"account_tax_code_template_13",-1,"Vente de tabacs 0%","NSNST0","sale",,,"0.0000","l10nlu_chart_template",,0,0,,1,,"account_tax_code_template_13","account_tax_template_9",1 +"account_tax_code_template_10",-1,"Exportations 0%","ISEXP0","sale",,,"0.0000","l10nlu_chart_template",,0,0,,1,,"account_tax_code_template_10","account_tax_template_10",1 +,1,"Achats frais généraux 0%","ESSDD0","purchase",,,"0.0000","l10nlu_chart_template",,0,0,,1,,,"account_tax_template_11",1 +"account_tax_code_template_29",-1,"Ventes 3%","NSS 3","sale","account_tax_code_template_34","account_451000","0.0300","l10nlu_chart_template","account_tax_code_template_34",0,0,,1,"account_451000","account_tax_code_template_29","account_tax_template_5",-1 +"account_tax_code_template_28",-1,"Ventes 6%","NSS 6","sale","account_tax_code_template_33","account_451000","0.0600","l10nlu_chart_template","account_tax_code_template_33",0,0,,1,"account_451000","account_tax_code_template_28","account_tax_template_6",-1 +"account_tax_code_template_30",-1,"Ventes 12%","NSS 12","sale","account_tax_code_template_35","account_451000","0.1200","l10nlu_chart_template","account_tax_code_template_35",0,0,,1,"account_451000","account_tax_code_template_30","account_tax_template_7",-1 +"account_tax_code_template_27",-1,"Ventes 15%","NSS 15","sale","account_tax_code_template_32","account_451000","0.1500","l10nlu_chart_template","account_tax_code_template_32",0,0,,1,"account_451000","account_tax_code_template_27","account_tax_template_8",-1 +,1,"Achats frais généraux 15%","NSGSD15","purchase","account_tax_code_template_18","account_411000","0.1500","l10nlu_chart_template","account_tax_code_template_18",0,0,,1,"account_411000",,"account_tax_template_12",-1 +,1,"Achats Intra-Co",,"purchase",,,1,"l10nlu_chart_template",,1,0,,1,,"account_tax_code_template_38","account_tax_template_13",1 +,1,"Achats de Services Art.26",,"purchase",,,1,"l10nlu_chart_template",,1,0,,1,,"account_tax_code_template_38","account_tax_template_18",1 +,1,"Ventes de Services Art.26",,"sale",,,1,"l10nlu_chart_template",,1,0,,1,,"account_tax_code_template_38","account_tax_template_21",1 +,1,"Livraison de Biens Triangulaire 1",,"sale",,"account_411500","0.1500","l10nlu_chart_template","account_tax_code_template_45",0,0,,1,"account_411000","account_tax_code_template_38","account_tax_template_26",1 +,1,"Livraisons de biens triangulaire 2",,"sale",,"account_411000","-0.1500","l10nlu_chart_template","account_tax_code_template_22",0,0,,-1,"account_451000",,"account_tax_template_25",1 +,1,"Importations a des fins de l'entreprise",,"purchase",,,1,"l10nlu_chart_template",,1,0,,1,,"account_tax_code_template_38","account_tax_template_30",1 +,1,"Importations a des fins privées",,"purchase",,,1,"l10nlu_chart_template",,1,0,,1,,"account_tax_code_template_38","account_tax_template_33",1 +,1,"Livraisons de Biens Art.26",,"sale",,,1,"l10nlu_chart_template",,1,0,,1,,"account_tax_code_template_38","account_tax_template_36",1 +,1,"Livraison de Biens triangulaire",,"sale",,,1,"l10nlu_chart_template",,1,0,,1,,"account_tax_code_template_38","account_tax_template_24",1 +,1,"Livraisons de biens triangulaire 2",,"sale",,"account_411000","-0.1500","l10nlu_chart_template","account_tax_code_template_22",0,0,"account_tax_template_24",-1,"account_451000",,"account_tax_template_22",1 +,1,"Livraison de Biens Triangulaire 1",,"sale",,"account_411500","0.1500","l10nlu_chart_template","account_tax_code_template_45",0,0,"account_tax_template_24",1,"account_411000","account_tax_code_template_38","account_tax_template_23",1 +,1,"Importations Intra-Co2",,"purchase",,"account_451000","-0.1500","l10nlu_chart_template","account_tax_code_template_56",0,0,"account_tax_template_30",-1,"account_411000","account_tax_code_template_51","account_tax_template_28",1 +,1,"Importations Intra-Co 1",,"purchase",,"account_411500","0.1500","l10nlu_chart_template","account_tax_code_template_20",0,0,"account_tax_template_30",1,"account_411000",,"account_tax_template_29",1 +,1,"Importations Fins Privées",,"purchase",,"account_451000","-0.1500","l10nlu_chart_template","account_tax_code_template_64",0,0,"account_tax_template_33",-1,"account_411000","account_tax_code_template_60","account_tax_template_31",1 +,1,"Importations Fins Privées",,"purchase",,"account_411500","0.1500","l10nlu_chart_template","account_tax_code_template_20",0,0,"account_tax_template_33",1,"account_411000",,"account_tax_template_32",1 +,1,"Livraison de Biens Art26",,"sale",,"account_411000","-0.1500","l10nlu_chart_template","account_tax_code_template_22",0,0,"account_tax_template_36",-1,"account_451000",,"account_tax_template_34",1 +,1,"Livraisons de Biens Art26",,"sale",,"account_411500","0.1500","l10nlu_chart_template","account_tax_code_template_82",0,0,"account_tax_template_36",1,"account_411000","account_tax_code_template_78","account_tax_template_35",1 +,1,"Achats Intra-Co 1",,"purchase",,"account_411500","0.1500","l10nlu_chart_template","account_tax_code_template_19",0,0,"account_tax_template_13",1,"account_411000","account_tax_code_template_38","account_tax_template_14",1 +,1,"Achats Intra-CO2",,"purchase",,"account_451000","-0.1500","l10nlu_chart_template","account_tax_code_template_45",0,0,"account_tax_template_13",-1,"account_411000",,"account_tax_template_15",1 +,1,"Services Intra-Co2",,"purchase",,"account_451000","-0.1500","l10nlu_chart_template","account_tax_code_template_45",0,0,"account_tax_template_18",-1,"account_411000",,"account_tax_template_17",1 +,1,"Services Intra-Co 1",,"purchase",,"account_411500","0.1500","l10nlu_chart_template","account_tax_code_template_22",0,0,"account_tax_template_18",1,"account_411000","account_tax_code_template_38","account_tax_template_16",1 +,1,"Services Intra-Co2",,"sale",,"account_411000","-0.1500","l10nlu_chart_template","account_tax_code_template_22",0,0,"account_tax_template_21",-1,"account_451000",,"account_tax_template_19",1 +,1,"Services Intra-Co 1",,"sale",,"account_411500","0.1500","l10nlu_chart_template","account_tax_code_template_86",0,0,"account_tax_template_21",1,"account_411000","account_tax_code_template_74","account_tax_template_20",1 + diff --git a/addons/membership/__terp__.py b/addons/membership/__terp__.py index 54dce054fad..dfc6774da2f 100644 --- a/addons/membership/__terp__.py +++ b/addons/membership/__terp__.py @@ -49,6 +49,6 @@ invoice and send propositions for membership renewal. 'demo_xml': ['membership_demo.xml'], 'installable': True, 'active': False, - 'certificate': '42907796381', + 'certificate': '0042907796381', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/membership/membership.py b/addons/membership/membership.py index 77bd2d9e981..c34ed55126e 100644 --- a/addons/membership/membership.py +++ b/addons/membership/membership.py @@ -469,24 +469,6 @@ class Invoice(osv.osv): _inherit = 'account.invoice' - def create(self, cr, uid, vals, context={}): - result = super(Invoice, self).create(cr, uid, vals, context) - invoice = self.browse(cr, uid, result) - member_line_obj = self.pool.get('membership.membership_line') - for line in invoice.invoice_line: - if line.product_id and line.product_id.membership: - date_from = line.product_id.membership_date_from - date_to = line.product_id.membership_date_to - if invoice.date_invoice > date_from and invoice.date_invoice < date_to: - date_from = invoice.date_invoice - line_id = member_line_obj.create(cr, uid, { - 'partner': invoice.partner_id.id, - 'date_from': date_from, - 'date_to': date_to, - 'account_invoice_line': line.id, - }) - return result - def action_cancel(self, cr, uid, ids, context=None): '''Create a 'date_cancel' on the membership_line object''' if context is None: @@ -730,3 +712,58 @@ class ReportPartnerMemberYearNew(osv.osv): ReportPartnerMemberYearNew() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: + +class account_invoice_line(osv.osv): + _inherit='account.invoice.line' + def write(self, cr, uid, ids, vals, context=None): + if not context: + context={} + res = super(account_invoice_line, self).write(cr, uid, ids, vals, context=context) + member_line_obj = self.pool.get('membership.membership_line') + for line in self.browse(cr, uid, ids): + ml_ids = member_line_obj.search(cr, uid, [('account_invoice_line','=',line.id)]) + if line.product_id and line.product_id.membership and not ml_ids: + # Product line has changed to a membership product + date_from = line.product_id.membership_date_from + date_to = line.product_id.membership_date_to + if line.invoice_id.date_invoice > date_from and line.invoice_id.date_invoice < date_to: + date_from = line.invoice_id.date_invoice + line_id = member_line_obj.create(cr, uid, { + 'partner': line.invoice_id.partner_id.id, + 'date_from': date_from, + 'date_to': date_to, + 'account_invoice_line': line.id, + }) + if line.product_id and not line.product_id.membership and ml_ids: + # Product line has changed to a non membership product + member_line_obj.unlink(cr, uid, ml_ids, context=context) + return res + + def unlink(self, cr, uid, ids, context=None): + if not context: + context={} + member_line_obj = self.pool.get('membership.membership_line') + for id in ids: + ml_ids = member_line_obj.search(cr, uid, [('account_invoice_line','=',id)]) + member_line_obj.unlink(cr, uid, ml_ids, context=context) + return super(account_invoice_line, self).unlink(cr, uid, ids, context=context) + + def create(self, cr, uid, vals, context={}): + result = super(account_invoice_line, self).create(cr, uid, vals, context) + line = self.browse(cr, uid, result) + member_line_obj = self.pool.get('membership.membership_line') + ml_ids = member_line_obj.search(cr, uid, [('account_invoice_line','=',line.id)]) + if line.product_id and line.product_id.membership and not ml_ids: + # Product line is a membership product + date_from = line.product_id.membership_date_from + date_to = line.product_id.membership_date_to + if line.invoice_id.date_invoice > date_from and line.invoice_id.date_invoice < date_to: + date_from = line.invoice_id.date_invoice + line_id = member_line_obj.create(cr, uid, { + 'partner': line.invoice_id.partner_id.id, + 'date_from': date_from, + 'date_to': date_to, + 'account_invoice_line': line.id, + }) + return result +account_invoice_line() diff --git a/addons/mrp/__terp__.py b/addons/mrp/__terp__.py index 47d2a6a2836..508b66a7878 100644 --- a/addons/mrp/__terp__.py +++ b/addons/mrp/__terp__.py @@ -75,6 +75,6 @@ 'demo_xml': ['mrp_demo.xml', 'mrp_order_point.xml'], 'installable': True, 'active': False, - 'certificate': '32052481373', + 'certificate': '0032052481373', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index 8bae8c4fed4..fd16f22497d 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -1044,7 +1044,7 @@ class mrp_procurement(osv.osv): price = self.pool.get('product.pricelist').price_get(cr, uid, [pricelist_id], procurement.product_id.id, qty, False, {'uom': uom_id})[pricelist_id] - newdate = DateTime.strptime(procurement.date_planned, '%Y-%m-%d %H:%M:%S') - DateTime.RelativeDateTime(days=procurement.product_id.product_tmpl_id.seller_delay or 0.0) + newdate = DateTime.strptime(procurement.date_planned, '%Y-%m-%d %H:%M:%S') newdate = newdate - DateTime.RelativeDateTime(days=company.po_lead) context.update({'lang':partner.lang}) product=self.pool.get('product.product').browse(cr,uid,procurement.product_id.id,context=context) diff --git a/addons/mrp_jit/__terp__.py b/addons/mrp_jit/__terp__.py index 399419d0d82..944971b97e7 100644 --- a/addons/mrp_jit/__terp__.py +++ b/addons/mrp_jit/__terp__.py @@ -42,6 +42,6 @@ 'demo_xml': [], 'installable': True, 'active': False, - 'certificate': '86634760061', + 'certificate': '0086634760061', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/mrp_operations/__terp__.py b/addons/mrp_operations/__terp__.py index ed7f848fe5f..c53269f5b7c 100644 --- a/addons/mrp_operations/__terp__.py +++ b/addons/mrp_operations/__terp__.py @@ -64,6 +64,6 @@ 'demo_xml': ['mrp_operation_data.xml'], 'installable': True, 'active': False, - 'certificate': '56233813133', + 'certificate': '0056233813133', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/mrp_repair/__terp__.py b/addons/mrp_repair/__terp__.py index 380e02a6c67..5db51c15ce4 100644 --- a/addons/mrp_repair/__terp__.py +++ b/addons/mrp_repair/__terp__.py @@ -47,6 +47,6 @@ 'demo_xml': [], 'installable': True, 'active': False, - 'certificate': '60814381277', + 'certificate': '0060814381277', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/mrp_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py index 3d1ab1fbfc0..eb9fe390bd9 100644 --- a/addons/mrp_repair/mrp_repair.py +++ b/addons/mrp_repair/mrp_repair.py @@ -471,10 +471,10 @@ class mrp_repair_line(osv.osv, ProductChangeMixin): _name = 'mrp.repair.line' _description = 'Repair Operations Lines' - def copy(self, cr, uid, id, default=None, context=None): + def copy_data(self, cr, uid, id, default=None, context=None): if not default: default = {} default.update( {'invoice_line_id':False,'move_id':False,'invoiced':False,'state':'draft'}) - return super(mrp_repair_line, self).copy(cr, uid, id, default, context) + return super(mrp_repair_line, self).copy_data(cr, uid, id, default, context) def _amount_line(self, cr, uid, ids, field_name, arg, context): res = {} @@ -539,10 +539,10 @@ mrp_repair_line() class mrp_repair_fee(osv.osv, ProductChangeMixin): _name = 'mrp.repair.fee' _description = 'Repair Fees line' - def copy(self, cr, uid, id, default=None, context=None): + def copy_data(self, cr, uid, id, default=None, context=None): if not default: default = {} default.update( {'invoice_line_id':False,'invoiced':False}) - return super(mrp_repair_fee, self).copy(cr, uid, id, default, context) + return super(mrp_repair_fee, self).copy_data(cr, uid, id, default, context) def _amount_line(self, cr, uid, ids, field_name, arg, context): res = {} cur_obj=self.pool.get('res.currency') diff --git a/addons/mrp_subproduct/__terp__.py b/addons/mrp_subproduct/__terp__.py index 80181422a55..fe005926185 100644 --- a/addons/mrp_subproduct/__terp__.py +++ b/addons/mrp_subproduct/__terp__.py @@ -41,6 +41,6 @@ With this module: 'demo_xml': [], 'installable': True, 'active': False, - 'certificate': '50060616733', + 'certificate': '0050060616733', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/point_of_sale/__terp__.py b/addons/point_of_sale/__terp__.py index 46e6f519b08..f597c98b0b2 100644 --- a/addons/point_of_sale/__terp__.py +++ b/addons/point_of_sale/__terp__.py @@ -50,6 +50,6 @@ Main features : ], 'demo_xml': [], 'installable': True, - 'certificate': '48272150909', + 'certificate': '0048272150909', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/process/__terp__.py b/addons/process/__terp__.py index b76360ee420..68671b965d1 100644 --- a/addons/process/__terp__.py +++ b/addons/process/__terp__.py @@ -36,6 +36,6 @@ This module allows you to manage your process for the end-users. 'demo_xml': [], 'installable': True, 'active': False, - 'certificate': '55447636669', + 'certificate': '0055447636669', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/process/process.py b/addons/process/process.py index 5f02b67b879..ea350b0bf7e 100644 --- a/addons/process/process.py +++ b/addons/process/process.py @@ -318,14 +318,14 @@ class process_node(osv.osv): 'flow_start': lambda *args: False, } - def copy(self, cr, uid, id, default=None, context={}): + def copy_data(self, cr, uid, id, default=None, context={}): if not default: default = {} default.update({ 'transition_in': [], 'transition_out': [] }) - return super(process_node, self).copy(cr, uid, id, default, context) + return super(process_node, self).copy_data(cr, uid, id, default, context) process_node() @@ -375,7 +375,7 @@ class process_transition_action(osv.osv): 'state': lambda *args: 'dummy', } - def copy(self, cr, uid, id, default=None, context={}): + def copy_data(self, cr, uid, id, default=None, context={}): if not default: default = {} @@ -383,7 +383,7 @@ class process_transition_action(osv.osv): if state: default['state'] = state - return super(process_transition_action, self).copy(cr, uid, id, default, context) + return super(process_transition_action, self).copy_data(cr, uid, id, default, context) process_transition_action() diff --git a/addons/product/__terp__.py b/addons/product/__terp__.py index 568471df253..276696ace37 100644 --- a/addons/product/__terp__.py +++ b/addons/product/__terp__.py @@ -64,6 +64,6 @@ 'demo_xml': ['product_demo.xml'], 'installable': True, 'active': False, - 'certificate': '68861431437', + 'certificate': '0068861431437', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/product/product.py b/addons/product/product.py index cbdb99ccef2..ca23d86b0f1 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -84,7 +84,7 @@ class product_uom(osv.osv): 'factor': fields.float('Rate', digits=(12, 6), required=True, help='The coefficient for the formula:\n' \ '1 (base unit) = coeff (this unit). Rate = 1 / Factor.'), - 'factor_inv': fields.function(_factor, fnct_inv=_factor_inv, digits=(12, 6), + 'factor_inv': fields.function(_factor, digits=(12, 6), method=True, string='Factor', help='The coefficient for the formula:\n' \ 'coeff (base unit) = 1 (this unit). Factor = 1 / Rate.'), diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml index a03c7afcc86..843c71c93a7 100644 --- a/addons/product/product_view.xml +++ b/addons/product/product_view.xml @@ -34,19 +34,25 @@ - + + - + + + + + - - + + + @@ -213,7 +219,7 @@ - + Products ir.actions.act_window product.product form @@ -240,8 +246,8 @@ - - + + @@ -255,8 +261,8 @@ - + diff --git a/addons/product_margin/__terp__.py b/addons/product_margin/__terp__.py index 0096c61abe6..5be94a6bb95 100644 --- a/addons/product_margin/__terp__.py +++ b/addons/product_margin/__terp__.py @@ -36,6 +36,6 @@ the report has several options to help you get the data you need. 'demo_xml': [], 'installable': True, 'active': False, - 'certificate': '64392591773', + 'certificate': '0064392591773', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/profile_accounting/__terp__.py b/addons/profile_accounting/__terp__.py index 73f6f984624..ace96c34b35 100644 --- a/addons/profile_accounting/__terp__.py +++ b/addons/profile_accounting/__terp__.py @@ -32,6 +32,6 @@ 'demo_xml': [], 'installable': True, 'active': False, - 'certificate': '38455352045', + 'certificate': '0038455352045', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/profile_association/__terp__.py b/addons/profile_association/__terp__.py index 7a7efca044b..c4344c51458 100644 --- a/addons/profile_association/__terp__.py +++ b/addons/profile_association/__terp__.py @@ -32,6 +32,6 @@ 'demo_xml': [], 'installable': True, 'active': False, - 'certificate': '78696047261', + 'certificate': '0078696047261', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/profile_auction/__terp__.py b/addons/profile_auction/__terp__.py index 997087a1049..c08dfbf0149 100644 --- a/addons/profile_auction/__terp__.py +++ b/addons/profile_auction/__terp__.py @@ -32,6 +32,6 @@ 'demo_xml': [], 'installable': True, 'active': False, - 'certificate': '65280135565', + 'certificate': '0065280135565', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/profile_crm/__terp__.py b/addons/profile_crm/__terp__.py index bbee7356313..6f0944baff5 100644 --- a/addons/profile_crm/__terp__.py +++ b/addons/profile_crm/__terp__.py @@ -32,6 +32,6 @@ 'demo_xml': [], 'installable': True, 'active': False, - 'certificate': '73301264221', + 'certificate': '0073301264221', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/profile_manufacturing/__terp__.py b/addons/profile_manufacturing/__terp__.py index 167343d05de..7bf367bfed7 100644 --- a/addons/profile_manufacturing/__terp__.py +++ b/addons/profile_manufacturing/__terp__.py @@ -32,6 +32,6 @@ 'demo_xml': [], 'installable': True, 'active': False, - 'certificate': '27737506213', + 'certificate': '0027737506213', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/profile_service/__terp__.py b/addons/profile_service/__terp__.py index 828722a2389..a69f3228b9e 100644 --- a/addons/profile_service/__terp__.py +++ b/addons/profile_service/__terp__.py @@ -32,6 +32,6 @@ 'demo_xml': [], 'installable': True, 'active': False, - 'certificate': '30405502077', + 'certificate': '0030405502077', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/project/__terp__.py b/addons/project/__terp__.py index 01059dc193e..e865e966052 100644 --- a/addons/project/__terp__.py +++ b/addons/project/__terp__.py @@ -45,6 +45,6 @@ works done on tasks, eso. It is able to render planning, order tasks, eso. 'demo_xml': ['project_demo.xml'], 'installable': True, 'active': False, - 'certificate': '75116868317', + 'certificate': '0075116868317', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/project/project.py b/addons/project/project.py index 2c5dcdb2630..fc0fca5d04d 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -248,10 +248,10 @@ class task(osv.osv): # ('remaining_hours', 'CHECK (remaining_hours>=0)', 'Please increase and review remaining hours ! It can not be smaller than 0.'), #] - def copy(self, cr, uid, id, default={},context={}): + def copy_data(self, cr, uid, id, default={},context={}): default = default or {} default['work_ids'] = [] - return super(task, self).copy(cr, uid, id, default, context) + return super(task, self).copy_data(cr, uid, id, default, context) _columns = { 'active': fields.boolean('Active'), diff --git a/addons/project/report/_date_compute.py b/addons/project/report/_date_compute.py index beca7e5a621..85458ee0175 100644 --- a/addons/project/report/_date_compute.py +++ b/addons/project/report/_date_compute.py @@ -59,7 +59,7 @@ def _compute_tasks(cr, uid, task_list, date_begin): # Compute the closing date of the task tasks[task.id] = [] - res = pooler.get_pool(cr.dbname).get('hr.timesheet.group').interval_get(cr, uid, task.project_id.timesheet_id.id, date_start, task.planned_hours) + res = pooler.get_pool(cr.dbname).get('hr.timesheet.group').interval_get(cr, uid, task.project_id.timesheet_id.id, date_start, task.remaining_hours) for (d1,d2) in res: tasks[task.id].append((d1, d2, task.name, task.user_id.login)) date_close = tasks[task.id][-1][1] diff --git a/addons/project_gtd/__terp__.py b/addons/project_gtd/__terp__.py index 272c7e69a12..f68555d35e5 100644 --- a/addons/project_gtd/__terp__.py +++ b/addons/project_gtd/__terp__.py @@ -49,6 +49,6 @@ performing those tasks. 'demo_xml': ['project_gtd_demo.xml'], 'installable': True, 'active': False, - 'certificate': '43525236301', + 'certificate': '0043525236301', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/project_gtd/project_gtd.py b/addons/project_gtd/project_gtd.py index 91754e31b5c..8d855149e3f 100644 --- a/addons/project_gtd/project_gtd.py +++ b/addons/project_gtd/project_gtd.py @@ -159,12 +159,12 @@ class project_task(osv.osv): 'timebox_id': fields.many2one('project.gtd.timebox', "Timebox"), 'context_id': fields.many2one('project.gtd.context', "Context"), } - def copy(self, cr, uid, id, default=None, context=None): + def copy_data(self, cr, uid, id, default=None, context=None): if not default: default = {} default['timebox_id']=False default['context_id']=False - return super(project_task,self).copy(cr, uid, id, default, context) + return super(project_task,self).copy_data(cr, uid, id, default, context) def _get_context(self,cr, uid, ctx): ids = self.pool.get('project.gtd.context').search(cr, uid, [], context=ctx) return ids and ids[0] or False diff --git a/addons/project_mrp/__terp__.py b/addons/project_mrp/__terp__.py index f1da23862e1..784814414cf 100644 --- a/addons/project_mrp/__terp__.py +++ b/addons/project_mrp/__terp__.py @@ -40,6 +40,6 @@ created by sales orders. 'demo_xml': [], 'installable': True, 'active': False, - 'certificate': '31976495453', + 'certificate': '0031976495453', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/project_retro_planning/__terp__.py b/addons/project_retro_planning/__terp__.py index 14cb39754e8..d3a6bd1d9c1 100644 --- a/addons/project_retro_planning/__terp__.py +++ b/addons/project_retro_planning/__terp__.py @@ -34,6 +34,6 @@ 'demo_xml': [], 'installable': True, 'active': False, - 'certificate': '57235475485', + 'certificate': '0057235475485', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/project_timesheet/__terp__.py b/addons/project_timesheet/__terp__.py index d764fc80684..8b86f54382c 100644 --- a/addons/project_timesheet/__terp__.py +++ b/addons/project_timesheet/__terp__.py @@ -38,6 +38,6 @@ 'demo_xml': [], 'installable': True, 'active': False, - 'certificate': '75123647453', + 'certificate': '0075123647453', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/purchase/__terp__.py b/addons/purchase/__terp__.py index f66c1d75dbe..88b92b4f853 100644 --- a/addons/purchase/__terp__.py +++ b/addons/purchase/__terp__.py @@ -47,6 +47,6 @@ 'demo_xml': ['purchase_demo.xml'], 'installable': True, 'active': False, - 'certificate': '57234283549', + 'certificate': '0057234283549', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 84d8d086405..63051813ec0 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -442,11 +442,11 @@ class purchase_order_line(osv.osv): _table = 'purchase_order_line' _name = 'purchase.order.line' _description = 'Purchase Order lines' - def copy(self, cr, uid, id, default=None,context={}): + def copy_data(self, cr, uid, id, default=None,context={}): if not default: default = {} default.update({'state':'draft', 'move_id':False}) - return super(purchase_order_line, self).copy(cr, uid, id, default, context) + return super(purchase_order_line, self).copy_data(cr, uid, id, default, context) def product_id_change(self, cr, uid, ids, pricelist, product, qty, uom, partner_id, date_order=False, fiscal_position=False): diff --git a/addons/purchase_analytic_plans/__terp__.py b/addons/purchase_analytic_plans/__terp__.py index c639aa1eb66..ddb2063e89e 100644 --- a/addons/purchase_analytic_plans/__terp__.py +++ b/addons/purchase_analytic_plans/__terp__.py @@ -36,6 +36,6 @@ 'demo_xml': [], 'installable': True, 'active': False, - 'certificate': '62176518909', + 'certificate': '0062176518909', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/report_account/__terp__.py b/addons/report_account/__terp__.py index 2b568ce08b0..af3c7a0726c 100644 --- a/addons/report_account/__terp__.py +++ b/addons/report_account/__terp__.py @@ -34,6 +34,6 @@ 'demo_xml': [], 'installable': True, 'active': False, - 'certificate': '61754222813', + 'certificate': '0061754222813', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/report_analytic/__terp__.py b/addons/report_analytic/__terp__.py index 0d072fcf1ef..5827f019e3b 100644 --- a/addons/report_analytic/__terp__.py +++ b/addons/report_analytic/__terp__.py @@ -34,6 +34,6 @@ 'demo_xml': [], 'installable': True, 'active': False, - 'certificate': '59950675429', + 'certificate': '0059950675429', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/report_analytic_line/__terp__.py b/addons/report_analytic_line/__terp__.py index 905eca096eb..b9c97e2a7d3 100644 --- a/addons/report_analytic_line/__terp__.py +++ b/addons/report_analytic_line/__terp__.py @@ -34,6 +34,6 @@ 'demo_xml': [], 'installable': True, 'active': False, - 'certificate': '75179053853', + 'certificate': '0075179053853', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/report_analytic_planning/__terp__.py b/addons/report_analytic_planning/__terp__.py index 73a71fc0bca..53cc8548e16 100644 --- a/addons/report_analytic_planning/__terp__.py +++ b/addons/report_analytic_planning/__terp__.py @@ -38,6 +38,6 @@ 'demo_xml': ['report_account_analytic.planning.csv'], 'installable': True, 'active': False, - 'certificate': '34901836973', + 'certificate': '0034901836973', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/report_crm/__terp__.py b/addons/report_crm/__terp__.py index 35ea350abf8..4023b1c331e 100644 --- a/addons/report_crm/__terp__.py +++ b/addons/report_crm/__terp__.py @@ -35,6 +35,6 @@ 'demo_xml': [], 'installable': True, 'active': False, - 'certificate': '30422968285', + 'certificate': '0030422968285', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/report_document/__terp__.py b/addons/report_document/__terp__.py index d6ae3bccef3..5b4e7e7d86f 100644 --- a/addons/report_document/__terp__.py +++ b/addons/report_document/__terp__.py @@ -37,6 +37,6 @@ 'demo_xml': [], 'installable': True, 'active': False, - 'certificate': '68012774557', + 'certificate': '0068012774557', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/report_intrastat/__terp__.py b/addons/report_intrastat/__terp__.py index f23feae9786..aa4f4f33c20 100644 --- a/addons/report_intrastat/__terp__.py +++ b/addons/report_intrastat/__terp__.py @@ -38,6 +38,6 @@ 'demo_xml': [], 'installable': True, 'active': False, - 'certificate': '56982189085', + 'certificate': '0056982189085', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/report_mrp/__terp__.py b/addons/report_mrp/__terp__.py index 4e75a21e41d..3b60a05e3cc 100644 --- a/addons/report_mrp/__terp__.py +++ b/addons/report_mrp/__terp__.py @@ -34,6 +34,6 @@ 'update_xml': ['security/ir.model.access.csv', 'report_mrp_view.xml'], 'demo_xml': [], 'installable': True, - 'certificate': '71582896029', + 'certificate': '0071582896029', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/report_project/__terp__.py b/addons/report_project/__terp__.py index c88f64c45e2..b0ca49e7724 100644 --- a/addons/report_project/__terp__.py +++ b/addons/report_project/__terp__.py @@ -35,6 +35,6 @@ 'demo_xml': [], 'installable': True, 'active': False, - 'certificate': '86804423149', + 'certificate': '0086804423149', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/report_purchase/__terp__.py b/addons/report_purchase/__terp__.py index 5cc72c7de17..8a578ab6b2d 100644 --- a/addons/report_purchase/__terp__.py +++ b/addons/report_purchase/__terp__.py @@ -35,6 +35,6 @@ 'demo_xml': [], 'installable': True, 'active': False, - 'certificate': '73370750365', + 'certificate': '0073370750365', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/report_sale/__terp__.py b/addons/report_sale/__terp__.py index 6f8f4408c49..dc9c29b71f8 100644 --- a/addons/report_sale/__terp__.py +++ b/addons/report_sale/__terp__.py @@ -48,6 +48,6 @@ 'demo_xml': [], 'installable': True, 'active': False, - 'certificate': '59949739573', + 'certificate': '0059949739573', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/report_task/__terp__.py b/addons/report_task/__terp__.py index 4784e0d6c87..2554f26ae85 100644 --- a/addons/report_task/__terp__.py +++ b/addons/report_task/__terp__.py @@ -32,6 +32,6 @@ 'update_xml': ['security/ir.model.access.csv', 'report_task_view.xml'], 'installable': True, 'active': False, - 'certificate': '27671328157', + 'certificate': '0027671328157', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/report_timesheet/__terp__.py b/addons/report_timesheet/__terp__.py index bdf3189755f..fc993c31311 100644 --- a/addons/report_timesheet/__terp__.py +++ b/addons/report_timesheet/__terp__.py @@ -35,6 +35,6 @@ 'demo_xml': [], 'installable': True, 'active': False, - 'certificate': '78701510301', + 'certificate': '0078701510301', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/sale/__terp__.py b/addons/sale/__terp__.py index 3f1a147e541..e9fb423c7fc 100644 --- a/addons/sale/__terp__.py +++ b/addons/sale/__terp__.py @@ -62,6 +62,6 @@ 'demo_xml': ['sale_demo.xml'], 'installable': True, 'active': False, - 'certificate': '58103601429', + 'certificate': '0058103601429', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 6a89a14cda3..210126fe15f 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -672,11 +672,6 @@ sale_order() # - update it on change product and unit price # - use it in report if there is a uos class sale_order_line(osv.osv): - def copy(self, cr, uid, id, default=None, context={}): - if not default: default = {} - default.update( {'invoice_lines':[]}) - return super(sale_order_line, self).copy(cr, uid, id, default, context) - def _amount_line_net(self, cr, uid, ids, field_name, arg, context): res = {} for line in self.browse(cr, uid, ids): @@ -808,7 +803,7 @@ class sale_order_line(osv.osv): def button_cancel(self, cr, uid, ids, context={}): for line in self.browse(cr, uid, ids, context=context): if line.invoiced: - raise osv.except_osv(_('Invalid action !'), _('You can not cancel a sale order line that has already been invoiced !')) + raise osv.except_osv(_('Invalid action !'), _('You cannot cancel a sale order line that has already been invoiced !')) return self.write(cr, uid, ids, {'state':'cancel'}) def button_confirm(self, cr, uid, ids, context={}): @@ -842,17 +837,17 @@ class sale_order_line(osv.osv): pass return {'value' : value} - def copy(self, cr, uid, id, default=None,context={}): + def copy_data(self, cr, uid, id, default=None,context={}): if not default: default = {} default.update({'state':'draft', 'move_ids':[], 'invoiced':False, 'invoice_lines':[]}) - return super(sale_order_line, self).copy(cr, uid, id, default, context) + return super(sale_order_line, self).copy_data(cr, uid, id, default, context) def product_id_change(self, cr, uid, ids, pricelist, product, qty=0, uom=False, qty_uos=0, uos=False, name='', partner_id=False, lang=False, update_tax=True, date_order=False, packaging=False, fiscal_position=False): if not partner_id: - raise osv.except_osv(_('No Partner !'), _('You have to select a partner in the sale form !\nPlease set one partner before choosing a product.')) + raise osv.except_osv(_('No Customer Defined !'), _('You have to select a customer in the sale form !\nPlease set one customer before choosing a product.')) warning={} product_uom_obj = self.pool.get('product.uom') partner_obj = self.pool.get('res.partner') @@ -916,7 +911,7 @@ class sale_order_line(osv.osv): result['name'] = product_obj.partner_ref domain = {} - if not uom and not uos: + if (not uom) and (not uos): result['product_uom'] = product_obj.uom_id.id if product_obj.uos_id: result['product_uos'] = product_obj.uos_id.id @@ -931,21 +926,21 @@ class sale_order_line(osv.osv): [('category_id', '=', product_obj.uom_id.category_id.id)], 'product_uos': [('category_id', '=', uos_category_id)]} + + elif uos: # only happens if uom is False + result['product_uom'] = product_obj.uom_id and product_obj.uom_id.id + result['product_uom_qty'] = qty_uos / product_obj.uos_coeff + result['th_weight'] = result['product_uom_qty'] * product_obj.weight elif uom: # whether uos is set or not default_uom = product_obj.uom_id and product_obj.uom_id.id q = product_uom_obj._compute_qty(cr, uid, uom, qty, default_uom) if product_obj.uos_id: result['product_uos'] = product_obj.uos_id.id - result['product_uos_qty'] = q * product_obj.uos_coeff + result['product_uos_qty'] = qty * product_obj.uos_coeff else: result['product_uos'] = False - result['product_uos_qty'] = q - result['th_weight'] = q * product_obj.weight - elif uos: # only happens if uom is False - result['product_uom'] = product_obj.uom_id and product_obj.uom_id.id - result['product_uom_qty'] = qty_uos / product_obj.uos_coeff - result['th_weight'] = result['product_uom_qty'] * product_obj.weight - # Round the quantity up + result['product_uos_qty'] = qty + result['th_weight'] = q * product_obj.weight # Round the quantity up # get unit price diff --git a/addons/sale/stock.py b/addons/sale/stock.py index bcf1a4592ee..d66db3fb9ef 100644 --- a/addons/sale/stock.py +++ b/addons/sale/stock.py @@ -72,7 +72,7 @@ class stock_picking(osv.osv): picking) def _get_price_unit_invoice(self, cursor, user, move_line, type): - if move_line.sale_line_id: + if move_line.sale_line_id and move_line.sale_line_id.product_id.id == move_line.product_id.id: return move_line.sale_line_id.price_unit return super(stock_picking, self)._get_price_unit_invoice(cursor, user, move_line, type) @@ -84,7 +84,7 @@ class stock_picking(osv.osv): move_line) def _get_taxes_invoice(self, cursor, user, move_line, type): - if move_line.sale_line_id: + if move_line.sale_line_id and move_line.sale_line_id.product_id.id == move_line.product_id.id: return [x.id for x in move_line.sale_line_id.tax_id] return super(stock_picking, self)._get_taxes_invoice(cursor, user, move_line, type) @@ -163,7 +163,7 @@ class stock_picking(osv.osv): account_analytic_id = self._get_account_analytic_invoice(cursor, user, picking, sale_line) - account_id = self.pool.get('account.fiscal.position').map_account(cursor, user, picking.sale_id.partner_id, account_id) + account_id = self.pool.get('account.fiscal.position').map_account(cursor, user, picking.sale_id.partner_id.property_account_position, account_id) invoice = invoices[result[picking.id]] invoice_line_id = invoice_line_obj.create(cursor, user, { 'name': name, diff --git a/addons/sale_analytic_plans/__terp__.py b/addons/sale_analytic_plans/__terp__.py index 09583f59f11..6e3dcc13120 100644 --- a/addons/sale_analytic_plans/__terp__.py +++ b/addons/sale_analytic_plans/__terp__.py @@ -36,6 +36,6 @@ 'demo_xml': [], 'installable': True, 'active': False, - 'certificate': '66055860861', + 'certificate': '0066055860861', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/sale_crm/__terp__.py b/addons/sale_crm/__terp__.py index e950030db95..a3d44af6e4b 100644 --- a/addons/sale_crm/__terp__.py +++ b/addons/sale_crm/__terp__.py @@ -46,6 +46,6 @@ crm_configuration modules. 'demo_xml': [], 'installable': True, 'active': False, - 'certificate': '64360130141', + 'certificate': '0064360130141', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/sale_delivery_report/__terp__.py b/addons/sale_delivery_report/__terp__.py index 32084e730eb..63feb917531 100644 --- a/addons/sale_delivery_report/__terp__.py +++ b/addons/sale_delivery_report/__terp__.py @@ -35,6 +35,6 @@ 'demo_xml': [], 'installable': True, 'active': False, - 'certificate': '803459507494914221', + 'certificate': '00803459507494914221', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/sale_journal/__terp__.py b/addons/sale_journal/__terp__.py index b03479be8b8..9f65ca73bc2 100644 --- a/addons/sale_journal/__terp__.py +++ b/addons/sale_journal/__terp__.py @@ -61,6 +61,6 @@ 'demo_xml': ['sale_journal_demo.xml'], 'installable': True, 'active': False, - 'certificate': '77661619085', + 'certificate': '0077661619085', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/scrum/__terp__.py b/addons/scrum/__terp__.py index 3915aa5e57a..c66d5da2315 100644 --- a/addons/scrum/__terp__.py +++ b/addons/scrum/__terp__.py @@ -60,6 +60,6 @@ 'demo_xml': ['scrum_demo.xml'], 'installable': True, 'active': False, - 'certificate': '84121063261', + 'certificate': '0084121063261', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/stock/__terp__.py b/addons/stock/__terp__.py index fff0e892b82..8fadaa1f360 100644 --- a/addons/stock/__terp__.py +++ b/addons/stock/__terp__.py @@ -59,6 +59,6 @@ Thanks to the double entry management, the inventory controlling is powerful and 'demo_xml': ['stock_demo.xml'], 'installable': True, 'active': False, - 'certificate': '55421559965', + 'certificate': '0055421559965', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/stock/report/picking.rml b/addons/stock/report/picking.rml index ab384a5ef08..d9e50d2b5ba 100644 --- a/addons/stock/report/picking.rml +++ b/addons/stock/report/picking.rml @@ -135,9 +135,9 @@ [[ (picking.address_id and picking.address_id.partner_id and picking.address_id.partner_id.title) or '' ]] [[ picking.address_id and picking.address_id.partner_id and picking.address_id.partner_id.name ]] - [[ (picking.sale_id and picking.sale_id.partner_shipping_id and picking.sale_id.partner_shipping_id.title) or '' ]] [[ (picking.sale_id and picking.sale_id.partner_shipping_id and picking.sale_id.partner_shipping_id.name) or '' ]] - [[ (picking.sale_id and picking.sale_id.partner_shipping_id and picking.sale_id.partner_shipping_id.street) or '' ]] - [[ (picking.sale_id and picking.sale_id.partner_shipping_id and picking.sale_id.partner_shipping_id.zip) or '' ]] [[ (picking.sale_id and picking.sale_id.partner_shipping_id and picking.sale_id.partner_shipping_id.city) or '' ]] [[ (picking.address_id and picking.address_id.state_id and picking.address_id.state_id.name) or '' ]] + [[ (picking.address_id and picking.address_id.title) or '' ]] [[ (picking.address_id and picking.address_id.name) or '' ]] + [[ (picking.address_id and picking.address_id.street) or '' ]] + [[ (picking.address_id and picking.address_id.zip) or '' ]] [[ (picking.address_id and picking.address_id.city) or '' ]] [[ (picking.address_id and picking.address_id.state_id and picking.address_id.state_id.name) or '' ]] [[ (picking.address_id and picking.address_id.country_id and picking.address_id.country_id.name) or '' ]] @@ -176,7 +176,7 @@ Expected Shipping Date - weight + @@ -186,13 +186,13 @@ [[ picking.origin ]] - [[ (picking.sale_id and picking.sale_id.partner_shipping_id and picking.sale_id.partner_shipping_id and picking.sale_id.partner_shipping_id.title) or '' ]] [[ (picking.sale_id and picking.sale_id.partner_shipping_id and picking.sale_id.partner_shipping_id.name) or '' ]] + [[ (picking.address_id and picking.address_id.title) or '' ]] [[ (picking.address_id and picking.address_id.name) or '' ]] [[ formatLang(picking.min_date,date_time = True) ]] - [[ picking.weight or '']] + diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 2208860a71a..92fa50dbd0b 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -397,7 +397,7 @@ class stock_picking(osv.osv): _columns = { - 'name': fields.char('Reference', size=64, required=True, select=True), + 'name': fields.char('Reference', size=64, select=True), 'origin': fields.char('Origin Reference', size=64), 'backorder_id': fields.many2one('stock.picking', 'Back Order'), 'type': fields.selection([('out','Sending Goods'),('in','Getting Goods'),('internal','Internal'),('delivery','Delivery')], 'Shipping Type', required=True, select=True), @@ -440,12 +440,14 @@ class stock_picking(osv.osv): 'invoice_state': lambda *a: 'none', 'date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'), } - #def copy(self, cr, uid, id, data=None, context={}): - # data = data or {} - # return super(stock_picking, self).copy(cr, uid, id, data, context) + def copy(self, cr, uid, id, default=None, context={}): + if default is None: + default = {} + default = default.copy() + default['name'] = False + return super(stock_picking, self).copy(cr, uid, id, default, context) def onchange_partner_in(self, cr, uid, context, partner_id=None): - sid = self.pool.get('res.partner.address').browse(cr, uid, partner_id, context).partner_id.property_stock_supplier.id return { } def action_explode(self, cr, uid, moves, context={}): @@ -1178,6 +1180,9 @@ class stock_move(osv.osv): amount = move.product_qty * move.product_id.standard_price date = time.strftime('%Y-%m-%d') + partner_id = False + if move.picking_id: + partner_id = move.picking_id.address_id and (move.picking_id.address_id.partner_id and move.picking_id.address_id.partner_id.id or False) or False lines = [ (0, 0, { 'name': move.name, @@ -1185,14 +1190,16 @@ class stock_move(osv.osv): 'credit': amount, 'account_id': acc_src, 'ref': ref, - 'date': date}), + 'date': date, + 'partner_id': partner_id}), (0, 0, { 'name': move.name, 'quantity': move.product_qty, 'debit': amount, 'account_id': acc_dest, 'ref': ref, - 'date': date}) + 'date': date, + 'partner_id': partner_id}) ] self.pool.get('account.move').create(cr, uid, { 'name': move.name, diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index 52a3e091c5e..c0c465af5ef 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -740,7 +740,7 @@ - Futur Delivery Orders + Future Delivery Orders stock.picking ir.actions.act_window form @@ -1205,6 +1205,7 @@ + diff --git a/addons/stock/wizard/inventory_merge_zero.py b/addons/stock/wizard/inventory_merge_zero.py index a9f80be2b17..1b0527ad142 100644 --- a/addons/stock/wizard/inventory_merge_zero.py +++ b/addons/stock/wizard/inventory_merge_zero.py @@ -38,6 +38,7 @@ _inventory_fields = { 'string':'Location', 'type':'many2one', 'relation':'stock.location', + 'required':True } } @@ -51,34 +52,22 @@ def do_merge(self, cr, uid, data, context): raise wizard.except_wizard("Warning", "Please select one and only one inventory !") - cr.execute('select distinct location_id from stock_inventory_line where inventory_id=%s', (data['ids'][0],)) - loc_ids = map(lambda x: x[0], cr.fetchall()) - if data['form']['location_id']: - loc_ids.append(data['form']['location_id']) - locs = ','.join(map(lambda x: str(x), loc_ids)) + loc = str(data['form']['location_id']) cr.execute('select distinct location_id,product_id from stock_inventory_line where inventory_id=%s', (data['ids'][0],)) inv = cr.fetchall() - if not locs: - raise wizard.except_wizard("Warning", - "Please select at least one inventory location !") -# if not inv: -# raise wizard.except_wizard("Warning", -# "Please select at least one inventory location !") - else: - cr.execute('select distinct product_id from stock_move where (location_dest_id in ('+locs+')) or (location_id in ('+locs+'))') - stock = cr.fetchall() - for s in stock: - for loc in loc_ids: - if (loc,s[0]) not in inv: - p = prod_obj.browse(cr, uid, s[0]) - invent_line_obj.create(cr, uid, { - 'inventory_id': data['ids'][0], - 'location_id': loc, - 'product_id': s[0], - 'product_uom': p.uom_id.id, - 'product_qty': 0.0, - }) + cr.execute('select distinct product_id from stock_move where (location_dest_id='+loc+') or (location_id='+loc+')') + stock = cr.fetchall() + for s in stock: + if (loc,s[0]) not in inv: + p = prod_obj.browse(cr, uid, s[0]) + invent_line_obj.create(cr, uid, { + 'inventory_id': data['ids'][0], + 'location_id': loc, + 'product_id': s[0], + 'product_uom': p.uom_id.id, + 'product_qty': 0.0, + }) return {} diff --git a/addons/stock_invoice_directly/__terp__.py b/addons/stock_invoice_directly/__terp__.py index e89b1b2d56d..1f76f651c01 100644 --- a/addons/stock_invoice_directly/__terp__.py +++ b/addons/stock_invoice_directly/__terp__.py @@ -37,6 +37,6 @@ 'demo_xml': [], 'installable': True, 'active': False, - 'certificate': '81385081261', + 'certificate': '0081385081261', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/stock_location/__terp__.py b/addons/stock_location/__terp__.py index 42b9f52eeb0..f6a7803ea71 100644 --- a/addons/stock_location/__terp__.py +++ b/addons/stock_location/__terp__.py @@ -44,6 +44,6 @@ This module may be useful for different purposes: 'demo_xml': [], 'installable': True, 'active': False, - 'certificate': '46505115101', + 'certificate': '0046505115101', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/stock_no_autopicking/__terp__.py b/addons/stock_no_autopicking/__terp__.py index 31a01a2ae93..c6661258f1b 100644 --- a/addons/stock_no_autopicking/__terp__.py +++ b/addons/stock_no_autopicking/__terp__.py @@ -40,6 +40,6 @@ 'demo_xml': [], 'installable': True, 'active': False, - 'certificate': '75124168925', + 'certificate': '0075124168925', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/subscription/__terp__.py b/addons/subscription/__terp__.py index 97e2f7cef54..4e2ec06fe45 100644 --- a/addons/subscription/__terp__.py +++ b/addons/subscription/__terp__.py @@ -33,6 +33,6 @@ 'demo_xml': [], 'installable': True, 'active': False, - 'certificate': '29454782573', + 'certificate': '0029454782573', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/warning/__terp__.py b/addons/warning/__terp__.py index 09c6cdc854e..342ddfd21c2 100644 --- a/addons/warning/__terp__.py +++ b/addons/warning/__terp__.py @@ -32,6 +32,6 @@ 'demo_xml': [], 'installable': True, 'active': False, - 'certificate': '80334018749', + 'certificate': '0080334018749', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/wiki/__terp__.py b/addons/wiki/__terp__.py index 6ed97909ded..1a1844c861f 100644 --- a/addons/wiki/__terp__.py +++ b/addons/wiki/__terp__.py @@ -23,6 +23,6 @@ 'demo_xml': ['data/wiki_faq.xml'], 'installable': True, 'active': False, - 'certificate': '86363630317', + 'certificate': '0086363630317', } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/wiki/wiki.py b/addons/wiki/wiki.py index 15677c56367..8bcf87aa63a 100644 --- a/addons/wiki/wiki.py +++ b/addons/wiki/wiki.py @@ -102,8 +102,8 @@ class Wiki(osv.osv): 'section': section } } - def copy(self, cr, uid, id, default=None, context=None): - return super(Wiki, self).copy(cr, uid, id, {'wiki_id':False}, context) + def copy_data(self, cr, uid, id, default=None, context=None): + return super(Wiki, self).copy_data(cr, uid, id, {'wiki_id':False}, context) def write(self, cr, uid, ids, vals, context=None): result = super(Wiki,self).write(cr, uid, ids, vals, context)