Skip to content

Commit

Permalink
[IMP] account_payment_return: Make line date editable
Browse files Browse the repository at this point in the history
When entering manually returns, you need to change the line date.

This commit also allows to use header date as defaut line date.
  • Loading branch information
pedrobaeza committed Mar 30, 2017
1 parent 39ebb7f commit 814236f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions account_payment_return/models/payment_return.py
Expand Up @@ -220,10 +220,7 @@ class PaymentReturnLine(models.Model):
help="Reference to match moves from related documents")
move_line_ids = fields.Many2many(
comodel_name='account.move.line', string='Payment Reference')
date = fields.Date(
string='Return date', readonly=True,
help="Read from imported file. Only for reference.",
default=lambda x: fields.Date.today())
date = fields.Date(string='Return date')
partner_name = fields.Char(
string='Partner name', readonly=True,
help="Read from imported file. Only for reference.")
Expand Down
4 changes: 2 additions & 2 deletions account_payment_return/views/payment_return_view.xml
Expand Up @@ -6,7 +6,7 @@
<field name="model">payment.return</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Payment return" version="7.0">
<form string="Payment return">
<header>
<button name="action_confirm" string="Confirm" type="object" states="draft,imported" class="oe_highlight" />
<button name="button_match" string="Match" type="object" states="draft,imported" class="oe_highlight" />
Expand All @@ -24,7 +24,7 @@
</group>
<notebook colspan="4">
<page string="Lines">
<field name="line_ids" colspan="4" nolabel="1" widget="one2many_list">
<field name="line_ids" colspan="4" nolabel="1" widget="one2many_list" context="{'default_date': date}">
<tree string="Payment return lines" editable="top">
<field name="date" />
<field name="concept" />
Expand Down

0 comments on commit 814236f

Please sign in to comment.