Skip to content

Commit

Permalink
Merge de17c60 into 1d95949
Browse files Browse the repository at this point in the history
  • Loading branch information
brian10048 committed Jul 13, 2019
2 parents 1d95949 + de17c60 commit 426d84b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
24 changes: 24 additions & 0 deletions l10n_us_form_1099/models/res_partner.py
Expand Up @@ -4,10 +4,34 @@
from odoo import api, fields, models


TYPES_1099 = [
('a', "1099-A"),
('b', "1099-B"),
('c', "1099-C"),
('cap', "1099-CAP"),
('div', "1099-DIV"),
('g', "1099-G"),
('h', "1099-H"),
('int', "1099-INT"),
('k', "1099-K"),
('ltc', "1099-LTC"),
('misc', "1099-MISC"),
('oid', "1099-OID"),
('pair', "1099-PATR"),
('q', "1099-Q"),
('r', "1099-R"),
('s', "1099-S"),
('sa', "1099-SA"),
('rrb', "RRB-1099"),
('ssa', "SSA-1099"),
]

class ResPartner(models.Model):
_inherit = "res.partner"

is_1099 = fields.Boolean('Is a 1099?')
type_1099 = fields.Selection(
TYPES_1099, string='1099 Type')

@api.onchange('is_1099')
def _on_change_is_1099(self):
Expand Down
1 change: 1 addition & 0 deletions l10n_us_form_1099/views/res_partner.xml
Expand Up @@ -8,6 +8,7 @@
<field name="arch" type="xml">
<xpath expr="//group[2]/field[@name='supplier']" position="after">
<field name="is_1099"/>
<field name="type_1099" attrs="{'required': [('is_1099', '=', True)]}"/>
</xpath>
</field>
</record>
Expand Down

0 comments on commit 426d84b

Please sign in to comment.