|
10 | 10 | class PurchaseOrder(models.Model):
|
11 | 11 | _inherit = "purchase.order"
|
12 | 12 |
|
13 |
| - manual_currency = fields.Boolean( |
14 |
| - readonly=True, |
15 |
| - states={"draft": [("readonly", False)]}, |
16 |
| - ) |
| 13 | + manual_currency = fields.Boolean() |
17 | 14 | is_manual = fields.Boolean(compute="_compute_currency")
|
18 | 15 | type_currency = fields.Selection(
|
19 | 16 | selection=lambda self: self._get_label_currency_name(),
|
20 | 17 | default=lambda self: self._get_label_currency_name()[0][0],
|
21 |
| - readonly=True, |
22 |
| - states={"draft": [("readonly", False)]}, |
23 | 18 | )
|
24 | 19 | manual_currency_rate = fields.Float(
|
25 | 20 | digits="Manual Currency",
|
26 | 21 | tracking=True,
|
27 |
| - readonly=True, |
28 |
| - states={"draft": [("readonly", False)]}, |
29 | 22 | help="Set new currency rate to apply on the invoice\n."
|
30 | 23 | "This rate will be taken in order to convert amounts between the "
|
31 | 24 | "currency on the purchase order and last currency",
|
@@ -118,13 +111,9 @@ def action_refresh_currency(self):
|
118 | 111 | return True
|
119 | 112 |
|
120 | 113 | @api.model
|
121 |
| - def _fields_view_get( |
122 |
| - self, view_id=None, view_type="form", toolbar=False, submenu=False |
123 |
| - ): |
| 114 | + def get_view(self, view_id=None, view_type="form", **options): |
124 | 115 | """Change string name to company currency"""
|
125 |
| - result = super()._fields_view_get( |
126 |
| - view_id=view_id, view_type=view_type, toolbar=toolbar, submenu=submenu |
127 |
| - ) |
| 116 | + result = super().get_view(view_id=view_id, view_type=view_type, options=options) |
128 | 117 | if view_type == "form":
|
129 | 118 | company_currency_name = (
|
130 | 119 | self.env["res.company"].browse(self._context.get("company_id"))
|
|
0 commit comments