-
-
Notifications
You must be signed in to change notification settings - Fork 538
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
[16.0] [MIG] product_contract #959
Merged
Merged
Changes from 1 commit
Commits
Show all changes
148 commits
Select commit
Hold shift + click to select a range
7bbfbe1
[ADD] product_contract: Create module
a1aef2a
[FIX] product_contract: Fix mock usage in tests
lasley fc4cdef
[FIX] contract_sale_generation: it doesn't create sales (#141)
flotho 1bb25a2
[MIG] - Product Contract Migration to 12.0
sbejaoui 981fc8e
[IMP] - Product with is_contract can be only of type service
sbejaoui cf9131a
[IMP] - Change dependencies to contract_sale
sbejaoui 8b52763
[IMP] - Add recurrence fields to product template and sale order line
sbejaoui dc2b4ae
[IMP] - Create contract on sale order confirmation
sbejaoui 9d64e6f
[IMP] - Link contract line to sale order line
sbejaoui 06ec626
[FIX] - Remove recurring_next_date from sale order line
sbejaoui 5d626d6
[IMP] - Contract product are ignored on invoicing process
sbejaoui 3679d75
[FIX] - Default value for date_start applied on product change
sbejaoui 513d754
[ADD] - Add readme directory
sbejaoui 6762d12
[IMP] - Onchange contract product on contract contract and contract t…
sbejaoui 534f6a3
[FIX] - Change website to OCA repository url and prefix module name w…
sbejaoui 1875a60
[FIX] - Compute recurring_next_date before create contract line
sbejaoui 4db2c55
[IMP] - Upsell/Downsell contract from sale order
sbejaoui 4ce0cb8
[ADD] - Add renewal process with termination notice
sbejaoui 8abbd4a
[IMP] - compute date end onchange date start for auto-renew sale orde…
sbejaoui c218efb
[IMP] - link contract line and its successor in upsel case
sbejaoui 1426baa
[FIX] - on upsel, contract line should stop day - 1
sbejaoui d081d7e
[FIX] - fix onchange
sbejaoui a5fc170
[IMP] - hide recurring_invoicing_type if recurring_rule_type is month…
sbejaoui 758eac6
[FIX] - include date_end in the period if the product is_autorenew
sbejaoui 07d104c
[IMP] - _prepare_contract_value for sale order confirm
sbejaoui 5a0f24b
[REM] - Remove unused method
sbejaoui a5cd06b
[IMP] - get contract user from sale order user
sbejaoui 41b6db3
[IMP] - show related sale orders in contract form
sbejaoui e7df781
[REF] Contract Product: invoice in prepare_invoice_line is optional
ThomasBinsfeld 5f30846
[FIX] - fix flake8
sbejaoui cae46a4
[ADD] Product Contract: payment term
ThomasBinsfeld 02f338a
[IMP] - update invoice_line vals only if it is not null
sbejaoui 8bb36ab
[FIX] - fix unit tests
sbejaoui a42a1fb
[IMP] - Add unit test
sbejaoui 2e06da2
[REF] - predecessor_contract_line set in create process
sbejaoui 8ac0791
[IMP] - Simplify sale order line creation for contract product
sbejaoui 57409be
[ADD] Contract Sale: fiscal position
ThomasBinsfeld 23ddc31
[IMP] - auto_renew_rule deducted from recurring_rule_type and product…
sbejaoui e7a7bee
[FIX] Product Contract: copy invoicing partner to created contract
ThomasBinsfeld 95cfc9d
[FIX] - Fix recurring_next_date
sbejaoui b5d0f54
[FIX] - date_end required only for contract product
sbejaoui b38a406
[FIX] - Get auto_renew_rule_type based on recurring_rule_type
sbejaoui e6b020c
[IMP] - cancel contract line if the downsell/upsell comes before
sbejaoui d1f5921
[FIX] - date_end computed only for contract products
sbejaoui 74591f8
[REF] Contract: set order count to 0 if no access to orders
ThomasBinsfeld e6f1580
[IMP] - permit contract selection without contract_template_id
sbejaoui f9218d3
[ADD] Add start_date to contract_line display_name
qgroulard 1795723
[12.0][IMP] - option to decide if we automaticallt create contract a …
sbejaoui b0920c3
[FIX] - fix display name compute dependecy
sbejaoui a2ac920
[12.0][FIX] - create contract only on sale and done states
sbejaoui b8fa244
[12.0][REF] - Split analytic accouts and contracts
sbejaoui 1ea463d
[12.0][IMP] - Improve unit tests
sbejaoui 5659a97
[IMP] - improve is contract visibility in product view
sbejaoui 1b20b6e
[12.0][IMP] - sale line linked to contracts must not be invoiced from…
sbejaoui fc8271d
[UPD] README.rst
OCA-git-bot a9585bc
[ADD] icon.png
OCA-git-bot f5448f7
[FIX] - Remove deprecated field
sbejaoui 827c655
[UPD] Update product_contract.pot
oca-travis 81fa7ce
Update translation files
oca-transbot ef3431f
product_contract 12.0.2.0.1
OCA-git-bot a241c66
Translated using Weblate (German)
marylla ae4db4b
Translated using Weblate (Portuguese (Brazil))
britoederr 9ae93d7
Translated using Weblate (German)
rschnapka 1ce387b
[12.0][FIX] - contract company must be the same as the sale order
sbejaoui 444c914
product_contract 12.0.2.0.2
OCA-git-bot 69d97b8
[12.0][FIX] - Run onchange contract_type when changing the contract t…
sbejaoui fcc9731
Translated using Weblate (Croatian)
badbole ae9b8a0
Translated using Weblate (French)
Martronic-SA c3deba1
[IMP] contract: support pre-paid for monthlylastday
sbidoul 48642c6
[IMP] - Set recurring_invoicing_type for existing products set to mon…
sbejaoui 07ad88e
product_contract 12.0.3.0.0
OCA-git-bot cb57e3c
[12.0][FIX] - Set contract line analytic account at contract creation…
sbejaoui d6a91f1
[UPD] Update product_contract.pot
oca-travis 4080435
product_contract 12.0.3.0.1
OCA-git-bot 32b0292
Update translation files
oca-transbot 4133b22
Translated using Weblate (Spanish)
b6452b3
product_contract 12.0.3.1.0
OCA-git-bot 25982d0
[IMP] contract: remove redundant method
pedrobaeza f671acd
product_contract 12.0.3.1.1
OCA-git-bot ced533e
Translated using Weblate (Italian)
03bbd64
Translated using Weblate (Spanish)
5171a5e
[FIX]contract_count == len(active contracts)
9d345ba
Translated using Weblate (Portuguese (Brazil))
marcelsavegnago bdea2d3
Translated using Weblate (Portuguese)
pedrocs-exo c9f1870
Translated using Weblate (Portuguese)
pedrocs-exo 5a77598
Translated using Weblate (Portuguese)
alvarorib 879212b
[12.0][ADD] - add auto_renew_interval, auto_renew_rule_type fields to…
sbejaoui feb8054
[IMP] - Improve UX, open contract form if the sale order is related t…
sbejaoui fa5d032
product_contract 12.0.3.1.2
OCA-git-bot 5071b11
[FIX] product_contract: set 'Contract template' field company depend
f70073d
[FIX] contract_sale_mandate: use property_contract_template_id
26ce84b
[UPD] Update product_contract.pot
oca-travis fe41c68
[UPD] README.rst
OCA-git-bot 9d499a5
Update translation files
oca-transbot fc35919
[UPD] Update product_contract.pot
oca-travis f7b0c41
Update translation files
oca-transbot e5da204
[IMP] - can't upsell or downsell a resiliated contract
sbejaoui 11ebcdc
[IMP] - use terminate term instead of resiliate
sbejaoui 0930eb5
[UPD] Update product_contract.pot
oca-travis d5858ca
product_contract 12.0.5.0.0
OCA-git-bot 7987c7e
Update translation files
oca-transbot fdb6b31
[UPD] Update product_contract.pot
oca-travis 1e22bd3
Update translation files
oca-transbot ce2312f
[12.0][IMP] - Add failing test for creating contract grouped by contr…
sbejaoui 9b2c420
[12.0][FIX] - fix contract creation group by contract template
sbejaoui 63e62ff
Translated using Weblate (French)
svalaeys 7e3c52f
[UPD] Update product_contract.pot
oca-travis a2bf238
product_contract 12.0.5.0.1
OCA-git-bot 86e35b1
Update translation files
oca-transbot e27272f
[UPD] Update product_contract.pot
oca-travis 88720ac
Update translation files
oca-transbot cd3e89b
product_contract 12.0.5.0.2
OCA-git-bot 812792c
[FIX] migration from 11.0
sergiocorato 3f0f8f6
Translated using Weblate (Spanish)
e63bd1f
[UPD] README.rst
OCA-git-bot 15568ef
[UPD] README.rst
OCA-git-bot a1d4101
product_contract 12.0.5.0.3
OCA-git-bot 69f4487
[UPD] Update product_contract.pot
oca-travis 808c364
product_contract 12.0.5.0.4
OCA-git-bot 403070c
Update translation files
oca-transbot c46f3b8
[UPD] Update product_contract.pot
oca-travis 4e1ba9d
Update translation files
oca-transbot 437ab0b
Translated using Weblate (Portuguese (Brazil))
eduaparicio 98ea250
[IMP] - Contract: add new recurring_rule_type quarterly and semesterly
sbejaoui 3c0a70f
[UPD] Update product_contract.pot
oca-travis 420ccce
product_contract 12.0.5.1.0
OCA-git-bot 267284f
Update translation files
oca-transbot ffd5b27
[UPD] Update product_contract.pot
oca-travis 5ab24b2
Update translation files
oca-transbot 1b45176
Translated using Weblate (Portuguese (Brazil))
fcolus 392052b
Translated using Weblate (Spanish)
pedrobaeza 6cec444
Translated using Weblate (Portuguese (Brazil))
fcolus aeb1725
Translated using Weblate (Portuguese (Brazil))
fcolus 2a70157
Update translation files
oca-transbot b0ebf69
Translated using Weblate (French)
gregory-moka 40c4c68
[13.0][MIG] - migration product_contract
sbejaoui fb5dc5e
[IMP] product_contract: black, isort, prettier
mourad-ehm 0ff986a
[MIG] product_contract: Migration to 14.0
mourad-ehm 4d312fb
[IMP] product_contract: use _compute_display_name. Moved it to contra…
ilyasProgrammer 7856cf6
[IMP] product_contract: code improvements
ilyasProgrammer 3d9ec4c
[UPD] Update product_contract.pot
d412c7e
[UPD] README.rst
OCA-git-bot 467ae9b
product_contract 14.0.1.0.1
OCA-git-bot ca5b3fb
Translated using Weblate (Italian)
francesco-ooops ea504f1
Translated using Weblate (Italian)
mymage b5c4526
Translated using Weblate (Italian)
francesco-ooops b3f1fa3
[IMP] product_contract: pre-commit stuff
Rad0van a41cafe
[MIG] product_contract: Migration to 16.0
Rad0van File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ class SaleOrder(models.Model): | |
need_contract_creation = fields.Boolean(compute="_compute_need_contract_creation") | ||
|
||
@api.constrains("state") | ||
def _check_contact_is_not_terminated(self): | ||
def _check_contract_is_not_terminated(self): | ||
for rec in self: | ||
if rec.state not in ( | ||
"sale", | ||
|
@@ -49,17 +49,15 @@ def _compute_is_contract(self): | |
def _prepare_contract_value(self, contract_template): | ||
self.ensure_one() | ||
return { | ||
"name": "{template_name}: {sale_name}".format( | ||
template_name=contract_template.name, sale_name=self.name | ||
), | ||
"name": f"{contract_template.name}: {self.name}", | ||
"partner_id": self.partner_id.id, | ||
"company_id": self.company_id.id, | ||
"contract_template_id": contract_template.id, | ||
"user_id": self.user_id.id, | ||
"payment_term_id": self.payment_term_id.id, | ||
"fiscal_position_id": self.fiscal_position_id.id, | ||
"invoice_partner_id": self.partner_invoice_id.id, | ||
"line_recurrence": self.partner_invoice_id.id, | ||
"line_recurrence": True, | ||
} | ||
|
||
def action_create_contract(self): | ||
|
@@ -84,8 +82,13 @@ def action_create_contract(self): | |
raise ValidationError( | ||
_( | ||
"You must specify a contract " | ||
"template for '{}' product in '{}' company." | ||
).format(order_line.product_id.name, rec.company_id.name) | ||
"template for '%(product_name)s' product " | ||
"in '%(company_name)s' company." | ||
) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prefer using translation method attributes.
|
||
% { | ||
"product_name": order_line.product_id.name, | ||
"company_name": rec.company_id.name, | ||
} | ||
) | ||
contract_templates |= contract_template | ||
for contract_template in contract_templates: | ||
|
@@ -98,7 +101,7 @@ def action_create_contract(self): | |
contract = contract_model.create( | ||
rec._prepare_contract_value(contract_template) | ||
) | ||
contracts.append(contract) | ||
contracts.append(contract.id) | ||
contract._onchange_contract_template_id() | ||
contract._onchange_contract_type() | ||
order_lines.create_contract_line(contract) | ||
|
@@ -112,7 +115,7 @@ def action_confirm(self): | |
self.filtered( | ||
lambda order: (order.company_id.create_contract_at_sale_order_confirmation) | ||
).action_create_contract() | ||
return super(SaleOrder, self).action_confirm() | ||
return super().action_confirm() | ||
|
||
@api.depends("order_line") | ||
def _compute_contract_count(self): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I change the product_uom_qty before creating the contract, when creating the contract the quantity is doesn't match.