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

[IMP] Ported pos_pricelist to v9. Based on work from x620. Added calc… #186

Closed
wants to merge 4 commits into from

Conversation

wpichler
Copy link
Contributor

…ulcation based on standard_price. Fixed bug in simulate_price. Removed old addProduct function - not needed anymore

@pedrobaeza
Copy link
Member

You must keep commit attribution (you can squash all @x620 commits tough).

Copy link
Contributor

@legalsylvain legalsylvain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @wpichler. thanks for the work.
done a quick review for the time being. Not tested.
some remarks inline.

kind regards;
CC : @AdilHoumadi, @antespi, @StefanRijnhart, @pedrobaeza, @ismaelcj, @x620

pricelist_ids:
- min_quantity : 2.0
price : 80
# seller_ids:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove useless demo data.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@@ -42,16 +42,18 @@ class PosOrderLine(models.Model):
@api.multi
def _compute_taxes(self):
res = {
'total': 0,
# 'total': 0,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@@ -24,5 +24,6 @@ class PosPriceListConfig(models.Model):

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you rename into classical name.
class PosConfig

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed complete - because with the next changes it is not needed any more

@@ -24,5 +24,6 @@ class PosPriceListConfig(models.Model):

display_price_with_taxes = fields.Boolean(
string='Price With Taxes',
help="Display Prices with taxes on POS"
help="Display Prices with taxes on POS",
related="iface_tax_included"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be better to detete display_price_with_taxes, and use iface_tax_included in the JS code, don't you think ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

var round_pr = utils.round_precision;
var round_di = utils.round_decimals;

PosDB = PosDB.extend({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this changes. you moved PosDB definition from db.js to models.js ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep - because else we would get a recursive require

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should use include instead of extend.

x620 and others added 2 commits July 11, 2017 18:54
[IMP] Show unit price when qty is not 1

Conflicts:
	pos_pricelist/__openerp__.py

(cherry-pick commit: e9ac0d5)

[IMP] Preserve manually modified price in most cases

Conflicts:
	pos_pricelist/static/src/js/models.js

(cherry-pick commit: a10bc11)

Add contributors

Add contributors

Corrected error: TypeError: Cannot read property 'field' of undefined (and many others before it)
Error occurred: TypeError: Cannot read property 'models' of undefined (in progress)

Recovery db.js

Corrected error: TypeError: Cannot read property 'models' of undefined

Corrected error: TypeError: round_pr is not a function

Corrected error: AttributeError: 'float' object has no attribute 'decimal_places'
Corrected error: KeyError: 'total'

Corrected error: TypeError: _amount_line_tax() got an unexpected keyword argument 'context'

Recovery tooltips (in progress)

Recovery tooltips: corrected compute_price

Check discount values in pricelist cards and remove outdated fields

Corrected calculate discount and remove outdated code

Added percent_price and fixed_price method define discount

Add author in __openerp__.py

Few corrections

Add images and license keys

Corrected license value

Corrected outdated parameters

Correction errors display discounts related to the pricelist customers

Refactoring

[FIX] pos_pricelist: FP taxes with multi-company. Fixes OCA#84

The object account.fiscal.position.tax doesn't have multi-company rules,
which leads to error in environments with multi-company and these records,
because it finally accesses to the parent fiscal position, which on contrary
has access rules, provoking an access error.

This commit added the field company_id to the model, and add the corresponding
access rule.

Conflicts:
	pos_pricelist/__openerp__.py

Added sort rules by applied_on field

Added applied_on field

[FIX] bug when find item

[FIX] bug when find item

[FIX] check product_tmpl_id when collect rules (db.js) and items (models.js)

Add return on method for API call convenience

Force order of product fields loading

[FIX] fix handle where rule.base == 'pricelist'

[IMP]Prevent useless supplierinfo loading

[IMP]Deal with dates in pricelist items

[FIX] initialize() method with ...initialize.apply(this, arguments); must have return

[FIX] Moved ...initialize.apply(this, arguments); to its original place
…e_price. Removed addProduct function - not needed here anymore
This was referenced Feb 22, 2018
@pedrobaeza
Copy link
Member

Is this going to be continued? We have backported v11 functionality to v10. Maybe it's better to backport that one to v9 instead of continuing with this.

@rafaelbn rafaelbn added this to the 9.0 milestone Apr 26, 2018
@rafaelbn
Copy link
Member

Hi @wpichler thank! for this work! Please you have duplicated this PR with #267 could you close one and the continue in the other? Thank you!!! 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants