Skip to content

Commit

Permalink
[MIG] edi_stock_oca: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
OriolMForgeFlow committed Oct 24, 2023
1 parent ad6fc83 commit 827812a
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 14 deletions.
2 changes: 1 addition & 1 deletion edi_stock_oca/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Edi Stock Oca",
"summary": """
Define EDI Configuration for Stock""",
"version": "15.0.1.0.0",
"version": "16.0.1.0.0",
"license": "AGPL-3",
"author": "Odoo Community Association,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/edi-framework",
Expand Down
21 changes: 17 additions & 4 deletions edi_stock_oca/models/stock_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class StockPicking(models.Model):
_name = "stock.picking"
_inherit = ["stock.picking", "edi.exchange.consumer.mixin"]

edi_auto_disabled = fields.Boolean(
edi_disable_auto = fields.Boolean(
states={
"draft": [("readonly", False)],
"waiting": [("readonly", False)],
Expand All @@ -17,7 +17,20 @@ class StockPicking(models.Model):
},
)

def action_confirm(self):
result = super().action_confirm()
if self:
self._event("on_confirm_picking").notify(self)
return result

def _action_done(self):
res = super()._action_done()
self._event("on_validate").notify(self)
return res
result = super()._action_done()
if self:
self._event("on_validate_picking").notify(self)
return result

def action_cancel(self):
result = super().action_cancel()
if self:
self._event("on_cancel_picking").notify(self)
return result
2 changes: 1 addition & 1 deletion edi_stock_oca/tests/test_edi.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def on_validate(self, picking):
"location_dest_id": cls.stock_location,
}
)
cls.picking_in.refresh()
cls.picking_in.invalidate_recordset()
cls.picking_in.action_confirm()
cls.picking_in.action_assign()
move_a.move_line_ids.qty_done = 4
Expand Down
2 changes: 1 addition & 1 deletion edi_stock_oca/views/res_partner.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). -->
<odoo>
<record model="ir.ui.view" id="view_partner_form">
<field name="name">res.partner.form (in edi_account)</field>
<field name="name">res.partner.form (in edi_stock_oca)</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="stock.view_partner_stock_form" />
<field name="arch" type="xml">
Expand Down
13 changes: 6 additions & 7 deletions edi_stock_oca/views/stock_picking.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<page name="extra" position="after">
<page name="edi" string="EDI">
<group name="edi_stock_group" string="Electronic Data Interchange">
<field name="edi_auto_disabled" string="Disable" />
<field name="edi_disable_auto" />
</group>
</page>
</page>
Expand All @@ -23,12 +23,11 @@
attrs="{'invisible': [('exchange_record_count', '=', 0)]}"
name="action_view_edi_records"
>
<div class="o_form_field o_stat_info">
<span class="o_stat_value">
<field name="exchange_record_count" />
</span>
<span class="o_stat_text">EDI</span>
</div>
<field
string="EDI"
name="exchange_record_count"
widget="statinfo"
/>
</button>
</xpath>
</field>
Expand Down

0 comments on commit 827812a

Please sign in to comment.