[IMP] partner_statement: remove "blocked" feature

If someone comes from v17 or older Odoo versions, and they still have "blocked" lines, there are three options for them:

- Develop glue module with another module that contains "blocked" field.
- Don't use this commit.
- Solve the "blocked" lines.

Good luck!
This commit is contained in:
Miquel Raïch
2025-07-25 14:16:02 +02:00
parent b426816b11
commit 693d25345a
12 changed files with 34 additions and 244 deletions

View File

@@ -105,16 +105,10 @@ class ActivityStatementXslx(models.AbstractModel):
]
def _get_currency_line_row_data(self, partner, currency, data, line):
if line.get("blocked"):
format_tcell_left = FORMATS["format_tcell_left_blocked"]
format_tcell_date_left = FORMATS["format_tcell_date_left_blocked"]
format_distributed = FORMATS["format_distributed_blocked"]
current_money_format = FORMATS["current_money_format_blocked"]
else:
format_tcell_left = FORMATS["format_tcell_left"]
format_tcell_date_left = FORMATS["format_tcell_date_left"]
format_distributed = FORMATS["format_distributed"]
current_money_format = FORMATS["current_money_format"]
format_tcell_left = FORMATS["format_tcell_left"]
format_tcell_date_left = FORMATS["format_tcell_date_left"]
format_distributed = FORMATS["format_distributed"]
current_money_format = FORMATS["current_money_format"]
name_to_show = (
line.get("name", "") == "/" or not line.get("name", "")
) and line.get("ref", "")
@@ -434,23 +428,6 @@ class ActivityStatementXslx(models.AbstractModel):
FORMATS["current_money_format"] = workbook.add_format(
{"align": "right", "num_format": money_string}
)
bg_grey = "#ADB5BD"
FORMATS["format_tcell_left_blocked"] = copy_format(
workbook, FORMATS["format_tcell_left"]
)
FORMATS["format_tcell_left_blocked"].set_bg_color(bg_grey)
FORMATS["format_tcell_date_left_blocked"] = copy_format(
workbook, FORMATS["format_tcell_date_left"]
)
FORMATS["format_tcell_date_left_blocked"].set_bg_color(bg_grey)
FORMATS["format_distributed_blocked"] = copy_format(
workbook, FORMATS["format_distributed"]
)
FORMATS["format_distributed_blocked"].set_bg_color(bg_grey)
FORMATS["current_money_format_blocked"] = copy_format(
workbook, FORMATS["current_money_format"]
)
FORMATS["current_money_format_blocked"].set_bg_color(bg_grey)
row_pos = self._write_currency_lines(
row_pos, sheet, partner, currency, data
)