Skip to content

Commit

Permalink
[MIG] sale_order_revision: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
siemenv authored and bizzappdev committed Feb 10, 2025
1 parent 0546901 commit 26fdc4e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 15 deletions.
4 changes: 2 additions & 2 deletions sale_order_revision/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from . import models


def populate_unrevisioned_name(cr, registry):
cr.execute(
def populate_unrevisioned_name(env):
env.cr.execute(
"UPDATE sale_order "
"SET unrevisioned_name = name "
"WHERE unrevisioned_name is NULL"
Expand Down
2 changes: 1 addition & 1 deletion sale_order_revision/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{
"name": "Sale order revisions",
"summary": "Keep track of revised quotations",
"version": "16.0.1.0.1",
"version": "17.0.1.0.0",
"category": "Sale Management",
"author": "Agile Business Group,"
"Dreambits,"
Expand Down
8 changes: 4 additions & 4 deletions sale_order_revision/i18n/it.po
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-03-14 12:37+0000\n"
"Last-Translator: Lorenzo Battistini <[email protected]>\n"
"PO-Revision-Date: 2023-12-13 12:34+0000\n"
"Last-Translator: mymage <[email protected]>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
Expand All @@ -34,7 +34,7 @@ msgstr "Ha revisioni precedenti"
#. module: sale_order_revision
#: model_terms:ir.ui.view,arch_db:sale_order_revision.view_order_form
msgid "New Revision of Quotation"
msgstr "Nuova revisione preventivo"
msgstr "Nuova rersione preventivo"

#. module: sale_order_revision
#: model:ir.model.fields,field_description:sale_order_revision.field_sale_order__old_revision_ids
Expand All @@ -59,7 +59,7 @@ msgstr "Revisioni precedenti"
#. module: sale_order_revision
#: model:ir.model.fields,field_description:sale_order_revision.field_sale_order__revision_count
msgid "Previous versions count"
msgstr "Conteggio versioni precedenti"
msgstr "Conteggio rersioni precedenti"

#. module: sale_order_revision
#: model:ir.model.fields,field_description:sale_order_revision.field_sale_order__revision_number
Expand Down
3 changes: 1 addition & 2 deletions sale_order_revision/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ def _prepare_revision_data(self, new_revision):

def action_view_revisions(self):
self.ensure_one()
action = self.env.ref("sale.action_orders")
result = action.read()[0]
result = self.env["ir.actions.act_window"]._for_xml_id("sale.action_orders")
result["domain"] = ["|", ("active", "=", False), ("active", "=", True)]
result["context"] = {
"active_test": 0,
Expand Down
9 changes: 3 additions & 6 deletions sale_order_revision/view/sale_order.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<xpath expr="//header" position='inside'>
<button
name="create_revision"
states="cancel,sent"
invisible="state not in ['cancel' ,'sent']"
string="New Revision of Quotation"
type="object"
/>
Expand All @@ -30,7 +30,7 @@
type="object"
class="oe_stat_button"
icon="fa-file-archive-o"
attrs="{'invisible': ['|', ('has_old_revisions', '=', False),('revision_count', '=', 0)]}"
invisible="not has_old_revisions or revision_count == 0"
>
<field
name="revision_count"
Expand All @@ -40,10 +40,7 @@
</button>
</xpath>
<field name="client_order_ref" position="after">
<field
name="current_revision_id"
attrs="{'invisible': [('current_revision_id', '=', False)]}"
/>
<field name="current_revision_id" invisible="not current_revision_id" />
<field name="has_old_revisions" invisible="1" />
</field>
</field>
Expand Down

0 comments on commit 26fdc4e

Please sign in to comment.