From 78a931f7cf2f069e43e219903f1316993e30d631 Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Fri, 4 Dec 2015 00:06:10 +0100 Subject: [PATCH 02/17] Remove already applied patches and update to latest version --- account_42b9acc4c201.patch | 389 -------------------- account_asset_78bda42be464.patch | 79 ---- account_invoice_51e5f7fb547b.patch | 289 --------------- account_payment_5dd8c0c2a04c.patch | 44 --- account_payment_sepa_f69c5ffa5f79.patch | 42 --- account_statement_2642b961c2bf.patch | 50 --- client-open_url.diff | 21 -- invoice_speedup.diff | 150 +++----- issue10061002_1.diff | 84 ----- issue10071002_1.diff | 35 -- issue10391004_1.diff | 5 +- issue13211002_190001.diff | 315 ---------------- issue14841002_1.diff | 82 ----- issue17281002_20001.diff | 89 ----- issue18361002_40001.diff | 65 ---- issue19281002_1.diff | 24 -- issue19491002_1.diff | 15 +- issue20301003_1.diff | 23 -- issue20451002_1.diff | 21 +- issue240_631.diff | 389 +++++++++----------- issue24271002_1.diff | 22 -- issue306_799.diff | 217 ----------- issue4115.diff | 124 ------- issue4766.diff | 38 -- issue4950_sale.diff | 10 +- issue4950_stock.diff | 17 +- issue4986.diff | 30 +- issue5731002_1.diff | 16 - issue5881002_1.diff | 23 -- issue6021003_1.diff | 20 +- issue6341003_1.diff | 8 +- issue6951002_20001.diff | 42 --- issue7881002_1.diff | 31 -- issue7961002_40001.diff | 34 -- issue9801002_40001.diff | 85 ----- issue9911002_80001.diff | 81 ---- party_after_account.diff | 39 -- party_c1cc3484518d.patch | 34 -- production_b50beae497b9.patch | 42 --- purchase_5b0d2d2727a6.patch | 24 -- purchase_translation.diff | 21 -- sale_23d0b5a3ceb1.patch | 24 -- sale_fix_invoiced_quantity_calculation.diff | 17 - series | 39 -- stock_lot_expand_lot_required.diff | 12 - stock_supply_780a8aaeaa78.patch | 23 -- timesheet_f8c45f1b4d7d.patch | 161 -------- 47 files changed, 299 insertions(+), 3146 deletions(-) delete mode 100644 account_42b9acc4c201.patch delete mode 100644 account_asset_78bda42be464.patch delete mode 100644 account_invoice_51e5f7fb547b.patch delete mode 100644 account_payment_5dd8c0c2a04c.patch delete mode 100644 account_payment_sepa_f69c5ffa5f79.patch delete mode 100644 account_statement_2642b961c2bf.patch delete mode 100644 client-open_url.diff delete mode 100644 issue10061002_1.diff delete mode 100644 issue10071002_1.diff delete mode 100644 issue13211002_190001.diff delete mode 100644 issue14841002_1.diff delete mode 100644 issue17281002_20001.diff delete mode 100644 issue18361002_40001.diff delete mode 100644 issue19281002_1.diff delete mode 100644 issue20301003_1.diff delete mode 100644 issue24271002_1.diff delete mode 100644 issue306_799.diff delete mode 100644 issue4115.diff delete mode 100644 issue4766.diff delete mode 100644 issue5731002_1.diff delete mode 100644 issue5881002_1.diff delete mode 100644 issue6951002_20001.diff delete mode 100644 issue7881002_1.diff delete mode 100644 issue7961002_40001.diff delete mode 100644 issue9801002_40001.diff delete mode 100644 issue9911002_80001.diff delete mode 100644 party_after_account.diff delete mode 100644 party_c1cc3484518d.patch delete mode 100644 production_b50beae497b9.patch delete mode 100644 purchase_5b0d2d2727a6.patch delete mode 100644 purchase_translation.diff delete mode 100644 sale_23d0b5a3ceb1.patch delete mode 100644 sale_fix_invoiced_quantity_calculation.diff delete mode 100644 stock_lot_expand_lot_required.diff delete mode 100644 stock_supply_780a8aaeaa78.patch delete mode 100644 timesheet_f8c45f1b4d7d.patch diff --git a/account_42b9acc4c201.patch b/account_42b9acc4c201.patch deleted file mode 100644 index a2b8da2..0000000 --- a/account_42b9acc4c201.patch +++ /dev/null @@ -1,389 +0,0 @@ -# exporting patch: -# HG changeset patch -# User Cédric Krier -# Date 1417619588 -3600 -# Wed Dec 03 16:13:08 2014 +0100 -# Node ID 42b9acc4c201b883197c3ebc8385f6e1072cd076 -# Parent d57626d6cf3e20cd28861a1d5c37cc7c064bd21c -# Add missing company domain/field - -# issue4311 -# review7691002 - -diff -r d57626d6cf3e -r 42b9acc4c201 fiscalyear.py ---- .a/trytond/trytond/modules/account/fiscalyear.py Tue Dec 02 12:54:29 2014 +0100 -+++ .b/trytond/trytond/modules/account/fiscalyear.py Wed Dec 03 16:13:08 2014 +0100 -@@ -326,6 +326,8 @@ - __name__ = 'account.fiscalyear.balance_non_deferral.start' - fiscalyear = fields.Many2One('account.fiscalyear', 'Fiscal Year', - required=True, domain=[('state', '=', 'open')]) -+ company = fields.Function(fields.Many2One('company.company', 'Company'), -+ 'on_change_with_company') - journal = fields.Many2One('account.journal', 'Journal', required=True, - domain=[ - ('type', '=', 'situation'), -@@ -340,16 +342,23 @@ - required=True, - domain=[ - ('kind', '!=', 'view'), -- ('company', '=', Eval('context', {}).get('company', -1)), -+ ('company', '=', Eval('company', -1)), - ('deferral', '=', True), -- ]) -+ ], -+ depends=['company']) - debit_account = fields.Many2One('account.account', 'Debit Account', - required=True, - domain=[ - ('kind', '!=', 'view'), -- ('company', '=', Eval('context', {}).get('company', -1)), -+ ('company', '=', Eval('company', -1)), - ('deferral', '=', True), -- ]) -+ ], -+ depends=['company']) -+ -+ @fields.depends('fiscalyear') -+ def on_change_with_company(self, name=None): -+ if self.fiscalyear: -+ return self.fiscalyear.company.id - - - class BalanceNonDeferral(Wizard): -diff -r d57626d6cf3e -r 42b9acc4c201 move.py ---- .a/trytond/trytond/modules/account/move.py Tue Dec 02 12:54:29 2014 +0100 -+++ .b/trytond/trytond/modules/account/move.py Wed Dec 03 16:13:08 2014 +0100 -@@ -49,8 +49,12 @@ - number = fields.Char('Number', required=True, readonly=True) - post_number = fields.Char('Post Number', readonly=True, - help='Also known as Folio Number') -+ company = fields.Many2One('company.company', 'Company', required=True) - period = fields.Many2One('account.period', 'Period', required=True, -- states=_MOVE_STATES, depends=_MOVE_DEPENDS, select=True) -+ domain=[ -+ ('company', '=', Eval('company', -1)), -+ ], -+ states=_MOVE_STATES, depends=_MOVE_DEPENDS + ['company'], select=True) - journal = fields.Many2One('account.journal', 'Journal', required=True, - states=_MOVE_STATES, depends=_MOVE_DEPENDS) - date = fields.Date('Effective Date', required=True, states=_MOVE_STATES, -@@ -65,7 +69,10 @@ - ('posted', 'Posted'), - ], 'State', required=True, readonly=True, select=True) - lines = fields.One2Many('account.move.line', 'move', 'Lines', -- states=_MOVE_STATES, depends=_MOVE_DEPENDS, -+ domain=[ -+ ('account.company', '=', Eval('company', -1)), -+ ], -+ states=_MOVE_STATES, depends=_MOVE_DEPENDS + ['company'], - context={ - 'journal': Eval('journal'), - 'period': Eval('period'), -@@ -87,8 +94,6 @@ - '"%(move)s" to draft in journal "%(journal)s".'), - 'modify_posted_move': ('You can not modify move "%s" because ' - 'it is already posted.'), -- 'company_in_move': ('You can not create lines on accounts' -- 'of different companies in move "%s".'), - 'date_outside_period': ('You can not create move "%(move)s" ' - 'because it\'s date is outside its period.'), - 'draft_closed_period': ('You can not set to draft move ' -@@ -111,6 +116,12 @@ - TableHandler = backend.get('TableHandler') - cursor = Transaction().cursor - table = TableHandler(cursor, cls, module_name) -+ sql_table = cls.__table__() -+ pool = Pool() -+ Period = pool.get('account.period') -+ period = Period.__table__() -+ FiscalYear = pool.get('account.fiscalyear') -+ fiscalyear = FiscalYear.__table__() - - # Migration from 2.4: - # - name renamed into number -@@ -120,8 +131,19 @@ - if table.column_exist('reference'): - table.column_rename('reference', 'post_number') - -+ created_company = not table.column_exist('company') -+ - super(Move, cls).__register__(module_name) - -+ # Migration from 3.4: new company field -+ if created_company: -+ # Don't use UPDATE FROM because SQLite nor MySQL support it. -+ value = period.join(fiscalyear, -+ condition=period.fiscalyear == fiscalyear.id).select( -+ fiscalyear.company, -+ where=period.id == sql_table.period) -+ cursor.execute(*sql_table.update([sql_table.company], [value])) -+ - table = TableHandler(cursor, cls, module_name) - table.index_action(['journal', 'period'], 'add') - -@@ -129,6 +151,10 @@ - table.index_action('create_date', action='add') - - @staticmethod -+ def default_company(): -+ return Transaction().context.get('company') -+ -+ @staticmethod - def default_period(): - Period = Pool().get('account.period') - return Period.find(Transaction().context.get('company'), -@@ -181,17 +207,8 @@ - def validate(cls, moves): - super(Move, cls).validate(moves) - for move in moves: -- move.check_company() - move.check_date() - -- def check_company(self): -- company_id = -1 -- for line in self.lines: -- if company_id < 0: -- company_id = line.account.company.id -- if line.account.company.id != company_id: -- self.raise_user_error('company_in_move', (self.rec_name,)) -- - def check_date(self): - if (self.date < self.period.start_date - or self.date > self.period.end_date): -@@ -285,17 +302,10 @@ - ''' - pool = Pool() - MoveLine = pool.get('account.move.line') -- User = pool.get('res.user') - line = MoveLine.__table__() - - cursor = Transaction().cursor - -- if (Transaction().user == 0 -- and Transaction().context.get('user')): -- user = Transaction().context.get('user') -- else: -- user = Transaction().user -- company = User(user).company - amounts = {} - move2draft_lines = {} - for sub_move_ids in grouped_slice([m.id for m in moves]): -@@ -326,7 +326,7 @@ - if not isinstance(amount, Decimal): - amount = Decimal(amount) - draft_lines = MoveLine.browse(move2draft_lines.get(move.id, [])) -- if not company.currency.is_zero(amount): -+ if not move.company.currency.is_zero(amount): - draft_moves.append(move.id) - continue - if not draft_lines: -@@ -1147,6 +1157,7 @@ - fiscalyears = FiscalYear.search([ - ('start_date', '<=', Transaction().context['date']), - ('end_date', '>=', Transaction().context['date']), -+ ('company', '=', Transaction().context.get('company')), - ], limit=1) - - fiscalyear_id = fiscalyears and fiscalyears[0].id or 0 -@@ -1193,6 +1204,7 @@ - if not Transaction().context.get('fiscalyear'): - fiscalyears = FiscalYear.search([ - ('state', '=', 'open'), -+ ('company', '=', Transaction().context.get('company')), - ]) - fiscalyear_ids = [f.id for f in fiscalyears] or [0] - else: -diff -r d57626d6cf3e -r 42b9acc4c201 period.py ---- .a/trytond/trytond/modules/account/period.py Tue Dec 02 12:54:29 2014 +0100 -+++ .b/trytond/trytond/modules/account/period.py Wed Dec 03 16:13:08 2014 +0100 -@@ -34,7 +34,14 @@ - ('close', 'Close'), - ], 'State', readonly=True, required=True) - post_move_sequence = fields.Many2One('ir.sequence', 'Post Move Sequence', -- domain=[('code', '=', 'account.move')], -+ domain=[ -+ ('code', '=', 'account.move'), -+ ['OR', -+ ('company', '=', None), -+ ('company', '=', Eval('company', -1)), -+ ], -+ ], -+ depends=['company'], - context={'code': 'account.move'}) - type = fields.Selection([ - ('standard', 'Standard'), -@@ -42,7 +49,7 @@ - ], 'Type', required=True, - states=_STATES, depends=_DEPENDS, select=True) - company = fields.Function(fields.Many2One('company.company', 'Company',), -- 'get_company', searcher='search_company') -+ 'on_change_with_company', searcher='search_company') - - @classmethod - def __register__(cls, module_name): -@@ -78,9 +85,6 @@ - 'overlap.'), - 'check_move_sequence': ('Period "%(first)s" and "%(second)s" ' - 'have the same sequence.'), -- 'check_move_sequence_company': ('Company of sequence ' -- '"%(sequence)s" does not match the company of period ' -- '"%(period)s" to which it is assigned to.'), - 'fiscalyear_dates': ('Dates of period "%s" are outside ' - 'are outside it\'s fiscal year dates.'), - }) -@@ -93,8 +97,10 @@ - def default_type(): - return 'standard' - -- def get_company(self, name): -- return self.fiscalyear.company.id -+ @fields.depends('fiscalyear') -+ def on_change_with_company(self, name=None): -+ if self.fiscalyear: -+ return self.fiscalyear.company.id - - @classmethod - def search_company(cls, name, clause): -@@ -148,12 +154,6 @@ - 'first': self.rec_name, - 'second': periods[0].rec_name, - }) -- if (self.post_move_sequence.company and -- self.post_move_sequence.company != self.fiscalyear.company): -- self.raise_user_error('check_move_sequence_company', { -- 'sequence': self.post_move_sequence.rec_name, -- 'period': self.rec_name, -- }) - - @classmethod - def find(cls, company_id, date=None, exception=True, test_state=True): -diff -r d57626d6cf3e -r 42b9acc4c201 tax.py ---- .a/trytond/trytond/modules/account/tax.py Tue Dec 02 12:54:29 2014 +0100 -+++ .b/trytond/trytond/modules/account/tax.py Wed Dec 03 16:13:08 2014 +0100 -@@ -627,9 +627,13 @@ - depends=['company', 'type']) - invoice_base_code = fields.Many2One('account.tax.code', - 'Invoice Base Code', -+ domain=[ -+ ('company', '=', Eval('company', -1)), -+ ], - states={ - 'readonly': Eval('type') == 'none', -- }, depends=['type']) -+ }, -+ depends=['type', 'company']) - invoice_base_sign = fields.Numeric('Invoice Base Sign', digits=(2, 0), - help='Usualy 1 or -1', - states={ -@@ -638,9 +642,13 @@ - }, depends=['type']) - invoice_tax_code = fields.Many2One('account.tax.code', - 'Invoice Tax Code', -+ domain=[ -+ ('company', '=', Eval('company', -1)), -+ ], - states={ - 'readonly': Eval('type') == 'none', -- }, depends=['type']) -+ }, -+ depends=['type', 'company']) - invoice_tax_sign = fields.Numeric('Invoice Tax Sign', digits=(2, 0), - help='Usualy 1 or -1', - states={ -@@ -654,15 +662,23 @@ - }, depends=['type']) - credit_note_base_sign = fields.Numeric('Credit Note Base Sign', - digits=(2, 0), help='Usualy 1 or -1', -+ domain=[ -+ ('company', '=', Eval('company', -1)), -+ ], - states={ - 'required': Eval('type') != 'none', - 'readonly': Eval('type') == 'none', -- }, depends=['type']) -+ }, -+ depends=['type', 'company']) - credit_note_tax_code = fields.Many2One('account.tax.code', - 'Credit Note Tax Code', -+ domain=[ -+ ('company', '=', Eval('company', -1)), -+ ], - states={ - 'readonly': Eval('type') == 'none', -- }, depends=['type']) -+ }, -+ depends=['type', 'company']) - credit_note_tax_sign = fields.Numeric('Credit Note Tax Sign', - digits=(2, 0), help='Usualy 1 or -1', - states={ -@@ -919,11 +935,21 @@ - amount = fields.Numeric('Amount', digits=(16, Eval('currency_digits', 2)), - required=True, depends=['currency_digits']) - code = fields.Many2One('account.tax.code', 'Code', select=True, -- required=True) -+ required=True, -+ domain=[ -+ ('company', '=', Eval('company', -1)), -+ ], -+ depends=['company']) - tax = fields.Many2One('account.tax', 'Tax', select=True, -- ondelete='RESTRICT') -+ ondelete='RESTRICT', -+ domain=[ -+ ('company', '=', Eval('company', -1)), -+ ], -+ depends=['company']) - move_line = fields.Many2One('account.move.line', 'Move Line', - required=True, select=True, ondelete='CASCADE') -+ company = fields.Function(fields.Many2One('company.company', 'Company'), -+ 'on_change_with_company') - - @fields.depends('move_line') - def on_change_with_currency_digits(self, name=None): -@@ -935,6 +961,11 @@ - def on_change_tax(self): - self.code = None - -+ @fields.depends('_parent_move_line.account') -+ def on_change_with_company(self, name=None): -+ if self.move_line: -+ return self.move_line.account.company.id -+ - - class TaxRuleTemplate(ModelSQL, ModelView): - 'Tax Rule Template' -diff -r d57626d6cf3e -r 42b9acc4c201 view/move_form.xml ---- .a/trytond/trytond/modules/account/view/move_form.xml Tue Dec 02 12:54:29 2014 +0100 -+++ .b/trytond/trytond/modules/account/view/move_form.xml Wed Dec 03 16:13:08 2014 +0100 -@@ -2,6 +2,9 @@ - -
-+