Skip to content

Commit

Permalink
l10n_it_intrastat: Move size constraint of fields to web client.
Browse files Browse the repository at this point in the history
Otherwise the following warning is raised:
unknown parameter 'size', if this is an actual parameter you may want to override the method _valid_field_parameter on the relevant model in order to allow it
  • Loading branch information
SimoRubi committed Nov 12, 2021
1 parent 1f5cd46 commit d50e958
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 12 deletions.
1 change: 1 addition & 0 deletions l10n_it_intrastat/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"stock",
"stock_account",
"uom",
"web_widget_char_size",
],
"data": [
"security/ir.model.access.csv",
Expand Down
6 changes: 3 additions & 3 deletions l10n_it_intrastat/models/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ class ResCompany(models.Model):
default="weight",
)
intrastat_exclude_free_line = fields.Boolean(string="Exclude Free lines")
intrastat_ua_code = fields.Char(string="User ID (UA Code)", size=4)
intrastat_delegated_vat = fields.Char(string="Delegate VAT number", size=16)
intrastat_delegated_name = fields.Char(string="Delegate", size=255)
intrastat_ua_code = fields.Char(string="User ID (UA Code)")
intrastat_delegated_vat = fields.Char(string="Delegate VAT number")
intrastat_delegated_name = fields.Char(string="Delegate")
intrastat_export_file_name = fields.Char(string="File name for export")

# default values sale section
Expand Down
6 changes: 3 additions & 3 deletions l10n_it_intrastat/models/intrastat.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class AccountIntrastatCustom(models.Model):
_name = "account.intrastat.custom"
_description = "Customs Sections"

code = fields.Char(size=6)
code = fields.Char()
name = fields.Char()
date_start = fields.Date(string="Start Date")
date_stop = fields.Date(string="Stop Date")
Expand Down Expand Up @@ -71,13 +71,13 @@ class AccountIntrastatTransport(models.Model):
_name = "account.intrastat.transport"
_description = "Transport Mode"

code = fields.Char(string="Code", size=1, required=True)
code = fields.Char(string="Code", required=True)
name = fields.Char(string="Name")


class AccountIntrastatTransationNature(models.Model):
_name = "account.intrastat.transaction.nature"
_description = "Transaction Nature"

code = fields.Char(string="Code", size=1, required=True)
code = fields.Char(string="Code", required=True)
name = fields.Char(string="Name")
12 changes: 9 additions & 3 deletions l10n_it_intrastat/views/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,18 @@
<page string="Intrastat">
<group colspan="4">
<group>
<field name="intrastat_ua_code" />
<field name="intrastat_ua_code" options="{'size': 4}" />
<field name="intrastat_uom_kg_id" />
<field name="intrastat_additional_unit_from" />
<field name="intrastat_exclude_free_line" />
<field name="intrastat_delegated_name" />
<field name="intrastat_delegated_vat" />
<field
name="intrastat_delegated_name"
options="{'size': 255}"
/>
<field
name="intrastat_delegated_vat"
options="{'size': 16}"
/>
<field name="intrastat_export_file_name" />
<field name="intrastat_min_amount" />
</group>
Expand Down
6 changes: 3 additions & 3 deletions l10n_it_intrastat/views/intrastat.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<form string="Customs Section">
<group>
<group>
<field name="code" />
<field name="code" options="{'size': 6}" />
<field name="name" />
</group>
<group>
Expand Down Expand Up @@ -132,7 +132,7 @@
<field name="arch" type="xml">
<form string="Transport Mode">
<group>
<field name="code" />
<field name="code" options="{'size': 4}" />
<field name="name" />
</group>
</form>
Expand Down Expand Up @@ -175,7 +175,7 @@
<field name="arch" type="xml">
<form string="Transaction Nature">
<group>
<field name="code" />
<field name="code" options="{'size': 1}" />
<field name="name" />
</group>
</form>
Expand Down
1 change: 1 addition & 0 deletions oca_dependencies.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# See https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#oca_dependencies-txt
web

0 comments on commit d50e958

Please sign in to comment.