Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

show prepaid move in invoice view and force no tax on prepaid move #59

Merged
merged 1 commit into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading