Merge pull request #67 from StefanRijnhart/7.0-debit_usability2

[FIX] Payment lines are editable from the mandate form view
This commit is contained in:
Holger Brunn
2014-12-08 11:58:54 +01:00
3 changed files with 9 additions and 2 deletions

View File

@@ -79,7 +79,8 @@ class mandate(orm.Model):
"cancelled mandate is a mandate that has been cancelled by " "cancelled mandate is a mandate that has been cancelled by "
"the customer."), "the customer."),
'payment_line_ids': fields.one2many( 'payment_line_ids': fields.one2many(
'payment.line', 'mandate_id', "Related Payment Lines"), 'payment.line', 'mandate_id', "Related Payment Lines",
readonly=True),
} }
_defaults = { _defaults = {

View File

@@ -381,6 +381,8 @@ class TestPaymentRoundtrip(SingleTransactionCase):
def test_payment_roundtrip(self): def test_payment_roundtrip(self):
reg, cr, uid, = self.registry, self.cr, self.uid reg, cr, uid, = self.registry, self.cr, self.uid
# Tests fail if admin does not have the English language
reg('res.users').write(cr, uid, uid, {'lang': 'en_US'})
self.setup_company(reg, cr, uid) self.setup_company(reg, cr, uid)
self.setup_chart(reg, cr, uid) self.setup_chart(reg, cr, uid)
self.setup_payables(reg, cr, uid) self.setup_payables(reg, cr, uid)

View File

@@ -30,7 +30,11 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<data> <data>
<field name="reference" position="after"> <field name="reference" position="after">
<field name="payment_order_type"/> <!--
Add the order type as invisible because changing it in the form view
is not supported. We still need to access its value in various attrs.
-->
<field name="payment_order_type" invisible="1" />
</field> </field>
<xpath expr="//button[@string='Select Invoices to Pay']" <xpath expr="//button[@string='Select Invoices to Pay']"
position="attributes"> position="attributes">