mirror of
https://github.com/NaN-tic/trytond-patches.git
synced 2023-12-14 06:03:03 +01:00
Add analytic_invoice on invoice_speedup patch
This commit is contained in:
parent
508715c4e2
commit
583c9b4412
2 changed files with 59 additions and 13 deletions
|
@ -563,3 +563,49 @@ diff -r 6429c9c53cb8 trytond/trytond/modules/account_bank/account.py
|
|||
|
||||
@classmethod
|
||||
def create(cls, vlist):
|
||||
diff -r 95d77335bdd5 trytond/trytond/modules/analytic_invoice/invoice.py
|
||||
--- a/trytond/trytond/modules/analytic_invoice/invoice.py Sun Mar 01 15:34:41 2015 +0100
|
||||
+++ b/trytond/trytond/modules/analytic_invoice/invoice.py Mon Nov 30 14:24:25 2015 +0100
|
||||
@@ -192,26 +192,25 @@
|
||||
return result
|
||||
|
||||
def get_move_line(self):
|
||||
- values = super(InvoiceLine, self).get_move_line()
|
||||
+ pool = Pool()
|
||||
+ AnalyticLine = pool.get('analytic_account.line')
|
||||
+ lines = super(InvoiceLine, self).get_move_line()
|
||||
if self.analytic_accounts and self.analytic_accounts.accounts:
|
||||
- for value in values:
|
||||
- value['analytic_lines'] = []
|
||||
- to_create = []
|
||||
+ for line in lines:
|
||||
+ line.analytic_lines = []
|
||||
for account in self.analytic_accounts.accounts:
|
||||
- vals = {}
|
||||
- vals['name'] = self.description
|
||||
- vals['debit'] = value['debit']
|
||||
- vals['credit'] = value['credit']
|
||||
- vals['account'] = account.id
|
||||
- vals['journal'] = self.invoice.journal.id
|
||||
- vals['date'] = (self.invoice.accounting_date
|
||||
+ analytic_line = AnalyticLine()
|
||||
+ analytic_line.name = self.description
|
||||
+ analytic_line.debit = line.debit
|
||||
+ analytic_line.credit = line.credit
|
||||
+ analytic_line.account = account
|
||||
+ analytic_line.journal = self.invoice.journal
|
||||
+ analytic_line.date = (self.invoice.accounting_date
|
||||
or self.invoice.invoice_date)
|
||||
- vals['reference'] = self.invoice.reference
|
||||
- vals['party'] = self.invoice.party.id
|
||||
- to_create.append(vals)
|
||||
- if to_create:
|
||||
- value['analytic_lines'] = [('create', to_create)]
|
||||
- return values
|
||||
+ analytic_line.reference = self.invoice.reference
|
||||
+ analytic_line.party = self.invoice.party
|
||||
+ line.analytic_lines.append(analytic_line)
|
||||
+ return lines
|
||||
|
||||
|
||||
class Account(ModelSQL, ModelView):
|
||||
|
|
26
series
26
series
|
@ -73,18 +73,18 @@ issue4115.diff
|
|||
issue5118.diff
|
||||
issue18801002_1.diff
|
||||
# Ignore next patches
|
||||
#incremental_wait_in_retries.diff
|
||||
incremental_wait_in_retries.diff
|
||||
# Uncomment in calfruitos and basidelta
|
||||
#account_chart_speedup.diff
|
||||
account_chart_speedup.diff
|
||||
# Uncomment in calfruitos
|
||||
#fix_rounding_in_sync_inventory_to_outgoing.patch
|
||||
#chart_not_translatable.diff
|
||||
#024726_account_bank_remove_company.diff
|
||||
#024726_account_payment_type_remove_company.diff
|
||||
#stock_lot_improve_sync_inventory_to_outgoing.diff
|
||||
#stock_lot_fix_pick_product_without_outgoing_moves.diff
|
||||
#purchase_fix_get_move_done_rounding.diff
|
||||
#multicompany_cron.diff
|
||||
#025476_5154_5155_5456_optimize_move_write_assign.diff
|
||||
#do_not_lock_on_assign_try.diff
|
||||
#limit_invoices_in_creit_note_action_by_domain.diff
|
||||
fix_rounding_in_sync_inventory_to_outgoing.patch
|
||||
chart_not_translatable.diff
|
||||
024726_account_bank_remove_company.diff
|
||||
024726_account_payment_type_remove_company.diff
|
||||
stock_lot_improve_sync_inventory_to_outgoing.diff
|
||||
stock_lot_fix_pick_product_without_outgoing_moves.diff
|
||||
purchase_fix_get_move_done_rounding.diff
|
||||
multicompany_cron.diff
|
||||
025476_5154_5155_5456_optimize_move_write_assign.diff
|
||||
do_not_lock_on_assign_try.diff
|
||||
limit_invoices_in_creit_note_action_by_domain.diff
|
||||
|
|
Loading…
Reference in a new issue