trytond-patches/account_payment_5dd8c0c2a04c.patch

45 lines
1.8 KiB
Diff
Raw Normal View History

# exporting patch:
# HG changeset patch
# User Cédric Krier <ced@b2ck.com>
# Date 1417619600 -3600
# Wed Dec 03 16:13:20 2014 +0100
# Node ID 5dd8c0c2a04ce36ae50b07ace37a3c032d975f7d
# Parent 0feef65b0f4ece82ace16996c05c82ac254c677a
# Add missing company domain/field
# issue4311
# review7691002
diff -r 0feef65b0f4e -r 5dd8c0c2a04c account.py
2015-02-19 10:21:09 +01:00
--- .a/trytond/trytond/modules/account_payment/account.py Tue Dec 02 12:54:44 2014 +0100
+++ .b/trytond/trytond/modules/account_payment/account.py Wed Dec 03 16:13:20 2014 +0100
@@ -148,6 +148,7 @@
kind = 'payable'
return Payment(
+ company=line.move.company,
journal=self.start.journal,
party=line.party,
kind=kind,
diff -r 0feef65b0f4e -r 5dd8c0c2a04c payment.py
2015-02-19 10:21:09 +01:00
--- .a/trytond/trytond/modules/account_payment/payment.py Tue Dec 02 12:54:44 2014 +0100
+++ .b/trytond/trytond/modules/account_payment/payment.py Wed Dec 03 16:13:20 2014 +0100
@@ -118,6 +118,7 @@
depends=_DEPENDS + ['currency_digits'])
line = fields.Many2One('account.move.line', 'Line', ondelete='RESTRICT',
domain=[
+ ('move.company', '=', Eval('company', -1)),
If(Eval('kind') == 'receivable',
['OR', ('debit', '>', 0), ('credit', '<', 0)],
['OR', ('credit', '>', 0), ('debit', '<', 0)],
@@ -138,7 +139,8 @@
],
('move_state', '=', 'posted'),
],
- states=_STATES, depends=_DEPENDS + ['party', 'currency', 'kind'])
+ states=_STATES, depends=_DEPENDS + ['party', 'currency', 'kind',
+ 'company'])
description = fields.Char('Description', states=_STATES, depends=_DEPENDS)
group = fields.Many2One('account.payment.group', 'Group', readonly=True,
ondelete='RESTRICT',