Skip to content

Commit

Permalink
Merge pull request #59 from akretion/16-no-prepaid-tax
Browse files Browse the repository at this point in the history
show prepaid move in invoice view and force no tax on prepaid move
  • Loading branch information
florian-dacosta authored Feb 6, 2025
2 parents ad0c99d + a717736 commit d2f72ff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion project_invoicing_subcontractor/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def _manage_prepaid_lines(self):
_("The linked prepaid entry should be canceled.")
)
prepaid_move.with_context(prepaid_reset=True).button_draft()
prepaid_move.line_ids.unlink()
prepaid_move.line_ids.with_context(dynamic_unlink=True).unlink()
else:
vals = self._create_prepare_prepaid_move_vals()
prepaid_move = self.create(vals)
Expand All @@ -325,6 +325,7 @@ def _manage_prepaid_lines(self):
"move_id": prepaid_move.id,
"partner_id": self.customer_id.id,
"project_id": project.id,
"tax_ids": [], # ensure no taxes on line to avoid unwanted tax line creation with sync_dynamic_line
}
line_vals_list.append(line_vals)
# revenue line
Expand All @@ -334,6 +335,7 @@ def _manage_prepaid_lines(self):
"amount_currency": -amount,
"move_id": prepaid_move.id,
"project_id": project.id,
"tax_ids": [], # ensure no taxes on line to avoid unwanted tax line creation with sync_dynamic_line
}
line_vals_list.append(line_vals)
prepaid_move.write({"line_ids": [(0, 0, vals) for vals in line_vals_list]})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@
</div>
<field name="subcontractor_state_color" invisible="1" />
</xpath>
<group name="accounting_info_group" position="inside">
<field name="prepaid_countdown_move_id" attrs="{'invisible': [('prepaid_countdown_move_id', '=', False)], 'readonly': [('prepaid_countdown_move_id', '!=', False)]}"/>
</group>
</field>
</record>

Expand Down

0 comments on commit d2f72ff

Please sign in to comment.