Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[18.0][MIG] crm_lead_vat: Migration to 18.0 #614

Open
wants to merge 34 commits into
base: 18.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
64b818b
Translated using Weblate (Spanish)
Ivorra78 Aug 2, 2023
60f5def
[FIX] crm_lead_vat: fix onchange error
oihane Jun 16, 2017
52d5bae
[MIG] crm_lead_vat: Migration to 12.0
oihane Jun 20, 2019
77c961f
Translated using Weblate (Portuguese (Brazil))
Sep 3, 2019
8d4f730
Translated using Weblate (Italian)
eLBati Sep 26, 2019
f316338
FIX crm_lead_vat tests after https://github.com/odoo/odoo/commit/e183…
eLBati Nov 13, 2019
a4f5206
Translated using Weblate (Italian)
primes2h Jan 8, 2020
b8cfdf7
[IMP] crm_lead_vat: black, isort
newtratip Mar 9, 2020
68cb21d
[13.0][MIG] crm_lead_vat
newtratip Mar 13, 2020
e08dc24
[FIX] Clean up license links
skeller1 May 13, 2020
8b6ea57
[IMP] crm_lead_vat: Improve description
pedrobaeza Aug 31, 2020
4fa3a33
[MIG] crm_lead_vat: Migration to 14.0
redapureskill Nov 11, 2020
ec2e812
Translated using Weblate (French)
klodr Sep 15, 2022
6bed385
[MIG] crm_lead_vat: Migration to 15.0
stefan-tecnativa Mar 20, 2023
3b6bfa8
[UPD] Update crm_lead_vat.pot
Mar 23, 2023
7f7eb23
[15.0][IMP] Sync vat between partner and lead
EmilioPascual Jul 28, 2023
15d977f
crm_lead_vat 15.0.1.1.0
OCA-git-bot Aug 2, 2023
bd078ee
Update translation files
weblate Aug 2, 2023
95a171d
[MIG] crm_lead_vat: Migration to 16.0
EmilioPascual Aug 3, 2023
82331cd
[UPD] Update crm_lead_vat.pot
Aug 9, 2023
4ba4030
[UPD] README.rst
OCA-git-bot Aug 9, 2023
e025a08
crm_lead_vat 16.0.1.0.1
OCA-git-bot Aug 9, 2023
7fe54df
Translated using Weblate (Italian)
mymage Aug 14, 2023
d10a1ed
[UPD] README.rst
OCA-git-bot Sep 3, 2023
0ecd88d
Translated using Weblate (Spanish)
Ivorra78 Aug 21, 2023
02edddc
Update translation files
weblate Oct 9, 2023
03a4a4f
[MIG] crm_lead_vat: Migration to 17.0
peluko00 Nov 16, 2023
00d49e2
[UPD] Update crm_lead_vat.pot
Nov 24, 2023
c6036b3
[BOT] post-merge updates
OCA-git-bot Nov 24, 2023
0a95ae1
Update translation files
weblate Feb 3, 2024
6c7a8c6
Translated using Weblate (Italian)
mymage Feb 4, 2024
fb0a5c4
Translated using Weblate (Spanish)
Ivorra78 Feb 8, 2024
3b0c27f
Translated using Weblate (Portuguese (Brazil))
SottomaiorMacedoTec Jul 6, 2024
c4d9294
[MIG] crm_lead_vat: Migration to 18.0
HeliconiaSolutions Nov 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[IMP] crm_lead_vat: black, isort
  • Loading branch information
newtratip authored and HeliconiaSolutions committed Nov 28, 2024
commit b8cfdf7a26bfa96c0784fc3c93afc2cc24d024f8
10 changes: 3 additions & 7 deletions crm_lead_vat/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,13 @@
{
"name": "VAT in leads",
"summary": "Add VAT field to leads",
"version": "12.0.1.0.0",
"version": "13.0.1.0.0",
"category": "Customer Relationship Management",
"website": "https://github.com/OCA/crm",
"author": "Antiun Ingeniería S.L., Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": [
"crm",
],
"data": [
"views/crm_lead.xml",
],
"depends": ["crm"],
"data": ["views/crm_lead.xml"],
}
13 changes: 7 additions & 6 deletions crm_lead_vat/models/crm_lead.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2015 Antiun Ingeniería, S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

Expand All @@ -11,20 +10,22 @@ class Lead(models.Model):
vat = fields.Char(
string="TIN",
help="Tax Identification Number. The first 2 characters are the "
"country code.")
"country code.",
)

@api.multi
def _create_lead_partner(self):
"""Add VAT to partner."""
return (super(Lead, self.with_context(default_vat=self.vat))
._create_lead_partner())
return super(
Lead, self.with_context(default_vat=self.vat)
)._create_lead_partner()

def _onchange_partner_id_values(self, partner_id):
"""Recover VAT from partner if available."""
result = super(Lead, self)._onchange_partner_id_values(partner_id)
if not partner_id:
return result
partner = self.env['res.partner'].browse(partner_id)
partner = self.env["res.partner"].browse(partner_id)
if partner.vat:
result['vat'] = partner.vat
result["vat"] = partner.vat
return result
7 changes: 3 additions & 4 deletions crm_lead_vat/tests/test_lead.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
class LeadCase(TransactionCase):
def setUp(self):
super(LeadCase, self).setUp()
self.lead = self.env["crm.lead"].create({
"name": __file__,
"partner_name": u"HÎ"
})
self.lead = self.env["crm.lead"].create(
{"name": __file__, "partner_name": u"HÎ"}
)
self.partner = self.env["res.partner"].create({"name": __file__})
self.test_field = "ES98765432M"

Expand Down